Skip to content

Runtime map: make the composed runtime discoverable and type-safe - #428

Merged
elliotBraem merged 6 commits into
mainfrom
feat/runtime-map
Oct 24, 2026
Merged

elliotBraem merged 6 commits into
mainfrom
feat/runtime-map

Conversation

@elliotBraem

Copy link
Copy Markdown
Contributor

Why

Agents (and humans) working in this child runtime can't answer the two questions that decide every change: who owns this screen? and where does this change belong? The mechanisms are sound — core-wins route claiming, in-process plugin clients, manifest composition — but none of it was discoverable from the repo, and the auth-ui break-off (c747a6195) left a wake of references to a workspace that no longer exists.

This PR makes the composition surface generated, not guessed, and corrects the docs that taught the old shape.

What changed (5 commits)

  1. chore: sweep post-break-off stale references — dead plugins/auth docs, 16 changesets referencing the absent @everything-dev/auth-plugin (stripped 11, deleted 5 auth-only), a Tailwind @source pointing at the deleted dir, bun→pnpm in SECURITY/ui docs, dead generate-metadata script, frozen-snapshot provenance header on the auth fixture schema.
  2. feat(runtime-map): generate the composed route inventory — scripts/gen-runtime-map.mjs reads the resolved config, loads local + remote ui manifests (remote route manifests live at <ui.production>/manifest.gen.json), applies core-wins statically, and emits .bos/generated/runtime-map.json + ui/src/lib/runtime-map.gen.ts (REMOTE_ROUTES, RemotePath, sources, mounts, shadowed, unresolved). Loud on a failed remote fetch (BOS_MAP_ALLOW_UNRESOLVED=1 escapes offline). Wired into types:gen.
  3. feat(ui): type non-navigational plugin paths against the runtime map — FOCUSED_PREFIXES and settings-section keys derive from RemotePath; an upstream rename now fails typecheck.
  4. docs: make the composition story discoverable — new docs/runtime-map.md (sources, mounts, core-wins, three change routes, upstream loop, pluginPath boundary, known limits), AGENTS.md truth pass (local vs remote plugins, mount-based auth sample, component placement), docs/adr/README.md index, GLOSSARY.md → CONTEXT.md, everything-dev-app skill fixes.
  5. docs(tests): document the harnesses and wire the dev:csr suite — tests/README.md (which-harness table, fast loops, Playwright prerequisites/cost, coverage map), and dev:csr is now reachable (--project=dev:csr, 53 tests).

Verification

  • pnpm run lint — green
  • pnpm run typecheck — green (all workspaces; regenerates the map)
  • pnpm run test — green (api, ui, plugins, runtime-map)
  • pnpm run verify:runtime-map — static model vs the real constructTree: 46/46 paths, identical mount counts
  • Negative test: a typo'd plugin path fails typecheck with the generated union in the error
  • REGRESSION_MODE=dev:csr … playwright --list — 53 tests under [dev:csr]

Upstream

  • everything-dev#345 — spike verdict posted (native to needs full regeneration in the upstream typegen; FileRoutesByPath augmentation cannot widen RoutePaths)
  • #584 / feat(admin): add a condensed app info popover to the admin header #453 / #556 — child reproductions + loud-degradation / misdirecting-codegen-error gaps confirmed
  • #591 — new: composition inspector / generated runtime map

Not included

Native to for plugin paths (ticket 04) is blocked on everything-dev#346 ("no interim casts"). A local type widening would be a fiction; the generator + verdict are the upstream-ready reference instead. pluginPath remains the documented boundary.

The auth-ui deletion (c747a61) left references to a workspace that no
longer exists. Remove the dead paths and correct the docs that pointed at
them:

- changesets: drop the @everything-dev/auth-plugin entry (16 files carried
  it; a workspace-member check fails the release workflow) — 4 deleted as
  auth-plugin-only, 11 reflowed to their local bumps
- ui/src/styles.css: drop a Tailwind @source pointing at the deleted dir
- docs: rewrite better-auth-referral.md (auth is remote; upstream pointers),
  add dated banners to the pre-break-off walkthroughs, fix the README
  "fork exists in this repo" claim
- SECURITY.md / ui/README.md / ui/DESIGN.md / ui/public/skill.md /
  ui/package.json: pnpm not bun; drop the dead generate-metadata script
- regression: add a frozen-snapshot provenance header to fixtures/auth/schema,
  fix dead-path comments in csr-compose/member-seed/auth-test-instance
- docker-compose: note the auth DB's DDL owner is the remote plugin

