Repository navigation
fix(remote): deliver batch recordings through one request receipt - #4627
Conversation
Size Report
Startup median (7 runs, lower is better):
|
Apex Sentinel · ✅ ApproveSince the last review: 0 new · 0 still open · 0 no longer raised No open findings. 1 finding below 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment Earlier reviewsReview of
|
| Where | Finding |
|---|---|
packages/remote/src/session-script-destination.ts:114 |
Receipt failures are not disclosed when the client's record is gone |
2 findings below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (e0ab0c255c3d).
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on f029c66. The verdict and the full list are in the summary comment.
af2fdd5 to
d222cd6
Compare
|
CI lint failed on the synthetic merge with newer main: its new capture-kit export pushed package-boundaries.test.ts to 1,001 lines. Rebased at d222cd6 and moved the runtime Node-resolution case verbatim into package-boundaries-runtime.test.ts. All 16 checks and focused lint pass; every assertion and the 1,000-line limit are retained. Range-diff shows all six feature commits unchanged. The new full affected gate is blocked by another live validation owner (run-Jgae6B); I cancelled only our waiter. The draft stays pending current-head CI and the independent design review. The previous af2fdd5 exact gate passed all 42 runnable checks. |
|
I reviewed d222cd6. The code change looks right, but the remote-proxy guide still describes the behavior this PR removes. remote-proxy.md:124-126 still says a batch that closes a remote recording is refused before any step runs, that users must run Not blocking, take or leave: CI is green at d222cd6, with 21 checks reported and none failing. There are no conflicts. No native device run is needed, since native execution is unchanged and the provider scenarios exercise the real daemon and proxy route. The open thread on receipt failures when the client record is gone no longer applies, because Before merge, update remote-proxy.md:124-130 and the :363 example to describe batch delivery through |
|
Fixed the required docs in ce3ba44: batch delivery, direct-RPC The optional import consolidation would reintroduce eager facade loading. Missing failed-step evidence remains fail-closed under the approved acceptance cases; I have not expanded delivery authorization. The nested flag and JSON escapes are left as optional cleanup. The provider scenarios, rather than the admission-only test, prove the removed refusal end to end. Validation remains Base-blocked: run-ROiJWi at3610f78 had20,314 passed/1 failed/10 skipped; a fresh isolated fce2fa6 full unit run reproduced the identical proxy cap case and |
|
Pushed 30cece8. Blocker — already addressed at ce3ba44: remote-proxy.md:124-130 describes delivery through No-position failure (session-script-destination.ts:275) — fixed. The client now splits the two effects. A batch error whose normalizeBatchCommandName re-export — removed;
Escapes — the two Validation at 30cece8: typecheck, oxlint, |
|
The code in 30cece8 is ready. Both problems from the earlier review are fixed, and I found no new problems in the delta. The no-position failure path passes the error through daemon-client-rpc.ts and daemon-artifacts.ts unchanged. Not blocking, and you can take or leave these: the new ADR sentence at docs/adr/0016-active-session-script-publication.md:212 covers both an absent step position and an unreconcilable one, but the code only settles the version and failures for an absent position (session-script-destination.ts:314) and returns the error unchanged for an unreconcilable one (:277), so the wording could say that. The test 'a failed batch that names no position delivers the version and discloses' in daemon-artifacts-script-receipt.test.ts:588 has no failures in its receipt, so it would still pass if that path dropped them. Adding a typed failure and asserting scriptDeliveryFailure and warnings, as the record-gone test does at :667-668, would close that. The Coverage check fails at 30cece8. You tie it to the daemon-proxy-transfer socket hang-up in #4629, which this delta does not touch; please confirm from the log that it is not a coverage threshold on the new files, or rerun it. A security cross-check of this head is running before the label. The open inline thread on disclosing failures when the record is missing no longer applies, because failures are disclosed before the record lookup at session-script-destination.ts:114-115 and the record-gone test covers both outcomes: #4627 (comment) |
30cece8 to
cf0442c
Compare
|
Pushed cf0442c and completed validation. The PR is out of draft. Included #4631's exact test-isolation prerequisite for #4629, preserving all 21 cases, the cap and assertions. Rebased onto main fdf5951; all 11 existing commits are unchanged by range-diff. Removed our temporary boundary-test split because #4630 fixed that upstream. The exact final affected gate passed all 42 runnable checks (25 owned skips), with |
|
Correction to my note above: 30cece8 is not ready yet. An independent security cross-check of this head found one blocker, and the rebase to cf0442c does not change that code. A daemon or proxy can hide a failed batch delivery. In The rule to satisfy: a response artifact can never remove a field it did not create. Restrict script-field cleanup to the reserved Not blocking, and worth a look: a successful batch close that fails its download still gets the hint that the next action or close will deliver again (session-script-destination.ts:393 checks only |
A batch that fails with no step position the plan can reconcile, or whose close sits at or past the failure, proves no close. Its receipt's version and typed failures are still facts the daemon answered about this client's own publication, so they settle and disclose instead of being dropped: silently losing them left the caller file stale with no warning. Only the retirement is dropped. An answer that cannot be reconciled with the plan authorizes nothing at all. Drop the batch-policy re-export of normalizeBatchCommandName so both peers read the contracts facade, prove the ledger's nested flag is load-bearing, and restore the ledger rationale escapes.
An answer that names no failing step, or a close the plan confirms was never reached, proves no close and still settles the receipt's version and failures. An answer naming a step or command the submitted plan does not carry is malformed and authorizes nothing. The ADR said both cases prove no close; the code already rejected only the malformed one.
cf0442c to
63c6341
Compare
|
Fixed the disclosure-erasure blocker at 63c6341. Rejected script artifacts no longer delete response fields or enter the retained artifact list. Peer-supplied The two security regressions fail at the intended assertions on cf0442c and pass with the fix. Also addressed the follow-ups: no-position errors explicitly assert the daemon failure and warning; batch-close download failures give closed-session recovery hints; receipt strings have tested 4,096-character bounds; malformed receipts disclose typed failure on success and error paths. The existing normalization re-export stays, with one implementation in contracts. The exact final affected gate passed all 42 runnable checks (25 owned skips): 20,395 unit tests passed/10 skipped and 306 provider tests passed. Source remained unchanged. Coverage passed at cf0442c; the new head will run its own hosted Coverage and reviews. The PR remains out of draft and watched. |
|
The PR is ready at 63c6341: the earlier findings from cf0442c (#4627 (comment)) are fixed, and I found nothing new that needs a code change. Receipt failures are now disclosed before the record lookup, in https://github.com/callstack/agent-device/blob/63c6341/packages/daemon/src/session-script-destination.ts#L114-L118. Not blocking: the disclosure fix re-adds the The open inline thread on receipt-failure ordering (#4627 (comment)) no longer applies at this head, so you can resolve it. Hosted CI for this head is still running, including Numeric Ranges. The new |
Summary
Remote
batchupdates a recording once, including its finalclose. One daemon receipt names the newest script, close and delivery failures. The client validates recording scope and submitted plan; batch errors and warnings survive. Malformed artifact descriptors cannot erase delivery disclosures or a valid publication. RPC protocol 3 refuses receipt-unaware protocol-2 peers before dispatch; upgrade both peers together.Closes #4595. 29 files, including ADR/user guides, compatibility guards and security regressions. Main now contains the proxy isolation prerequisite; temporary gate work is removed.
agent-device open Settings --save-script ./journey.ad agent-device batch --steps '[{"command":"wait","input":{"selector":"label=\"Apps\""}},{"command":"close","input":{}}]'Validation
Head
63c6341766d47f64bb5602db3bb6f8da4a421650; basebfb67d5cce.pnpm check:affected --run --head HEAD: 42 passed, 25 owned skips, receiptrun-SbopvC,exactCommit=true,checkoutChanged=false.cf0442c2 failed / 63 skipped at the disclosure/publication assertions; fixed candidate214e4812 passed / 63 skipped. Retained at final head. Focused receipt/download/wire suites: 71 passed.cd68b20accepts the contract and smaller design. Later maintainer findings are fixed and covered by regression proof and the final gate.Out of draft. Current-head hosted checks and review remain pending. Native execution is unchanged; no live-device claim.