Repository navigation
Description
Purpose
A remote batch delivers no script versions from its steps. To keep the final script from being lost silently, a batch that would close an armed remote recording is refused with remote_script_batch_close_unsupported. Users run close on its own after the batch.
#4582 first delivered batch-step scripts by having the client read the daemon's batch answer: the step entries, partialResults and the failure position. Six review rounds kept finding new ways a daemon answer could make the client deliver the wrong version, retire a recording that never closed, or drop a failure. That approach was removed from #4582, which now carries only the result fields.
Required behavior
- The daemon's request owner collects script delivery effects for the outer request, including nested batch steps, and attaches one delivery receipt to the outer response. This applies to successful and failed batches.
- The receipt names, for each publication:
- the newest full-script version (
scriptRevisionand its artifact); - an explicit close receipt when a step closed the recording, including when the final script could not be written;
- the typed
scriptDeliveryFailurethat applies, if any, with its paired warning.
- the newest full-script version (
- The client never reconstructs delivery from step results. It:
- validates the receipt's publication against its own record (exact ID, tenant, session, endpoint);
- validates a close receipt against the batch plan it submitted;
- downloads at most one version per response;
- retires the record on a validated close.
- Remove the
remote_script_batch_close_unsupportedrefusal once this lands.
Acceptance cases
Each case is a test that fails on a client that interprets step results.
From the round at d14e68a:
- A publication ID padded with whitespace does not mask the recording's real final version, and does not retire the record.
- An
ok: falsestep entry delivers nothing and authorizes no later retirement. - A failed batch whose error omits the failing step and command is never read as a full success.
- A
nullor other non-object entry in an artifact list does not throw, and does not hide a valid version. - When both the daemon's step write and the client's download fail, both typed failures and warnings reach the batch result.
From earlier rounds:
6. A failed batch delivers the completed steps' newest version and keeps the original batch error.
7. A close whose final script the daemon could not write still retires the record, and discloses the failure.
8. A forged close entry, or a close the batch never reached, never retires the record.
9. The number of downloads and of entries examined is bounded, whatever the answer names.
10. Batch delivery warnings appear in CLI and MCP human output.
11. A failure position beyond the plan, or one whose command differs from the plan, authorizes nothing.
12. A malformed publication ID drops the artifact and keeps the batch's outcome.
13. Selecting the newest version runs in linear time.
14. A newer version on the batch's own payload is delivered even when no step carries one.
15. A higher-revision entry with the wrong artifact type, or for another recording, never masks this recording's version.
16. A failure a finished step reports reaches the batch result when only failures are present.
17. Step command names are resolved with normalizeBatchCommandName.
Completion conditions
- A provider scenario runs a remote open with
--save-script, then abatchofwaitandclose. It asserts that the caller file holds the final script and that the client record is retired. - ADR 0016 replaces the batch known-limitation note.
Activity
apex-sentinel-staging commentedon Nov 16, 2026
Apex Sentinel · Issue review
Suggested label:
featureThe issue specifies a new daemon-side delivery receipt design for remote batch script delivery and requests removing the current remote_script_batch_close_unsupported refusal, making it an enhancement request rather than a defect report.
refactor(remote): keep the script disclosure surfaces and refuse batc…
feat(remote): surface a script delivery failure on every caller surfa…