Verified: pnpm run lint, pnpm run typecheck, pnpm run test:regression:unit.
scripts/gen-runtime-map.mjs reads the resolved config, loads local and
remote ui manifests (remote route manifests live at
<ui.production>/manifest.gen.json), applies the host's core-wins
precedence statically, and emits .bos/generated/runtime-map.json plus
ui/src/lib/runtime-map.gen.ts (REMOTE_ROUTES / RemotePath / sources /
mounts / shadowed / UNRESOLVED_SOURCES).

- wired into types:gen; loud on an unresolved remote fetch
  (BOS_MAP_ALLOW_UNRESOLVED=1 escapes for offline work)
- verify-runtime-map.mjs cross-checks the static model against the real
  constructTree engine (46/46 paths, identical mountCounts)
- deterministic unit tests wired as test:runtime-map and into pnpm test

Spike verdict (posted to everything-dev#345): native `to` typing needs
full regeneration in the upstream typegen — FileRoutesByPath augmentation
cannot widen RoutePaths, which reads the tree's baked-in fileRouteTypes.
No interim cast shipped (everything-dev#346).

Verified: pnpm run lint, pnpm --dir ui run typecheck, pnpm run
test:runtime-map, pnpm run verify:runtime-map.
FOCUSED_PREFIXES and the settings-section labels now derive from the
generated REMOTE_ROUTES union, so an upstream route rename fails
typecheck instead of silently mismatching:

- _public.tsx: FOCUSED_PREFIXES satisfies readonly RemotePath[]
- breadcrumbs.ts: settings section keys satisfy
  Partial<Record<RemoteSettingsSection, string>>, derived from RemotePath

Navigational breadcrumb paths stay widened strings until the composed
tree is registered (ticket 04 / everything-dev#346).

Verified: pnpm run lint, pnpm --dir ui run typecheck, negative typo test.
…DRs)

AGENTS.md is the first interface every agent crosses and it described the
pre-break-off fork. Correct it and add the authored runtime map:

- docs/runtime-map.md: sources (core ui local, auth remote, plugins local),
  mounts + core-wins precedence, the three ways to change a screen, the
  upstream PR → release → pin-bump loop, pluginPath boundary, known limits
- AGENTS.md: local vs remote plugins; Runtime map section; mount-based auth
  sample (the /_layout sample did not exist); primitives vs colocated
  feature components; runtime-map.gen.ts in Generated Types
- docs/adr/README.md: resolve cited ADR numbers to upstream URLs
- GLOSSARY.md: pointer to CONTEXT.md; docs/agents/domain.md updated to the
  real child-runtime layout
- everything-dev-app skill: bos.app.ts, bos deploy, pnpm dlx, composition
  skill pointer

Verified: pnpm run lint, pnpm run typecheck.
The <30s loop existed but was undocumented, and dev:csr was implemented in
regression-env.mjs yet reachable by no script.

- tests/README.md: which-harness table, fast suites (in-process PGlite, no
  docker), Playwright commands (one spec + --grep), prerequisites, the 5-min
  webServer budget / no-reuse / stall watchdog, non-gating CI, the Stack x
  Variant reconciliation, coverage map, auth-fixture drift note
- playwright.config.mjs: project name is the active REGRESSION_MODE, so
  --project=dev:csr is valid
- scripts: regression:dev:csr, test:regression:browser:dev:csr,
  test:regression:browser:all

Verified: pnpm run lint, pnpm run test:regression:unit, and
REGRESSION_MODE=dev:csr playwright --list (53 tests).
@elliotBraem

Copy link
Copy Markdown
Contributor Author

Retro follow-up just opened as #431 (stacked PR, branch docs/agent-flow-and-goals): the change-placement flow doc, the human explainer, and the CODING_STANDARDS goals — plus the first finding applied to this PR itself:

Heads-up on a merge conflict: #416 (fix/stale-changesets) touches the same 16 .changeset/ files this PR stripped (@everything-dev/auth-plugin entries + 4-dead-file deletions). Intents look aligned; whoever merges second should expect the diff to reduce to maybe whitespace — happy to rebase either way.

Upstream pairing for this PR's sync-owned edits (root package.json, ui/package.json, docs/agents/*, AGENTS.md — which bos upgrade regenerates wholesale): the framework side is tracked in everything-dev#594 (types gen owns the inventory → removes the child types:gen hook), #595 (@shadcn/lint wiring), and the package comment on everything-dev#577 (child AGENTS regeneration + skills-lock trim, "docs parity"). Until those land, the local edits are the reference implementation; after an upgrade that doesn't include them, compare against .bos/sync-backup/ before reverting anything.

@elliotBraem
elliotBraem added this pull request to stack #432 October 24, 2026 20:18
# Conflicts:
#	tests/regression/fixtures/auth/schema.ts
@elliotBraem
elliotBraem merged commit cd4dd20 into main Oct 24, 2026
6 checks passed
@elliotBraem
elliotBraem deleted the feat/runtime-map branch October 24, 2026 21:11
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