fix(lab): clear PATH_VAR/BUILD/CODE on ephemeral child + route acquire chatter to stderr #301

Merged
timur merged 2 commits from issue-300-lab-ephemeral-env into development 2026-05-25 10:32:41 +00:00
Owner

Summary

  • crates/lab/src/service/ephemeral.rs::spawn_inner now also clears PATH_VAR / PATH_BUILD / PATH_CODE when it pivots the child onto the scratch PATH_ROOT. Without that, an inherited PATH_VAR=$HOME/hero/var made the child's resolve_socket_dir() bind the shared ~/hero/var/sockets/<svc>/rpc.sock while lab waited on the scratch path, hitting the 5s deadline.
  • Spawn-failure messages now tail both stdout.log and stderr.log (read_log_tails). The Hero startup banner — which prints the resolved socket dir — lives in stdout; surfacing it would have turned the original repro into a one-line debug.
  • acquire_binary's using installed / installed from Forge progress lines route to stderr so lab --start --ephemeral --json stdout is exactly one JSON envelope (the contract tests/src/lib.rs::spin_up_service parses with serde_json::from_slice).

Test plan

  • Locally rebuilt lab via bash scripts/lab_build.sh.
  • Direct repro lab service hero_service --start --ephemeral --json returns a single-line JSON envelope on stdout (progress chatter on stderr) and the child binds the scratch socket; verified by listing /var/folders/.../lab-N/var/sockets/hero_service/rpc.sock.
  • cargo test --workspace --test greeter_e2e -- --test-threads=1 against hero_service @ fe8c78ad: 5/5 green (greeter_add, greeter_concat, greeter_echo, greeter_greet, greeter_info).
  • lab service hero_service --test layer2 reaches the nu invocation step (only failure is nu not installed on this dev box; the lab spawn path is exercised correctly).
  • Other E2E suites surface independent pre-existing failures (_find indexer queries return unfiltered, several servicecatalog handlers reject seeded input) that exist in the base commit and are out of scope here.

#300

## Summary - `crates/lab/src/service/ephemeral.rs::spawn_inner` now also clears `PATH_VAR` / `PATH_BUILD` / `PATH_CODE` when it pivots the child onto the scratch `PATH_ROOT`. Without that, an inherited `PATH_VAR=$HOME/hero/var` made the child's `resolve_socket_dir()` bind the shared `~/hero/var/sockets/<svc>/rpc.sock` while lab waited on the scratch path, hitting the 5s deadline. - Spawn-failure messages now tail both `stdout.log` and `stderr.log` (`read_log_tails`). The Hero startup banner — which prints the resolved socket dir — lives in stdout; surfacing it would have turned the original repro into a one-line debug. - `acquire_binary`'s `using installed` / `installed from Forge` progress lines route to stderr so `lab --start --ephemeral --json` stdout is exactly one JSON envelope (the contract `tests/src/lib.rs::spin_up_service` parses with `serde_json::from_slice`). ## Test plan - Locally rebuilt lab via `bash scripts/lab_build.sh`. - Direct repro `lab service hero_service --start --ephemeral --json` returns a single-line JSON envelope on stdout (progress chatter on stderr) and the child binds the scratch socket; verified by listing `/var/folders/.../lab-N/var/sockets/hero_service/rpc.sock`. - `cargo test --workspace --test greeter_e2e -- --test-threads=1` against hero_service @ `fe8c78ad`: **5/5 green** (`greeter_add`, `greeter_concat`, `greeter_echo`, `greeter_greet`, `greeter_info`). - `lab service hero_service --test layer2` reaches the `nu` invocation step (only failure is `nu` not installed on this dev box; the lab spawn path is exercised correctly). - Other E2E suites surface independent pre-existing failures (`_find` indexer queries return unfiltered, several `servicecatalog` handlers reject seeded input) that exist in the base commit and are out of scope here. https://forge.ourworld.tf/lhumina_code/hero_skills/issues/300
timur changed title from WIP: fix(lab): clear PATH_VAR/BUILD/CODE on ephemeral child + route acquire chatter to stderr to fix(lab): clear PATH_VAR/BUILD/CODE on ephemeral child + route acquire chatter to stderr 2026-05-25 10:32:29 +00:00
timur merged commit 40ebe3f84d into development 2026-05-25 10:32:41 +00:00
timur deleted branch issue-300-lab-ephemeral-env 2026-05-25 10:32:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!301
No description provided.