fix issues found while validating native releases (#2361) master
* add platform fidelity telemetry: libc, cpu baseline, os release os_family + architecture cannot answer whether Linux users are on musl or whether x86_64 users have AVX2. Both gate replacing the 377 MB standalone-Node bootstrap with a single native binary. baseProperties() now also reports libc, libc_version, cpu_baseline, os_release and os_product_version. Detection lives in core/platform-fidelity.ts: no subprocesses, bounded reads, memoized per process, and every failure path degrades to "unknown" instead of throwing. * make the version check and npm bridge suites hermetic these two suites read update and daemon-worker environment variables, so running them from inside a live prime-agent session inherited that session's own settings and produced 4 and 24 failures while ci stayed green. a shared test/ambient-env.ts helper now lists every variable the code under test reads, clears them for in-process tests, and strips them from the environment handed to spawned children. no test behaviour was weakened; cases that need a variable set it themselves. * route commands written after global flags prime-agent only treated argv[1] as a subcommand, so forms like `--offline model list` and `--daemon-socket <path> status --json` were sent to the model as chat messages. Share the positional scan used by the early daemon launch decision with public command routing and rotate leading global flags behind a recognized command. `--` and one-shot print runs still keep their positional as message text. * scope daemon discovery to the state root it runs in * give the compiled executable probe a workable timeout cold rosetta 2 translation of the 51 mb darwin-x64 binary takes about 11s, so the flat 10s probe deadline failed every install on apple silicon. raise the default budget to 60s, allow PRIME_AGENT_PROBE_TIMEOUT_SECONDS to override it, and report a probe timeout as a timeout instead of claiming the machine cannot run the executable. * keep hidden supervisors in scope for home-scoped daemon discovery A supervisor that hands its runtime to a successor is no longer the registered owner, so the ownership registry cannot name it and only the OS socket sweep can still see it. Scoping discovery to the socket dir plus the registry therefore put those hidden supervisors out of reach of daemon ps and shutdown --force, leaking them permanently (ENG-4603 regression). A socket inside our agent dir is unambiguously ours, because another HOME resolves to another agent dir, so the matcher now honours it. That restores the reach the regression test expects without widening scope back to the whole machine. * keep rotated global flags ahead of the -- separator * treat help written after global flags as a help request * trust the glibc runtime over an installed musl loader in telemetry * describe os_release honestly in the telemetry disclosure * read leading-zero probe timeout overrides as decimal * fix(coding-agent): spawn the eng-4603 supervisor fixture in-process for shutdown discovery The tsx CLI wrapper forks: the spawned pid owns only tsx IPC pipes while the real supervisor (and its daemon socket) hides in an untracked child pid, so the shimmed OS socket sweep only ever saw the wrapper pipes. Pre-merge shutdown --force passed by force-killing those wrappers; the state-root scoping correctly disowns them (they sit in TMPDIR/tsx-<uid>, not our socket dir, agent dir, or registry), which left the chain stopped-nowhere and failed the regression. Run the fixture with node --import tsx's ESM loader so the spawned pid is the listener again. * keep the help topic when an explicit help flag follows it * fix(coding-agent): include the legacy registry and skip stale records in scoped daemon discovery Scoped discovery reads only the current supervisor ownership registry, so daemons started before the registry moved out of the socket dir became invisible to daemon ps and shutdown --force under the same agent dir; and one record whose agent dir can no longer be canonicalized aborted the whole sweep. Read the legacy location too (mirroring the fence and owner-assert paths, gated off when the registry is overridden) and skip per-record canonicalization failures so one stale record cannot hide the rest. Document why the socket dir stays part of the state root. * mirror parseArgs value consumption in the command scanner * keep a version request ahead of command routing * keep short version flags ahead of command routing too * treat system prompt runs as prompt runs instead of rotating their message * boot the daemon early for prompt-value runs that keep their word on the chat path