doxa-maps/documentation
doxa-maps-88655c70 c276a2158e Gate the embed contract: a composite must pass tk and provider down
Four elements shipped with this broken and nothing could see it, because every
existing gate loads a composite on its OWN generated leaf — and that leaf bakes a
token and assigns window.MAP_TOKEN, supplying the very thing under test. The
failure exists only where there is no leaf: the partner page the published embed
snippet is written for.

The gate serves the built tree on one free port and a partner page on another, so
CORS is exercised rather than assumed, and asserts per composite:

  tk        given only {"tk": <the token this tree bakes>}, a canvas appears and
            api.mapbox.com actually serves it
  provider  given only {"provider":"maplibre"} and NO token, a canvas appears and
            there are ZERO requests to api.mapbox.com

Zero is the assertion, not "it rendered": a build that quietly fell back to
mapbox with a baked key renders perfectly and is exactly the regression this
exists to catch.

★ IT FAILS ONLY WHERE THE EVIDENCE POINTS AT THE KNOB. The first draft failed
NINE composites for "no map canvas under a minimal config" — an accusation it had
not measured, since several of those elements simply need a `profile` key to
choose which profile to show. It now distinguishes: a token WAS supplied and the
element still says there is none, or maplibre was asked for and mapbox tiles
still loaded — those are findings. No canvas and no complaint is UNMEASURED, and
says so with the reason. A gate that red-lights other people's plugins over a
claim it cannot support is worse than no gate.

COST, because a slow gate stops being run: a flat 14s-per-case wait became a poll
for the canvas, and the provider case short-circuits when that element's tk case
drew no map — there is nothing to compare against, so a second page load was pure
waste. 5m38 -> 3m15.

GREEN on the landed tree: dashboard-plus-grid, research-map-plus-grid, stack-demo
and plugin-studio all pass both knobs, every provider case at ZERO api.mapbox.com
requests. plugin-studio only reached zero once the cap-5 shell started setting
window.MAP_PROVIDER — profile-config alone reaches the child a composite writes
config for, while the global rung reaches a map nested at any depth, which the
studio-inside-SPA-inside-composite chain needed.

gates:post is 44 steps; the quoted CLI doc is updated to match.
2026-09-24 20:26:33 +00:00
..
architecture Research Gallery: embed on someone else's page, in both modes 2026-09-24 19:03:37 +00:00
assets consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
contributing README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
readme-images README: screenshots first — one per capability, three deployments shown live, the studio last 2026-09-24 19:55:24 +00:00
screenshots consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
CONTRIBUTING.md README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
develop-a-plugin-and-see-it-live.md README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
explanation.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
how-to.md Land the swarm's work: no iframes anywhere, a tree that keeps its shape, deeper facets 2026-09-22 14:51:52 +00:00
README-embed-example.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
README-longform.md README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
README-SECTION-3-cli-commands.md Gate the embed contract: a composite must pass tk and provider down 2026-09-24 20:26:33 +00:00
README.md README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
reference-capability-exemplars.md Regenerate capability-exemplars table (stale after legacy bundle; unblocks check:capability-exemplars) 2026-09-24 19:58:17 +00:00
reference-library-index.md Merge main into bundler-1/work (regenerate the tree, re-hash) 2026-09-24 05:33:32 +00:00
reference.md README: lead with the objectives, showcase the Research Gallery, teach the agent swarm 2026-09-24 18:34:02 +00:00
slide-deck-outline.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
tutorial.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
vendored-font-noto-serif-devanagari.md Move the vendored font's README out of the served folder 2026-09-24 04:15:26 +00:00
why.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00

documentation/ — pick your path

        "what is this?"          "teach me"        "how do I …?"       "look it up"      "all the detail"
             │                       │                   │                  │                  │
         why.md  ──────────►  tutorial.md  ────►  how-to.md  ────►  reference.md  ───►  architecture/
        (2 min, 1 diagram)   (first map)         (task recipes)     (tables)           (contracts)
  • why.md — the problem and the "map islands" idea. Start here.
  • tutorial.md — build your first map, no jargon.
  • how-to.md — recipes: embed, iframe, SPA, colors, CDN, mobile, tokens.
  • reference.md — config fields, build scripts, the profile-config contract.
  • explanation.md — the model in 15 lines.
  • architecture/ — the deep end: full contracts, the per-file catalog.
  • README-embed-example.md — the drop-in README used when this bundler is embedded inside a host repo.

Working on the repo:

Nothing on the simple path is longer than a few minutes; everything complex lives in architecture/, linked from where you'd need it.