Repository navigation
refactor: extract daemon client workspace package - #4101
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 164 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
I found no code problem at 7b31aa0 that must change before merge, but the Apple Smoke Tests job is still running, so CI is not green yet. That job runs the built CLI through the relocated daemon-client package (ensure, attach and the iOS and macOS phases), so it is the live check for this move. It must finish green on 7b31aa0. This change is not device-facing, so no manual device run is needed beyond that job. Not blocking, and you can take or leave these: Of the open Cubic threads, these still apply: the missing These two do not apply and can be resolved: the missing registration-claim check (#4101 (comment)), because the old scripts also sent with the recorded token and no claim check, and the provider trimming (#4101 (comment)), because the fingerprint code is a byte-identical move of existing behavior (file it separately if you want it changed). Before merge, wait for Apple Smoke Tests to go green on 7b31aa0, restore the dropped MCP ensure assertions, and reuse |
|
Thanks for the review. Pushed
|
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: Since the last review: 8 new · 0 still open · 3 no longer raised 8 finding(s): 3 minor, 5 nit. Verdict: approve. reached max rounds (1). 🟡 Minor (3)
🔵 Nit (5)
Not in the reviewers' prompt (1 file)
Reply under an inline comment with |
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on 5f60896. The verdict and the full list are in the summary comment.
a99298d to
bc13701
Compare
There was a problem hiding this comment.
Apex Sentinel: 4 new findings on bc13701. The verdict and the full list are in the summary comment.
|
Thanks for the update. This review covers bc13701; the newer c5537a0 only regroups the scripts/lib/recorded-daemon.ts:70 reads Could One non-blocking note still stands: packages/plugins/src/store.ts:10 re-exports CI shows one failing check, Apple / Smoke Tests (run 41098111773), which looks unrelated. In the iOS phase, scenario No conflicts are known. Before merge, the script needs to use one exported |
There was a problem hiding this comment.
Apex Sentinel: 8 new findings on c5537a0. The verdict and the full list are in the summary comment.
c5537a0 to
06879b9
Compare
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 06879b9. The verdict and the full list are in the summary comment.
|
Reviewed 06879b9 against the earlier findings. The store.ts note and most of the inline threads are fixed, but the duplicated daemon admission logic in the recorded-daemon script is still there, so the code needs one more change. All 30 checks pass at this commit, and the Apple Smoke failure from the previous head is gone.
Could the simplest version be better here? Exporting Not blocking, and fine to take or leave: the new not-running error at recorded-daemon.ts:73 uses reason On the inline threads from the other review: the unresolved doc nit on credential-fingerprint.ts still applies (the doc omits the I ran no tests or gates; CI state comes from the check results. I read the test-isolation and recorder-shutdown changes in 06879b9 but did not run them or confirm which CI failure they addressed. I judged the rebase from the range-diff for patches 2, 6 and 8, not line by line. |
|
Addressed the remaining admission finding from #4101 (comment) (and the earlier comment) in bae7564.
The reader is asynchronous to keep registration/error machinery lazy. Error constructors and diagnostic hints now share Validation: the exact-head affected gate passed with a clean checkout ( The trim documentation and parity threads are answered/resolved. The earlier cross-build smoke remains attributed to bc13701; no new device run is claimed. Fresh GitHub checks and configured reviews at this published head must finish before merge. |
There was a problem hiding this comment.
All reported issues were addressed across 16 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
Apex Sentinel: 7 new findings on bae7564. The verdict and the full list are in the summary comment.
…/daemon-client Move the daemon client into a private workspace package with one explicit entry. The CLI, typed client, MCP, SDK and daemon command reach lifecycle, ensure, stop and proxy upstream resolution through lazily loaded wrappers. Module-owned tests move with the package; root-composed tests use the entry; shared HTTP daemon, registered daemon and stream-capture fixtures move to test-kit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the type edges back into the entry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…kage tests use Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… transport and restore composition proofs Replace the script-side socket client with sendToRecordedDaemon, a thin entry wrapper over sendRequest (no ensure, replacement or retirement), and reuse buildHttpRpcPayload in the provider harness. Restore the MCP and root host tests against a real registered daemon, and refuse requests that are not POST /rpc in the scripted daemon fixture. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ild the RPC envelope in contracts Replace the entry's script-only sendToRecordedDaemon and buildHttpRpcPayload re-export with the sendRequest primitive the production path already calls, exported as sendDaemonRequest. Tooling keeps only record resolution (scripts/lib/recorded-daemon.ts) and delegates to it with timeoutRecovery 'none'. The pure RPC envelope and lease-method vocabulary move to contracts/lease-scope with a caller-supplied request id; the RPC leaf keeps a thin adapter that supplies the same id as before, and the provider harness uses the shared builder with its own id. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… reflow package-move comments Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The code in bae7564 looks good, and it fixes the findings from the earlier review of 06879b9. Not blocking, and you can take or leave it: the comment at daemon-client-liveness-probe.ts:89 says The Coverage check ( Of the open inline threads, two still apply as lower-priority notes. These do not apply, so please resolve them: Cubic's undecodable-record thread (same behavior as the base, and callers still need the registration lock); r4431031896 (duplicate; an unproven lock throws |
bae7564 to
aac253f
Compare
|
Published the next repository-review round at aac253f.
The exact-head affected gate passed (run-GFwZPd, exactCommit: true, unchanged checkout). The focused 316 tests and the owner-file bundle test passed; the isolated mutation/regression checks fail at their intended assertions and were cleaned up. All eight current threads are answered and resolved. Fresh GitHub checks and configured reviews at this head remain required before merge. Evidence attribution: the record/classification/content-guard experiments ran at 118b10701f, and the composed cleanup experiment ran at 374d32793e. The daemon-client package tree is byte-identical after rebasing onto main 3a218f5; the new exact-head run-GFwZPd validates aac253f (16,581 unit tests passed). The rebase retains both migrations and the upstream drain fix; its two conflicts were the lint-path rows and relocated fixture import. Lockfile regeneration made no changes. |
|
Follow-up to #4101 (comment): the required items are resolved at aac253f. The branch is rebased onto main after #4097, preserving both lint-path rows and the relocated drain fixture; the daemon-client package tree matches the tested pre-rebase candidate. Coverage is now green: https://github.com/callstack/agent-device/actions/runs/41186222871/job/124493576223. The current rollup has 27 successful checks, one intentional skip and one neutral result, with no pending or failing checks. GitHub reports CLEAN/MERGEABLE and zero unresolved review threads. I am leaving the explicitly optional liveness-probe wording nit for a later cleanup. The stale readDaemonInfo clause does not affect the bounded record decoder or the probe’s guarded transport construction; no runtime change is needed for it. The current validated head remains unchanged. The exact-head local gate also passed (run-GFwZPd, exactCommit: true, unchanged checkout; 16,581 unit tests passed). No new device run is claimed. Update: the optional wording correction is now addressed by #4117 after #4101 merged. The follow-up contains only the comment correction. |
|
The rebase at aac253f resolves the #4097 conflicts mechanically (moved test paths in the line-cap list, the ADR collocation row and the ensure-drain imports), and Coverage now passes along with the rest of CI. With the code verdict from bae7564 unchanged, this is ready for a human review. The optional |
|
The optional port-comment correction is now in #4117, since #4101 merged while it was validating. It removes the stale readDaemonInfo port claim and retains the detached-probe error-settlement rationale. Only one comment changes (+1/−3); no runtime code, APIs or new package are involved. The old extraction branch was not pushed or recreated. Follow-up head 5ae0b05 passed the exact-head affected gate (run-pIdMOm: 8 runnable checks passed, 7 owner skips; 16,738 unit tests passed). OXC program ASTs match the parent after excluding comments and locations. Fresh CI and repository reviews are pending on #4117. |
Summary
Extract daemon transport, request guards, lifecycle and launch identity into private
@agent-device/daemon-client. Its single entry names APIs explicitly; lifecycle implementations stay lazy. Related: #3276.Scope: 171 files, mainly moves and consumer rewiring. Fingerprints live in plugins; RPC envelopes live in contracts. Root composition tests retain real registered-daemon and MCP coverage.
Production observation and recorded-daemon tools now share one admission reader. Missing/foreign registrations retain nullable/not-running behavior. Present unreadable, corrupt or unusable records retain their metadata and fail with
daemon-record-unreadable; unproven ownership keeps its refusal. Pinned clients retain binding-mismatch diagnostics. Benchmark refusals preservecell-stateand both errors if cleanup fails. PID/port decoding and error constructors each have one owner, without value cycles.Rebased onto
3a218f573fafter #4097, preserving both package configurations.Review fixes document provider trimming and verbatim envelope forwarding, preserve the virtual drain's real exit/deadline checks, and compare shared build-output contents rather than directory timestamps.
Validation
Tested head:
aac253f77ecb06fe10e850943fab631a1e5b5fb2.pnpm check:affected --run --head HEAD: passed at the exact unchanged commit (run-GFwZPd). Entry closure remains 126; main merge-tree is clean.bc137013e83a; no new manual device run. Fresh GitHub native lanes, Coverage and configured reviews must pass at this published head.