---
name: isolated-home-isolates-broker-socket
description: "An isolated SPT_HOME also isolates the broker socket NAME (it is home_tag-derived), so in-daemon code that cold_starts the broker is deterministic under with_home even on a host running live daemons — no observation injection needed."
metadata: 
  node_type: memory
  type: project
  originSessionId: f00db312-b246-4fd9-8f2f-287d90c36201
  modified: 2026-08-01T17:38:08.495Z
---

`spt-daemon`'s socket names (`broker_socket_name`, `seed_socket_name`, …) are
built from `home_tag()`, which hashes `spt_home()`. So a test using
`crate::test_home::with_home` gets a socket name **no live daemon holds**:
`Brain::cold_start` fails fast (single connect, no retry loop), and any code
path that queries the broker degrades to its no-broker arm deterministically.

Why it matters: HFENDULEAM runs live daemons all day. A serve-side function
that reads broker state (e.g. DOORBELL W3's `answer_presence_probe` →
`broker_session_idle`) looks environment-dependent and tempts you into
injecting the observation as a closure just to test it. It isn't — under
`with_home` the real function is deterministic, so the test can drive the REAL
path (which is what proves the no-side-effect claims; a stubbed observer would
prove them only about the stub).

Registry rows resolve the same way: `registry::register_address` under the
isolated `perch::owlery_dir()` survives `resolve_address`'s stale-clean when
registered under the test process's own (alive) pid, so a real `TcpListener`
bound in the test is reachable through the production lookup.

Related: [[daemon-lib-tests-deadlock-on-live-host]] (the lifecycle tests that
genuinely do need CI), [[unit-lane-inprocess-isolation]].
