lab service --start --ephemeral leaks PATH_VAR/PATH_BUILD/PATH_CODE into the child + acquire chatter pollutes --json stdout #300
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
lab service <name> --start --ephemeral --jsonoverridesPATH_ROOTon the spawned child (sohero_var_dir()lands under scratch) but leavesPATH_VAR/PATH_BUILD/PATH_CODEinherited from the parent.herolib_core::base::path_var()checksPATH_VARfirst and only falls back to$PATH_ROOT/var, soresolve_socket_dir()resolves to$HOME/hero/var/sockets— the shared path — even though OSIS storage correctly lands under scratch.Result: the child happily binds
$HOME/hero/var/sockets/<svc>/rpc.sockwhile lab waits for<scratch>/var/sockets/<svc>/rpc.sock, hits the 5s deadline, and bails withstderr tail: <empty>(the banner that would reveal the mismatch only ever lands instdout.log, which lab doesn't surface).Reproducible by following the post-#138 / hero_service#12 E2E flow on a contributor box that exports
PATH_VAR=$HOME/hero/var(the canonicallab user initsetup):Each test panics with
ephemeral socket <scratch>/var/sockets/hero_service/rpc.sock did not come up within 5s.A second, smaller bug compounds the first:
acquire_binarywrites itsusing installed …/installed from Forge → …progress lines to stdout, so even when the spawn succeeds the JSON envelopelab --jsonemits is preceded by chatter —serde_json::from_sliceon the test driver side rejects it.Goals
crates/lab/src/service/ephemeral.rs::spawn_innerclearsPATH_VAR/PATH_BUILD/PATH_CODE(alongside the existingHERO_SOCKET_DIR/INTEGRATIONTESTremoval) so the child's path resolvers honour the singlePATH_ROOTpivot.stdout.logandstderr.log(the startup banner that fingerprints env-pivot bugs lives in stdout).acquire_binary's progress chatter (using installed,installed from Forge) routes to stderr so--jsonstdout stays a single line.cargo test --workspace --test greeter_e2e(hero_service @fe8c78ad) goes 5/5 green on a stock contributor environment.Completed
Fixed in PR #301 (squash-merged into
development).crates/lab/src/service/ephemeral.rs::spawn_innernow clearsPATH_VAR/PATH_BUILD/PATH_CODEin addition toHERO_SOCKET_DIR/INTEGRATIONTESTso the child'spath_var()/path_build()/path_code()fall through to thePATH_ROOT-derived defaults.read_log_tailstails bothstdout.logandstderr.logon spawn failure — the resolved socket path printed byprint_startup_bannerlives in stdout and is now visible in error messages.acquire_binaryprogress lines (using installed …,installed from Forge → …) route to stderr solab --start --ephemeral --jsonstdout is exactly one JSON envelope.Verification
lab service hero_service --start --ephemeral --jsonreturns a one-line JSON envelope on stdout, chatter on stderr, child binds the correct scratch socket.cargo test --workspace --test greeter_e2e -- --test-threads=1(hero_service @fe8c78ad): 5/5 pass.lab service hero_service --test layer2exercises the spawn machinery successfully through tonu(only blocker on this dev box isnunot being installed).Out of scope (filed separately if not already known)
_findE2E suite returns the unfiltered union for everyStrFilter/EnumFilterquery — pre-existing indexer issue surfaced now that the spawn works.servicecatalog_*handlers reject seeded input (InvalidParams: "service name is required","Not found:") — pre-existing service-side bug, also unrelated.