Conversation
Daemon proxies /embed/ce/* → 127.0.0.1:8766 and /embed/okstratr/* → :8767 with loopback-only upstream guard and X-CE-Host / X-Okstratr-Host: switchbay. Feature-flag Graph/Agents to proxied same-document panels (default off). ADR-004 + allowlist tests.
Avoid flashing the lazy AgentDashboardTab while /api/settings loads when proxied embeds are on (that race showed as module script import failures). Clarify 502 upstream messaging.
Start and health-check curiosity-engine viewer.sh serve for /embed/ce, restart on death, and rebuild the static bundle when wiki mtime changes. Toggle via Settings proxied_skill_embeds; supervisor runs as a daemon background task so Graph does not 502 when the viewer process exits.
ProxiedSkillPanel listens for sy:files-changed (dispatched from the WS files_changed handler), debounces, and soft-refetches /embed/* with cache-busting so the panel updates without a full loading flash. CE supervisor rebuilds on wiki mtime and broadcasts files_changed; embed proxy forces Cache-Control: no-store so stale HTML shells do not stick.
Ben lock / contract C1+C2 (Switchbay half):
- okstratr_supervisor mirrors CE: spawn `okstratr serve --host/--port`
(PATH binary or python -m; SWITCHBAY_OKSTRATR_BIN / UPSTREAM overrides),
health /health, restart on death; pid/log under ~/.local/state/switchbay/
- Daemon on_startup always starts CE + okstratr supervisors (proxied_skill_embeds
remains UI panel choice only; no longer gates keep-alive or tears down CE)
- GET /api/core-skills/status → {ce, okstratr, wiki_build} contract shape
- POST /api/okstratr/host-notify maps okstratr.host_notify → protocol.notice
rail broadcast (path-native; no OS/email channel)
- Unit tests for URL/port/argv helpers, notify mapping+HTTP, status shape;
embed_proxy tests still green
Execute proxied CE/okstratr scripts in-panel (no iframe): rewrite asset URLs under /embed/*, inject markup, createElement-append classic/module scripts, tear down on soft-reload. Poll /api/core-skills/status for starting/unhealthy/building-wiki/live banners and suppress 502 flash while supervisors are still starting.
Wire Settings → Harness registry (okstratr) through /api/okstratr/harness* (enable/disable/set/reload) calling loopback upstream with X-Okstratr-Host. No parallel Switchbay allowlist; Pi/local LLM panels labeled as rail-only. ADR-005 + tests with mocked okstratr JSON.
Owner
Author
Harness registry SSOT client (pushed
|
CE filebrowser only writes .workbench/pack-runs/*.json as queued; Switchbay now polls (~4s) and exposes POST /api/packs/drain to seat _dispatch_chat like handle_pack_action. Shared JSON status is rewritten atomically — no CE PATCH. Tests mock dispatch (no paid model seats).
Thin-shell wiring: Browser/Zen upload posts to CE SSOT (/embed/ce/api/ingest/from-upload) when the embed proxy is up, with fallback to local /api/ingest/from-upload.
Parity with pack-runs drain (ADR-006): poll .workbench/ingest-runs/, POST /api/ingest/drain, opportunistic kick on files_changed. Prefer deterministic CE local_ingest; escalate to _dispatch_chat only when run metadata opts in. Refuse vault_path escape / .. components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/embed/ce/*→127.0.0.1:8766,/embed/okstratr/*→127.0.0.1:8767, with loopback-only upstream guard andX-CE-Host/X-Okstratr-Host: switchbay.proxied_skill_embeds(default off) switches Graph → CE and Agents → okstratr same-document panels via/embed/*(no iframes). Embed v2 same-document mount (ADR-004b).okstratr_harness+ daemon routesGET/POST /api/okstratr/harness(enable/disable/set/reload). Writes okstratrharnesses.tomlSSOT — no second Switchbay allowlist. Pi/local LLM panels labeled as rail-only.Test plan
PYTHONPATH=src uv run --no-sync pytest tests/unit/test_embed_proxy.py tests/unit/test_okstratr_harness.py -q/embed/ce/and/embed/okstratr//api/okstratr/harnessreturns 502 with clear errorSWITCHBAY_OKSTRATR_UPSTREAM→ 502Do not merge until Ben reviews E2E evidence (charter).