Skip to content

system_interface: drive layout ops against the pre-merge preview#194

Open
gnguralnick wants to merge 3 commits into
mainfrom
gabriel/system-interface-edit-layout
Open

system_interface: drive layout ops against the pre-merge preview#194
gnguralnick wants to merge 3 commits into
mainfrom
gabriel/system-interface-edit-layout

Conversation

@gnguralnick

Copy link
Copy Markdown
Contributor

Lets the previewing agent drive manage-layout ops against the pre-merge preview in the update-system-interface flow, so it can navigate the preview straight to the scenario being reviewed instead of leaving the user to click around the preview app.

What changed

  • SYSTEM_INTERFACE_LAYOUT_DIR override (apps/system_interface/.../server.py): _primary_agent_layout_dir() now honors this env var, taking precedence over the MNGR_AGENT_ID-derived path. This decouples where layout is persisted from agent identity.
  • Preview persists to a throwaway dir (reveal_system_interface.py): the preview command points SYSTEM_INTERFACE_LAYOUT_DIR at a dir under the preview's own state instead of neutering persistence. The preview therefore supports a full inspect/list (and wait-stable confirmation + no-op detection), while still never touching the live layout.json. unpreview cleans it up with the rest of the state dir.
  • preview_layout.py wrapper (new, stdlib-only): reads inner_port from the preview state file and runs scripts/layout.py against the preview instance via MINDS_WORKSPACE_SERVER_URL. Every manage-layout verb works verbatim but lands on the dockview inside the preview frame, not the live UI.
  • Skill docs (SKILL.md): a "drive the preview to the scenario" step (distinguishing it from layout.py open si-preview, which arranges the live tab hosting the preview), plus an instruction to tear the preview down before the worker reworks on a rejection/change request, so it never serves stale, in-flux, or half-built assets.

Because the preview drops MNGR_AGENT_ID, the self ref resolves only when the lead's chat tab is open in the preview; the docs recommend explicit chat:<name> refs (discoverable via list) for anchoring.

Tests

  • apps/system_interface: override precedence + save/get round-trip through the override dir (server_test.py).
  • Skill scripts: the preview env var is asserted (reveal_system_interface_test.py); new preview_layout_test.py covers state loading, port validation, and the layout invocation (via an injected runner).
  • Full apps/system_interface unit+integration suite passes (3 pre-existing failures are environmental — two Playwright browser e2e tests and one subprocess-spawn test — and fail identically on main).

Gabriel Guralnick added 3 commits June 22, 2026 12:03
Add a SYSTEM_INTERFACE_LAYOUT_DIR override so the preview instance persists its
own dockview layout to a throwaway dir under its state rather than clobbering the
live layout.json, and a preview_layout.py wrapper that runs scripts/layout.py
against the preview's inner port. This lets the previewing agent navigate the
preview to the scenario being changed (inspect/open/focus/split/maximize) instead
of the user clicking around. The skill also now tears the preview down before the
worker reworks on a rejection/change request, so it never serves stale, in-flux,
or half-built assets.
Problem: reveal_system_interface.py's comment on the preview layout-dir
override claimed ''inspect'' / wait-stable / ''self'' all work with ''full
fidelity'', but the ''self'' ref is resolved server-side from the lead's
MNGR_AGENT_ID to that agent's own chat panel, which is not guaranteed open
in the preview's dockview. The wrapper docstring and SKILL.md already caveat
this, so the comment was misleading and self-contradictory.
Fix: reword the comment to claim fidelity only for what actually works
(inspect/list, wait-stable, no-op detection, surviving reload) and note that
''self'' depends on the lead's chat tab being open, pointing to explicit
chat:<name> refs -- consistent with the wrapper docstring and SKILL.md.
scripts/layout.py already targets whatever MINDS_WORKSPACE_SERVER_URL points at,
so the preview_layout.py wrapper was ~290 lines (incl. tests) doing little more
than resolving inner_port and prefixing that env var. Remove it. Instead, the
preview command now prints a copy-pasteable
MINDS_WORKSPACE_SERVER_URL=http://127.0.0.1:<inner_port> layout.py invocation, and
the skill documents pointing layout.py at the inner port directly. The
SYSTEM_INTERFACE_LAYOUT_DIR backend override -- the one genuinely necessary change,
which lets the preview inspect/persist its own layout -- stays.
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