Skip to content

feat(web): graduate context gateway tabs to prod tier#488

Merged
memtomem merged 2 commits intomainfrom
feat/web-context-gateway-prod
Apr 26, 2026
Merged

feat(web): graduate context gateway tabs to prod tier#488
memtomem merged 2 commits intomainfrom
feat/web-context-gateway-prod

Conversation

@memtomem
Copy link
Copy Markdown
Owner

Summary

  • Move the four Context Gateway routers (context_gateway, context_skills, context_commands, context_agents) from _DEV_ONLY_ROUTERS to _PROD_ROUTERS in web/app.py, and flip the four matching settings-nav-btn data-ui-tier="dev" → "prod" in static/index.html. Net effect: the Artifact Sync / Skills / Commands / Agents tabs ship in the polished surface that all uv tool install users see, instead of being gated behind mm web --dev.
  • This is a UX maturity decision, not a security one. Per feedback_tier2_web_gating_deferred.md, Tier 1 (loopback + single user) is the only supported deployment shape; the mutator endpoints under /api/context/* (POST/PATCH/DELETE) keep the same trust origin as before — already exposed prod endpoints like /api/config PATCH have the same gating model.
  • The dev-only label was earned during early churn. The hardening that landed in fix(context): preserve ## <Agent>-Specific sections through round-trip #482 (round-trip ## *-Specific preservation), feat(context)!: codex_agents project-scope default #483 (project-scope codex_agents default), and fix(context): confirm before settings sync writes outside the project #484 (settings-sync host-write confirm) closes the last rough edges that justified hiding these tabs from polished-surface users.

Test plan

  • uv run ruff check packages/memtomem/src + ruff format --check — clean
  • uv run pytest -m "not ollama" — 2514 passed
  • test_web_mode updates:
    • expected_dev drops ctx-overview, ctx-skills, ctx-commands, ctx-agents
    • dev-only-route parametrize drops /api/context/overview
    • test_prod_keeps_polished_routes_mounted adds the four /api/context/* paths
  • Live smoke against mm web (prod, isolated HOME + state dir):
    • /api/system/ui-mode{"mode":"prod"}
    • /api/context/{overview,skills,commands,agents} → all 200
    • /api/{namespaces,settings-sync,sessions,watchdog/status} → all 404 (dev-only stays gated)
    • SPA renders the four tabs under 연동 / Integrations, dev-only sections still hidden, Artifact Sync page loads cleanly

Notes

  • No app.js changes needed: the Home dashboard devMode gate only covers /api/namespaces, /api/sessions, /api/scratch — context endpoints are not fetched from Home.
  • settings_sync (the user-scope ~/.claude/settings.json writer) stays in _DEV_ONLY_ROUTERS. It's behaviorally adjacent but its UX surface (e.g. host-write confirm flow) is still maturing; promoting it is a separate decision.
  • See scripts/context-gateway-review-plan.md PR-4 for the original audit context.

🤖 Generated with Claude Code

pandas-studio and others added 2 commits April 26, 2026 12:10
The Context Gateway settings panes (Artifact Sync, Skills, Commands,
Agents) have been gated behind ``mm web --dev`` since their
introduction. The hardening that landed in #482/#483/#484 (round-trip
preserve, project-scope codex_agents default, settings-sync confirm)
closed the last UX rough edges that justified the dev-only label, so
the four routers and their SPA tabs now ship in the polished surface
all ``uv tool install`` users see.

* ``_PROD_ROUTERS``/``_DEV_ONLY_ROUTERS`` swap in ``web/app.py``
* matching ``data-ui-tier="dev" → "prod"`` flips on the four
  ``settings-nav-btn``s in ``index.html``
* ``test_web_mode`` updates: drop ``ctx-*`` from ``expected_dev``,
  drop ``/api/context/overview`` from the dev-only parametrize set,
  add the four ``/api/context/*`` paths to the prod-mounted sanity
  check

The dev/prod distinction here is UX maturity (not security) —
loopback-only Tier 1 already covers the threat model per
``feedback_tier2_web_gating_deferred.md``; mutator endpoints behave
identically to before and ``settings-sync``/namespace tools stay
dev-only.

Smoke-tested against ``mm web`` (prod): all four ``/api/context/*``
endpoints return 200, the four dev-only endpoints stay 404, and the
SPA renders the four tabs under "연동" / Integrations.

Co-Authored-By: Claude <[email protected]>
Per default-change-fanout, a user-visible default flip belongs in the
same PR as the docs that describe it. Three call sites referenced the
four context tabs (or `/api/context/*` endpoints) as dev-only and
needed their tier classification flipped.

* `docs/guides/reference.md` — extend the prod page list with
  Artifact Sync + Skills/Commands/Agents, drop them from the dev-only
  paragraph, and remove `/api/context/*` from the dev-only endpoint
  example list.
* `docs/guides/configuration.md` — same `/api/context/*` removal in
  the parallel paragraph under the env-var doc.
* `CHANGELOG.md` — Unreleased entry capturing the tier graduation,
  the hardening PRs (#482/#483/#484) that earned it, and a
  forward-looking note that prod now ships its first mutator-heavy
  surface so Tier 2 hardening (deferred per
  `feedback_tier2_web_gating_deferred.md`) starts here.

No code changes — paired with the previous commit which moves the
routers and SPA `data-ui-tier` flips.

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit 8760117 into main Apr 26, 2026
7 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 26, 2026
@memtomem memtomem deleted the feat/web-context-gateway-prod branch April 26, 2026 03:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants