Skip to content

test(cli): live profile-router spawn/route/reap integration test - #233

Open
FerroxLabs wants to merge 4 commits into
mainfrom
feat/pr7-2d-profile-router-live
Open

test(cli): live profile-router spawn/route/reap integration test#233
FerroxLabs wants to merge 4 commits into
mainfrom
feat/pr7-2d-profile-router-live

Conversation

@FerroxLabs

Copy link
Copy Markdown
Owner

PR-7 increment 2d — live end-to-end coverage of the profile SUPERVISOR/ROUTER.

Context

The profile router (CliProfileRouter) and RosterEntry (increments 2b/2c) already shipped in #220. Its only tests were fail-closed unit checks in profile_router.rs that never spawn a child. Per Sean's FEATURE-DECISIONS ruling (core profiles must be first-class + fully tested before Hermes #66 surfacing), this closes the one real gap: a live test that exercises the whole topology.

What it does

A single hermetic integration test file (crates/wcore-cli/tests/profile_router_live.rs) driving three real processes:

test ──AcpClient/HTTP──▶ wayland-core acp serve --enable-profile-router  (supervisor)
                                   │ spawns + routes
                                   ▼
                         wayland-core acp serve --profile <name>          (child)
                                   │ engine turn
                                   ▼
                               MockLlm (POST /v1/messages)

Asserts the load-bearing behaviour of the increment:

  • opening a profile:<name> session spawns exactly one dedicated child (Unix pgrep -P on the supervisor pid);
  • a turn routes supervisor → child → the child's own provider and streams the reply back through both hops;
  • deleting the session reaps the child;
  • an unknown profile fails closed — rejected, no child spawned.

Hermetic by construction

Every process points WAYLAND_HOME/HOME at throwaway tempdirs, WAYLAND_PROFILES_ROOT is a throwaway tempdir (so the only profile in existence is the one the test seeds), the full provider-credential env set is stripped, and the mock scripts the turn — no real provider is contacted, no developer config/keys are read or mutated. Mirrors the acp_gate_d012.rs hermetic pattern.

Verification

Hetzner (Linux): nextest run -p wcore-cli --test profile_router_live6/6 passed, stable across 5/5 consecutive runs (~0.8s each, incl. the Unix spawn/reap pgrep assertions).

No production code change. New test file only.

PR-7 increment 2d. The profile SUPERVISOR/ROUTER (CliProfileRouter,
RosterEntry — increments 2b/2c) already shipped in #220; its only tests
were fail-closed unit checks that never spawn a child. This adds the
missing live coverage across three real processes: the wayland-core
supervisor (acp serve --enable-profile-router), the per-profile child
(acp serve --profile <name>), and a mock provider.

Asserts the load-bearing behaviour: opening a profile:<name> session
spawns exactly one dedicated child (Unix pgrep -P), a turn routes through
the child to its own credential home + provider and streams the reply
back, deleting the session reaps the child, and an unknown profile fails
closed without spawning anything. Hermetic: throwaway WAYLAND_HOME /
WAYLAND_PROFILES_ROOT per process, provider creds stripped, mock turn.
@FerroxLabs
FerroxLabs enabled auto-merge (squash) July 12, 2026 12:09
@FerroxLabs
FerroxLabs disabled auto-merge July 12, 2026 14:45
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.

2 participants