Repository navigation
fix(host-kit): pin ps lstart reads to the C locale so daemon stop finds a live daemon - #4682
Conversation
|
The locale pin in 70f0b17 is too wide: it also changes how command text is read, and that breaks managed-process ownership for non-ASCII paths. The pin applies to every host-kit Not blocking, and fine to take or leave: the new test checks the env argument on mocked Could the fix be smaller? Pin only the The Coverage check is failing, but its log ends mid-run in the react-native companion worker tests with no assertion or error line, so it does not point at this PR. Please re-run it. No conflicts. Before merge, narrow the pin to the A separate security cross-check of this head, run because process identity decides which process gets signalled, adds two more items before merge:
Signal authorization still requires an exact identity match, so neither item lets the CLI signal the wrong process. Both make it give up on a live daemon, which is the orphaning bug #4656 reports, now coming from another direction. |
…tamps unverified Addresses the blocking review on callstack#4682: - The LC_ALL=C pin now applies only to ps reads whose output carries lstart (HOST_PROCESS_IDENTITY_PS_ARGS sync/async and readProcessField('lstart=')). The pid=,command= batch read and readProcessField('command='/'state=') keep the caller's locale, so command text reads with one encoding from every host-kit caller, matching the unpinned listHostProcesses scan. BSD/macOS ps escapes non-ASCII argv bytes under LC_ALL=C (/tmp/é-ü -> /tmp/M-CM-)-M-CM-<), which broke managed-process ownership for non-ASCII paths. - The pin is a final override on top of the effective child environment (new effectiveChildEnv in exec.ts), so TZ and the rest of the child env survive: replacing the whole env dropped TZ and rendered lstart in the host zone under the pin (verified live: TZ=Pacific/Kiritimati record Thu Nov 19 09:29:21 2026 vs no-TZ read Wed Nov 18 20:29:21). - processStartTimesDiffer proves a different lifetime only when both sides share one verified format (linux: token, C-form lstart, Windows invariant stamp). A legacy localized record — with or without a colon-separated clock, e.g. mer. 18 nov. 20:29:43 2026 or 18 nov. 2026 — is unverified: never declared exited at daemon stop, never a signal authorization. Regressions: pin scope + UTF-8 command reads + TZ retention in host-process-liveness.test.ts, legacy verdicts in host-process.test.ts and owner-identity*.test.ts, and at the daemon stop boundary in daemon-process-takeover.test.ts (legacy record -> retained identity-unverified with the daemon alive; non-ASCII argv reads as UTF-8). Token-based reuse tests now use verified-format tokens. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
|
Progress at The cross-time-zone case remains open. The current C-form timestamp has no time-zone provenance. Coverage on this exact head also reports eager-closure growth from |
|
This review covers f88ff09. The newer head 7ef7ebb changes how the locale pin reaches the spawn environment and will get its own delta review; the time-zone and evidence items below do not depend on it. At f88ff09, the earlier command pin and environment replacement findings are fixed, but birth identity and live validation still need work. The real dotted-clock fixture and full macOS run remain outstanding. Could the process owner give birth tokens locale- and time-zone-independent, identifiable provenance? Starting a daemon in Pacific/Kiritimati and stopping it with TZ=UTC produces different C-shaped strings for the same PID, so the comparison can report a live daemon as exited. Conversely, a recycled PID held by a matching daemon can have the same local clock value and pass signal authorization. Both comparisons must treat old unqualified renderings as unknown unless the original lifetime is independently established; keep argv probes separate. Please remove the redundant non-ASCII assertion and cover this through the environment-sensitive process reader and real-child stop test. It compares the same constructed string on both sides and passes even when the command read still has the reported regression. The takeover test uses a stub executable and synthetic timestamps, so it does not establish graceful stop or live resource ownership. At the fixed head on macOS, start a real detached daemon under fr_FR.UTF-8 in a fresh state directory, capture its PID and token, and run daemon stop --state-dir --json under LC_TIME=C; show stopped:true, mode:graceful, and PID exit. Repeat across different TZ values. With a separate pre-fix registration from an actual non-C locale, show typed identity-unverified refusal, a live PID, and retained metadata and lock. Run Apple simulator record start and stop through the daemon and show the recorder stops and releases its resource. If the snapshot change remains, show successive requests across provider locales retain the same live snapshot generation.Not blocking: these can be taken or left: use a valid 21-digit CIM sample for stale Windows fixtures and remove unreachable platform branches; resolve scoped environment overrides once at spawn; bind an installed UTF-8 locale for the real-child Unicode test; use a recorded nb_NO.UTF-8 dotted-clock value; and keep the existing table case instead of the duplicate one-second reuse assertion. Could the already loaded process capability own POSIX birth-token construction and its sync and async probe policy, with exec resolving scoped overrides once at spawn and the cancellable snapshot provider reusing that policy? A versioned token could identify comparable clocks while historical raw values remain unknown, preserving Linux /proc and Windows CIM tokens; choosing provenance and the legacy refusal rule at the process boundary comes first, while preserving Apple provider cancellation and routing, removing the extra eager import, and consolidating fixtures. No ADR amendment is needed for that ownership. Android Smoke Tests passed, but Linux normally uses /proc and does not exercise macOS lstart. Repo Guards reports R86 on the added process.env capture, and Coverage reports ten eager-closure assertions with one extra module each. There are no known conflicts. Before merge, fix birth-token ownership and scope, clear R86 and the eager-closure checks at their source, and provide the exact-head macOS receipts. |
|
At 7ef7ebb, the locale pin no longer applies to argv reads, but the process birth identity and SDK startup issues remain from the earlier review. Could the host-kit observation owner emit one locale- and timezone-independent birth identity with provenance? A daemon registered under Pacific/Kiritimati and stopped under UTC gets different C-shaped lstart strings for the same PID, and the classifier treats the shared shape as a shared clock. The exit wait can report exit before signaling, so detached stop can report not-running and retire a live daemon's lock and metadata. Claim, lock, and managed-process observations also treat the difference as reuse. Old raw POSIX values need to remain unknown unless the lifetime is independently established. Identity classifier Could every live signal authorization gate require a positive match between comparable birth identities, with command matching independent? A recycled PID can have the same raw local-second string under a different timezone, bypass the mismatch check, and pass the daemon entry-path check. That can authorize a signal to a different process lifetime. Legacy raw POSIX values need to remain unknown for equality too. Signal gate Could scoped and unscoped launch and observation routes use the same clock, with the captured host bound at declared entrypoints for probes that need its environment? An unscoped lstart probe receives only LC_ALL=C, while Node ensureDaemon passes the captured TZ to the child. With a nondefault TZ, the parent can reject its live child during readiness. The scoped real-child test does not cover this route. Please verify a fresh Node ensureDaemon call with a nondefault TZ. Probe environment Could the Unicode test remove the self-comparison and retain the environment-sensitive reader regression and real-child stop test? It supplies the same constructed argv to both sides without invoking ps, so it stays green with the earlier overbroad pin. Test Could the valid and stale process birth fixtures be shared in test-kit? The same values appear in three test files, so each identity format change requires three updates. Fixture Could you attach exact-head macOS receipts for the CLI and recording routes? The takeover test uses a stub process and synthetic timestamps, and the progress comment reports partial real macOS validation without the underlying transcript. At the fixed SHA, start a detached daemon in a fresh state directory under fr_FR.UTF-8, record its PID and birth identity, and run daemon stop --state-dir --json under LC_TIME=C; show stopped:true, mode:graceful, and that PID exiting. Repeat with different explicit TZ values, and show a fresh Node ensureDaemon call under a nondefault TZ recognizing its child. For a genuine pre-fix non-C registration, show details.terminationReason=identity-unverified, the live PID, and retained metadata and lock. Through an Apple simulator daemon session, run record start and record stop and show the recorder exiting and its owned resource released. Include the SHA, commands, and outputs. Takeover testNot blocking: the stale CIM fixtures could use valid distinct 21-digit samples, the Unicode child test could bind an installed UTF-8 locale, the stop regression could use a recorded nb_NO.UTF-8 dotted-clock value, and the redundant one-second reuse test could be removed; please take or leave these suggestions. Could comparable POSIX identities live in the already loaded host-kit process capability alongside the Linux and Windows producers, with sync and async paths sharing one probe policy and the existing exec resolver owning spawn overrides? Could argv reads stay separate, qualified observations yield positive and negative lifetime judgments, and the extra eager import be collapsed? First, the canonical POSIX clock, provenance discriminator, and unknown legacy behavior for both matches and differences need definitions; saved-state structural equality should remain intact. Apple snapshot provider routing can stay separate, and no ADR amendment is needed. The Coverage failure most likely comes from the added eager module, since its inbound static imports remain; please confirm from the job log. No conflicts are known. Before merge, please fix birth identity and the unscoped SDK route, repair the regressions and eager closure growth at their source, and provide passing exact-head checks and the macOS receipts above. |
|
Round 2 at head Eager-closure / Coverage failure — fixed at the seam, no baseline changes. The Cross-TZ identity — closed with provenanced birth tokens. New POSIX reads canonicalize the pinned C-form Live macOS verification at exact head
Checks receipt: No device proof was run — no device is assigned to this task via T3. Not merged, not watched; readiness labels untouched. |
|
Round 3 at head UTC clock at the lstart-only ownership seam. The lstart-bearing ps probes now override SDK ensureDaemon under nondefault TZ, differing parent TZ (fresh Node
Exact-head CLI + legacy receipts at
Checks at exact head: Still pending (reported separately, not done): the Apple-simulator recording route receipt ( |
|
Exact-head recording verification — PASS
Limit: a manual record start/stop through the T3 device-bound CLI was not used as evidence, because that CLI runs published |
|
I reviewed 0b301ee against the earlier review (#4682 (comment)). The new design is closer, but the safety rule still has gaps and it changes the saved identity format for registrations that already exist. CI is still running with no failures reported yet. No conflicts. Before merge, the shared proof and format-change problems below need fixes, the tests need to exercise the real read path, and the exact-head macOS transcripts need to be attached. When the host returns the same unparseable raw lstart as the saved record, host-process.ts:413 keeps the raw text and the shared stop judge returns ours on string equality. Recorder termination and owned-process reaping use the same check, and the daemon-only guard at daemon-process.ts:39 does not cover them. An unqualified clock rendering can then authorize a signal with no positive proof of the recorded lifetime. Please have host-kit expose one match/different/unknown comparison, and let only its match result open every PID-based signal gate that uses a birth marker. Keep raw equality only for structural fences, and keep direct child handles as independent evidence. The stop test stub at host-process-stop-confirm.test.ts:236 emits an already encoded posix token in the ps row (:303-316). At 7ef7ebb the classifier already treated that token and a raw C value as incomparable, so the test can pass without this change. The mixed cases in host-process.test.ts:199 and owner-identity-liveness.test.ts:64 bypass the reader the same way, and so does the daemon case at daemon-metadata-loss.test.ts:98. These routes can look protected while the reader still emits raw lstart or the signal gate still accepts raw equality. Please make the ps stub emit C-form lstart and keep the saved fixture independent. Cover a differing raw C value that 7ef7ebb treats as reassignment, and separately an identical unqualified read and record that sends no signal. The latest live results are from ea5c816, but this head changes the child clock and parser (host-process.ts:239). Please attach commands, outputs and the SHA for a real detached CLI daemon in a fresh state directory across French/C locales and differing TZ values, showing the token, a graceful stop and the PID exit. Add a fresh unscoped Node ensureDaemon with nondefault TZ that recognizes its child. For a genuine pre-fix non-C registration, show identity-unverified with a live PID and retained lock and metadata. For an Apple simulator daemon session, show record start/stop, recorder PID exit and release of the recording resource. Under the same locale and settings, a healthy pre-fix macOS Metro companion has a raw saved startTime. The new probe returns posix, so reuse fails at client-companion-tunnel.ts:246, and the ensure path at :489 tries a stop that keeps the live process as unverified at :318. After upgrade, a working tunnel becomes unusable, and a repeated ensure and an explicit stop both fail while the worker stays registered. Please give the companion lifecycle a safe upgrade path, such as owner-side shutdown before the identity change or re-verification through an independent worker-owned fence. Keep the record and fail closed when no owner can be established. A live retained runner from before this change has a raw runnerStartTime. Once its daemon exits and the lease can be adopted, runner-lease.ts:810 compares it with a new posix read, and runner-adoption.ts:289 reports runner_pid_recycled before the token-authenticated probe runs. Cleanup at runner-lease.ts:713-734 also refuses the PID as unverified, then releases the lease after its other cleanup attempt. A healthy iOS runner that the old build could hand off is now called recycled, so the next daemon cannot adopt it and may rebuild while the old process still runs. Please separate unknown birth evidence from proven PID reuse. Use independent endpoint-to-process proof for handoff, or drain the retained runner with its owner before changing the marker format, and keep unresolved cleanup state. A live simulator recorder with an old raw start time and matching argv gets unverified from the judge. Both host fields are readable, so platform-runtime-screen-recording-process-host.ts:139 treats that as not ours, and packages/platform-apple/src/recording/recovery.ts:165-169 reports ownership-fence-lost with no proven mismatch. Recovering a recording made before the format change can be refused while the same simctl process is still alive, and the process also loses the direct child-handle route. Please pass unknown birth evidence separately from a proven ownership mismatch into the simulator stop and recovery result. Keep markers and artifacts on uncertainty, use an independently owned handle when one exists, and otherwise require owner-side settlement. The rewritten startToken body and LATER_LIFETIME in agent-browser-lifecycle.test.ts:16 match tests/agent-browser-process-record.test.ts:31-35. The staleStartTimeLike helpers at daemon-process-takeover.test.ts:69 and cli-device-status.test.ts:22 also encode the same per-format choices. The format change already needed the same fixture edit in several places, and test doubles can drift on which lifetime evidence is valid. Please use one deterministic lifetime fixture and one stale-of helper at the owning shared test seam, with real C-form rows at mocked ps boundaries and canonical tokens where observations are consumed. Existing help tells users to end an older daemon with daemon stop (cli-help.ts:419, website/docs/docs/commands.md:92). For a live older macOS detached registration with raw lstart, the upgraded CLI now returns identity-unverified even with the same locale and TZ, as the new rule requires. Operators can repeat the suggested command and keep hitting the refusal while the old daemon holds resources. Please update the help and docs to describe the refusal and the supported owner-side or pre-upgrade stop procedure. The head writes a posix token into both existing registration identity fields (daemon-registration-owner.ts:118, and :88). A pre-fix hardened client from the merge base still reads that same lock structure. Its comparator at base host-process.ts:243-250 treats posix versus its own raw lstart as two unequal values, its manual stop has no version check before exit polling, and its lock reclaimer uses the same PID reuse proof. ADR 0030 covers the legacy-versus-hardened lock boundary, and this change keeps the hardened schema while changing the published value. Running the previous CLI against a newly started macOS daemon in the same state directory can report not-running and retire the live registration and lock, even with identical locale and TZ. That is the reported orphaning in the opposite mixed-version direction. Please keep the old-readable identity where old hardened clients make reclaim decisions and store the canonical comparison evidence separately, or add a cutover that released clients actually refuse before they read the lifetime. Add an old-client/new-daemon case. Not blocking: daemon-registration-status.test.ts:123 uses a 20-digit placeholder for a live PID on the Windows branch, but the host comparison needs 21 digits, so it is incomparable and :127 would not see stopped; a distinct valid 21-digit CIM value from the shared stale-of fixture would fix it. The PR body still describes a separate ps-start-time module and a C-form-versus-localized comparison, while the head removes the module, pins locale and UTC, and treats every raw POSIX rendering as unqualified. These can be taken or left. Simplicity question: could both the positive and negative live comparisons sit behind one host-kit three-way result, with the existing stop judge staying the consumer for host-kit targets? Daemon, browser, runner and companion lifetime checks would consume that result and keep their own command and resource ownership logic. That would drop the public provenance boolean and the separate daemon guard. The rollout would be defined at the registration and lock owner before a new encoding is published to old readers. The comparison contract and the saved-format cutover would come first, with unparseable observations as unknown and structural identity checks on saved records left intact. The size is fine; my concern is the new provenance seam and its inconsistent consumers. The 28 changed files include no help or user doc changes, which is why the help finding above is raised against existing text. The live results and local check report are tied to ea5c816, and no exact-head logs were supplied. The Apple snapshot read is unchanged here, so this change does not show snapshot stability across provider locales. The POSIX lstart source still has one-second precision, so PID reuse at that granularity is not measured. |
|
Round 4 at head 1. One three-way comparison, raw equality never opens a signal gate. 2. Real read path in tests. The ps stubs at the producer seam now emit real C-form 3. Exact-head macOS lifecycle evidence (head
4. Companion upgrade path. 5. Runner handoff. 6. Recorder/recovery. 7. Help/docs. 8. Persisted-format compatibility (old hardened client vs new daemon). The registration and lock owners now dual-write: the legacy raw Checks at exact head |
|
The Integration Tests failure was caused by the dual-written daemon registration: three tests and their cleanup helper passed the legacy raw The three failing files reproduced the same 3 failures at |
|
Thanks for the update. At 40edb70, the Integration Tests failure from the earlier review is fixed, and the CLI, SDK and legacy-record asks from the earlier review (#4682 (comment)) are met. Four problems remain, and one new one shows up in recovery. The new
The old-client/new-daemon test at https://github.com/callstack/agent-device/blob/40edb70/packages/daemon-contracts/src/daemon-registration.test.ts#L94 writes The help paragraph at https://github.com/callstack/agent-device/blob/40edb70/src/commands/schema/cli-help.ts#L421 and Not blocking, take or leave: the delta shortens about twenty unrelated comments in Could the CI is green: 12 checks, none failing, at 40edb70. No conflicts. The Linux refusal above follows from |
|
Review update at
The focused recovery, writer, lock and registration tests, typecheck, and eager-closure tests passed. The initial affected gate found an R11 test import violation; the tests were moved into their owning packages and the full layering check passed. Hosted checks on this head are still running. |
Live iOS recording at
|
|
Thanks for the update. The code at c0d2a16 fixes the defect from the earlier review: the legacy field is now the The Linux row in process-lock-persisted.test.ts sets the The quiesce-fence test in daemon-idle-reap-lifecycle.test.ts builds its identity from the real Not blocking, take or leave: writePersistedOwner is not a pure codec, since it returns the released rendering only when the module-level Once the persisted-identity tests catch their regressions (the legacy mocks differ from the token in the Linux/Windows lock and registration rows, and the quiesce-fence test is host-independent), this is ready to merge. |
|
Thanks, @thymikee. Pushed 437e441 with the test changes:
|
|
The code in 437e441 is ready: the |
|
Still ready at aafbcf1. The two tests now mock |
|
Thanks for this fix and for the thorough live evidence, @pcbeingused333. I pushed one commit on top of your branch ( What stays: What changed:
Why: the project adds compatibility paths only when a maintainer asks for them, and we decided not to support an older build and a newer build sharing one state directory. The PR description states that trade-off. The cross-locale, cross-zone and legacy-record cases are still covered by tests, and I re-ran the cross-locale stop and the legacy-record refusal on macOS at the new head. |
|
Thanks for the fix, and for the careful first version. At c9049e8 the simplified change reads correctly: the Linux-only Coverage failure from 14bcb79 is fixed, and the 13 checks on this commit show no failures. Two things remain before this is marked ready: an independent pass over every consumer of the start-time token, which is running now, and the maintainer's sign-off on the mixed-version trade-off in note 1. The live cross-locale and legacy-record runs at 14bcb79 still apply, because the production code is identical here. Not blocking, and you can take or leave these: (1) the accepted trade-off in cli-help.ts:423 is scoped to one state directory, but runner leases and device claims are host-global, so an older build on the same host may read a newer daemon's |
ps -o lstart prints weekday and month names in the caller's locale, so a daemon and a client under different LC_TIME compared one start time as different lifetimes and daemon stop orphaned a live daemon on macOS. Run the ps identity reads with LC_ALL=C and treat a C-form start time against a localized one as unknown instead of reassigned. Fixes callstack#4656
…tamps unverified Addresses the blocking review on callstack#4682: - The LC_ALL=C pin now applies only to ps reads whose output carries lstart (HOST_PROCESS_IDENTITY_PS_ARGS sync/async and readProcessField('lstart=')). The pid=,command= batch read and readProcessField('command='/'state=') keep the caller's locale, so command text reads with one encoding from every host-kit caller, matching the unpinned listHostProcesses scan. BSD/macOS ps escapes non-ASCII argv bytes under LC_ALL=C (/tmp/é-ü -> /tmp/M-CM-)-M-CM-<), which broke managed-process ownership for non-ASCII paths. - The pin is a final override on top of the effective child environment (new effectiveChildEnv in exec.ts), so TZ and the rest of the child env survive: replacing the whole env dropped TZ and rendered lstart in the host zone under the pin (verified live: TZ=Pacific/Kiritimati record Thu Nov 19 09:29:21 2026 vs no-TZ read Wed Nov 18 20:29:21). - processStartTimesDiffer proves a different lifetime only when both sides share one verified format (linux: token, C-form lstart, Windows invariant stamp). A legacy localized record — with or without a colon-separated clock, e.g. mer. 18 nov. 20:29:43 2026 or 18 nov. 2026 — is unverified: never declared exited at daemon stop, never a signal authorization. Regressions: pin scope + UTF-8 command reads + TZ retention in host-process-liveness.test.ts, legacy verdicts in host-process.test.ts and owner-identity*.test.ts, and at the daemon stop boundary in daemon-process-takeover.test.ts (legacy record -> retained identity-unverified with the daemon alive; non-ASCII argv reads as UTF-8). Token-based reuse tests now use verified-format tokens. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…heck the lstart helpers Move the start-time format classification and processStartTimesDiffer into ps-start-time.ts (re-exported through the process barrel) so host-process.ts stays under 1000 lines, and use non-null match groups in the takeover test's locale helpers. Also replaces hex escapes with Unicode escapes in the liveness test. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…wn-env word The layering guard (R86 process-globals) forbids reading process.env outside declared process entries, so the pin cannot be materialized from process.env in exec.ts. ExecOptions gains envOverrides, which resolveSpawnEnv applies as the final word over the bound host scope's environment plus the request env: LC_ALL=C is pinned while TZ and the rest of the effective child environment survive. Outside a scope an explicit env still takes the overrides on top, and with neither the child inherits natively. The TZ regression moves to exec.test.ts, which spawns a real child: withCommandHost(host TZ=Pacific/Kiritimati) + envOverrides LC_ALL=C observes 'Pacific/Kiritimati|C', and the override also wins over a request-env LC_ALL. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…ost-process module Move the ps-start-time logic into the already-loaded host-process.ts so the eager-closure budget is unchanged, and give newly produced POSIX birth tokens explicit comparable provenance: a pinned C-form lstart is parsed in the reader's zone and recorded as posix:<epochMs>, so identity survives a cross-TZ stop. Historical raw renderings stay unqualified: they yield unverified identity and never prove exit or authorize a signal. Linux /proc and Windows CIM routes, unpinned argv reads, and cancellation are unchanged. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
… output as UTC The probe now overrides TZ=UTC alongside LC_ALL=C (as the final envOverrides word, so a captured host or request TZ cannot change the zone ps renders in), and the known UTC output is parsed with Date.UTC. The posix:<epochMs> birth token no longer depends on the JS reader's local zone or on DST folds, so a daemon registered under one TZ is recognized under any other. Linux /proc, Windows CIM, unpinned argv reads, cancellation, and the eager-closure shape are unchanged; legacy raw renderings stay unqualified and unverified. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The token classifier accepted any string that starts with `posix:`. A stored `posix:corrupt` beside a valid live token then counted as a different lifetime: `waitForDaemonExit` declared a live daemon exited, and a held lock or reclaim guard marked its live holder as reused. A stored value is now a POSIX token only in the form a read writes: `posix:` followed by a whole-second epoch in safe-integer milliseconds. Any other value is unverified like a raw `ps` string from an older release: never a match, never a mismatch. The reader returns only tokens that pass the same rule. Also say "start-time token" in the CLI help and the commands page. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
21985d3 to
b69ae8b
Compare
|
At b69ae8b the malformed-token gap is closed: a stored value counts as a start-time token only as |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Follow-up on the three optional notes from the review at c9049e8, in 786f878:
The remaining item is the maintainer's sign-off on the mixed-version trade-off. |
|
The code and docs are ready at 786f878. The mixed-version trade-off is now stated in the shipped help and the user docs, and the docs-only change matches the code. CI is green and there are no conflicts. The one remaining item is the maintainer sign-off on that trade-off (an older and a newer build must not share one host on macOS or BSD), which this change states but does not give: #4682 (comment) Not blocking, take or leave:
The same-host scope note, the "start-time token" wording note and the note about keeping the row when Not verified here: an older build was not run against a newer state directory, so the mixed-host failure is reasoned from the code, not reproduced. The live macOS runs from the PR body were not repeated; this change does not touch that path. |
…tart-time record Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The three wording notes are applied in af8197c, with the same sentence in the help line and
The remaining item is the maintainer's sign-off on the trade-off. |
|
Thanks for the update. At af8197c the mixed-build warning is scoped to macOS and BSD and names the records that store a start time, as the last review suggested. CI is green and there are no conflicts. Review has nothing blocking left; the remaining item is the maintainer sign-off on the mixed-build trade-off. Two notes for a follow-up, not for this PR:
Not verified here: the change touches only help text and a docs page, so no tests were run and the code outside the change was not re-reviewed. |
…d Windows tokens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both follow-up notes are handled:
The remaining item is the maintainer's sign-off on the trade-off. |
|
Thanks for the update. One defect remains at 6938e4d. The POSIX token classifier at https://github.com/callstack/agent-device/blob/6938e4d/packages/host-kit/src/internal/host-process.ts#L268 accepts any nonnegative whole-second safe integer, including Could host-kit own one C-form The earlier evidence request is now satisfied. CI is green, and the body rules check now passes at this commit. The change since the earlier review touches only a help string and a docs line, and the other 15 checks passed. No conflicts are known. Not verified here: a fresh test run, since the delta is text only. After the fix, the remaining step before merge is maintainer sign-off on the mixed-build trade-off, which this review does not re-raise. |
A posix: token is valid only through 9999-12-31T23:59:59Z, the last instant the four-digit-year lstart rendering can emit. A larger whole-second safe integer is malformed, so a corrupted daemon.json token no longer reads as exit proof in stopDaemonProcess. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Bounded the POSIX token classifier to the UTC range the producer can emit, through 9999-12-31T23:59:59Z ( The shared C-form Disclosure: this change was prepared with an AI coding assistant (Claude), and the diff and test results were not reviewed by a human before posting. |
|
Thanks for the update. The earlier findings from the first review (#4682 (comment)) are fixed at a8c4bbf, and one new problem remains.
The failing check is in a file this PR edits, so it is likely related to this change. The other 14 checks pass, including typecheck and format. No conflicts are known. Not verified here: the host-kit and daemon-exit-wait tests were not run locally, and no live macOS run was done. The |
…-process Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The |
A host-kit module beside host-process grows every entry's eager closure, so the CPU-arch reader stays in host-process and its two sysctl calls share one options object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The suggested split failed the eager-closure gate in Coverage. At b11ff89, 1ce8933 reverts the split and keeps the reader in |
|
Thanks for the update. The findings from the earlier review are now fixed at 1ce8933, and the code shows no new problems. Checks are green: the cancelled body-rules run is superseded by a passing run at this head. No conflicts. The change still waits on maintainer sign-off for the mixed-build trade-off, so it is not ready to merge yet. Could the follow-up in #4875 put the shared C-locale lstart field decoder in host-kit, keep the UTC token in host process identity, and keep the local-time conversion in Simulator boot observation? The production posix: checks would stay inside host-kit, and the generic envOverrides option would be applied at the exec spawn sites. Not verified here: the tests and the eager-closure and coverage gate were not re-run locally; the result relies on the CI checks. |
|
On the #4875 follow-up: we don't plan to build it. A shared decoder removes about 15 duplicated lines and changes no behavior. Against that:
The |
|
The reasons in #4682 (comment) settle the design question from the review at 1ce8933: the shared decoder would grow the eager closure or push host-process.ts over its limit, and it would add a device-facing change for about 15 lines. Nothing from review blocks this head. The remaining item is the maintainer sign-off on the mixed-build trade-off. |
|
Maintainer sign-off: the mixed-build trade-off is accepted as stated in the help text and |
|
With the maintainer sign-off on the mixed-build trade-off (#4682 (comment)) and the design question settled, nothing from review blocks 1ce8933. CI is green and there are no conflicts. |
Summary
Fixes #4656. On macOS and BSD, a daemon and a client with different locales read different
ps lstartstrings for one process, so a stop could discard the registration of a live daemon.Start-time reads now pin
LC_ALL=C TZ=UTCand store aposix:<epochMs>token. A raw value from an older release, or a malformed token, is unverified: nothing is signaled or discarded. Linux/procand Windows keep their identity sources.Accepted trade-off: on macOS and BSD, do not run an older and a newer build on one host. The help and
commands.mdstate the limits.Before / after
Daemon started under
LC_ALL=fr_FR.UTF-8 TZ=Pacific/Kiritimati, stopped fromLC_ALL=C TZ=UTC:With a raw legacy start time in
daemon.json:Validation
14bcb79cb0, macOS, disposable state dir: both rows above.21985d3fc8:pnpm check:quickand focused unit runs passed; the malformed-token regressions fail without the fix.a8c4bbf453: out-of-rangeposix:tokens are malformed; regressions fail without the fix.1ce8933f82keepshost-process.tsunder 1000 lines (shared sysctl options); host-kit and closure-budget tests pass. Hosted CI owns the full gate.Disclosure
This change was prepared with the help of an AI coding assistant (Claude Code) and submitted by the account holder.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.