Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

11.3 KB
Raw Blame

Native conversation ownership through process and descriptor evidence

A partial process or open-file listing could previously look like an empty or unique Codex conversation. Discovery could choose a sibling; Stop could save no identity before terminating the process. This change makes unavailable, ambiguous and changing native evidence a typed IDENTITY_UNAVAILABLE hold. Binding, Stop and Close retain the session and its reason; a later complete lookup can recover without restarting the engine. The private daemon regression verifies readiness and a sibling continue during the outage.

Authority and bounds

The eager reader retains the expected process generation, executable, actual Linux argv, complete launcher child set, numeric descriptor pool, lossless device/inode keys, physical directory membership and every candidate header. Duplicate descriptors and hard links deduplicate by file identity. Invalid or unknown source metadata, malformed delegated claims and unreadable competing workspaces cannot make another candidate unique. macOS escaped names are resolved against kernel file keys. Directory aliases use physical identity, including case and normalization aliases; ancestor replacement and symlink target changes hold.

The final read joins process and descriptor observations, then synchronously checks path and header evidence with the selected header last. Alternating asynchronous process and descriptor probes always left one observation stale across the last wait. Linux uses bounded synchronous /proc reads, including children of every thread. macOS extends the existing bundled read-only helper with a strict --control protocol. It compares two complete bounded passes, process birth microseconds, image, command identity, descriptor table capacity, direct children and file keys. The optional discovery --paths protocol remains compatible.

The macOS command record can contain environment strings, and a rewritten process title can destroy its argv boundaries. The helper emits only a digest of the bounded raw command record; it never serializes those bytes as argv or environment. The existing single-row ps command text is bracketed by native identity checks. This follows the XNU process-argument implementation; descriptor and zombie handling follow process inspection and libproc. The lsof parser validates the complete NUL field protocol, including record terminators, owners, types and numeric fields. Errors or stderr invalidate the entire reply, even beside plausible output.

One lookup shares a three-second monotonic budget, 32,768 work operations, 16 MiB of accounted bytes and 64 subprocess probes. Additional caps cover 4,096 graph entries/descriptors, 32 children, 128 Linux threads, 64 homes/candidates, 64 KiB process commands and 256 path components. Subprocesses receive the remaining deadline and SIGKILL on timeout. Filesystem operations are bounded in count and bytes; this is bounded re-observation, not an atomic OS snapshot or a promise that the OS can cancel a blocked filesystem call.

Claude PID records retain a synchronous proof across Stop's final asynchronous process check. It rechecks the complete positive, stale and absent record pool, path ancestry and home set, with the selected record last. A same-process conversation switch during that final wait holds before checkpointing, saving, signaling, terminating or retiring anything.

Only extraction of the immutable bundled executable is cached. Process, descriptor and header results are always fresh. A deleted private helper cache produces a hold and is recreated from pinned bytes on the next control request without waiting for discovery. Existing foreign or invalid cache files are preserved. On macOS, source development without the native artifact holds strict control reads; it does not fall back to permissive process evidence. Build a fresh artifact before native source integration tests:

python3 cli/scripts/build-process-images.py --output /tmp/private-process-images.json
export HARNESS_PROCESS_IMAGES_ARTIFACT=/tmp/private-process-images.json

Use a fresh output filename, private test homes and tmux sockets, unset TMUX and TMUX_PANE, and run with TZ=UTC TMPDIR=/tmp. Portable CLI builds already require and verify the universal artifact. No release is part of this work.

Golden, review and validation

Linux observations were committed before production changes in f247154e6; six healthy macOS observations followed in b53acda12, also before the move. The 29-observation artifact remains byte-for-byte unchanged: SHA-256 1a3a23dde27f550b8ab0eb68d2e9cddb686722aaedc5d552563e4aa910a9778a. Tests pin the platform, UTC, time and private filesystem; every host binary in the golden is replaced or forbidden. Former unsafe answers in the older session-store golden are explicitly asserted before named safety corrections expect a hold.

Independent review caught process/descriptor await ordering, alias replacement, malformed metadata, descriptor table growth, source-only helper recovery and the composed Claude record race. The private outage case caught BSD ps formatting when comm was the last column; using the discovery-compatible column placement preserves healthy titles. Focused regressions cover each correction. The separate reviewer also required bounded fixture lifetimes so a smoke-check timeout cannot orphan a child.

