Problem
Runtime Host currently defines the same isNodeError(error, code) guard in several independent modules. The copies are byte-level duplicates today, but some use a type predicate while others return boolean; the drift makes error handling harder to audit and encourages ad-hoc casts at filesystem boundaries.
Scope
- Add one Runtime Host-local Node errno guard with the existing conservative
Error and exact-code semantics.
- Migrate
control/endpoint.ts, operator/managed-deployment.ts, and peer-reachability/publisher.ts.
- Keep the control registration/startup and peer-mesh modules out of this PR because they are covered by an active Windows durability change.
Acceptance criteria
- The migrated modules have no local duplicate guard and preserve their current type narrowing and behavior for
ENOENT, EPERM, and other codes.
- Non-Error values and mismatched codes continue to return false.
- A focused unit test pins the shared guard's type-predicate behavior.
This follows the parallel-helper finding in the repository audit and is intentionally limited to files without an active PR conflict.
Problem
Runtime Host currently defines the same
isNodeError(error, code)guard in several independent modules. The copies are byte-level duplicates today, but some use a type predicate while others returnboolean; the drift makes error handling harder to audit and encourages ad-hoc casts at filesystem boundaries.Scope
Errorand exact-code semantics.control/endpoint.ts,operator/managed-deployment.ts, andpeer-reachability/publisher.ts.Acceptance criteria
ENOENT,EPERM, and other codes.This follows the parallel-helper finding in the repository audit and is intentionally limited to files without an active PR conflict.