Local acceptance on October 9 passed typecheck, architecture and 589 focused assertions; 1,944 core/service assertions and 265 harnessd assertions met every 100% coverage threshold. The existing harnessd skip remains. All 29 private enginehomes, machine and 70-operation chaos cases passed, as did 57 private tmux cases; 15 vendor-dependent tmux rows were explicitly excluded. Fourteen native C checks passed, and the bundled control/cache-recovery path passed on macOS x64. Receipt: 20261009T234506.200411Z-27373; native C reused its unchanged source/toolchain evidence from 20261009T232820.565516Z-55666. Script-only cleanup and fixture lifetime corrections follow this receipt and receive their affected checks separately. Serial resume subsequently passed all 509 assertions with every 100% coverage threshold (20261009T235550.255500Z-12642); its earlier three failures came from a Hermes process fixture that lacked the strict probe reply and were retained with the correction. Nineteen deliberate broken boundaries failed by assertion after a green baseline. The first EOF mutation removed a redundant guard; the corrected mutation actually accepts a missing terminator and is caught. Final acceptance after the measured process-state correction below, the twentieth mutation and exact-head review are recorded in the PR. Unfinished or failed runs are not counted as passes.

The next full acceptance exposed a separate dependency: optional image discovery set a 60-second helper cooldown after a failed probe, so a healthy hookless Codex could not bind. Receipt 20261010T000721.175249Z-68499 retains that failure: 28 of 29 private e2e cases passed; the other gates passed. Strict control now retries verified helper preparation within its own deadline, independently of optional discovery backoff. Three composed regressions failed before the correction and passed afterward; corrupt cached bytes remain refused. A private Darwin e2e forces optional discovery failure and requires binding before the cooldown expires. The focused correction and integrated installer check passed 122 assertions, both selected private e2e cases, typecheck and bundled control (20261010T001738.240610Z-52368). The twenty-first mutation removes the actual control retry opt-in. Final complete gates, mutation results and exact-head approval belong in the PR.

Matched runtime cost

The raw measurements compare former source 5b2be2586ab0e50a857ffe3378adc378060ffcf3 with 03bb04f5266d503e2fe745f1ef1e41b9a8cc9589. Five interleaved repetitions per source and workload used thirty fresh Node 22.23.2 processes on the same macOS x64 host, with five calls each, UTC, /tmp, private homes and one owned idle descriptor holder. No other local validation ran during measurement. The driver sends no engine input. Both sources bound all 25 single-file and 25 duplicate-descriptor calls. For competing rollouts, the former source returned empty on all 25 calls; the candidate held with the ambiguity reason on all 25.

Workload Former median / p95 Candidate median / p95 Former / candidate lookup CPU Former / candidate peak RSS
One rollout 170 / 173 ms 509 / 821 ms 2.48 / 27.09 ms 95.8 / 103.8 MiB
Duplicate descriptors 170 / 172 ms 509 / 797 ms 2.88 / 28.07 ms 94.6 / 105.6 MiB
Competing rollouts 171 / 172 ms 509 / 797 ms 2.90 / 27.77 ms 94.1 / 107.0 MiB

CPU is the observer's mean per lookup; peak RSS is the mean fresh observer process peak, including startup. Fresh-process CPU, including startup and child probes, increased from about 1.32 seconds to 3.06–3.12 seconds per five-call process. The p95 convention is sorted[floor((n-1)*0.95)]. These scopes are separate and do not estimate whole-daemon readiness. The additional observations cost roughly 340 ms at the median and 8–13 MiB in this workload. The three-second lookup budget remains the control bound; these measurements introduce no automatic performance threshold.

Two incomplete pre-fix measurement attempts are not included as passing evidence. Each encountered a hold in the single-file workload. Recording the reason and a bounded process-table observation identified an unrelated exiting process with Darwin state ?E+; the strict parser had rejected the entire graph. The parser now retains ? as uncertain state and continues native verification for a relevant owner or child, rather than treating it as absent. Three regressions cover the unrelated row and uncertain owner/child refusal, and a twentieth mutation removes that support. The Darwin process-state formatter describes its exit and foreground modifiers. The complete final run took 66.7 seconds, from October 10 00:20:09 to 00:21:16 UTC, and passed every expected outcome.

Timing and remaining scope

Work resumed October 9 at 22:25:51 UTC after the owner's pause. Golden preparation ended at 22:32; implementation and independent-review corrections continued through 23:45. The first complete acceptance ran 23:45:06–23:52:08 UTC, overlapping review and the isolated mutation work. Later validation, measurement, CI waiting and merge are recorded separately in the PR. Publication remains zero.

This closes the descriptor authority boundary and the newly exposed PID-record ordering race. It does not complete the daemon core checklist: durable catalog writers and legacy registry callers, shared hold/retry state, launch preparation and lifecycle intent, and the remaining turn/input/Close acceptance remain separate work.