Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
d03f541 to
4556e33
Compare
|
Thanks for this. I reviewed 4556e33 and found two things to fix before merge. CI is green (21 checks, none failing), and there are no conflicts. A script delivery failure that the daemon reports on a batch step never reaches the batch result.
Not blocking, and you can take or leave these: Could the batch side be much smaller? Keep the five SDK spreads and the serializer helper. Give The CodeQL thread on the polynomial regex in The first finding comes from reading the path from |
An action that records a remote script version keeps its success when that version cannot reach the caller file, so the caller needs one field that says the file is stale. `readScriptDeliveryFailure` reads it from a response, and every result that can carry a script version now spreads it beside the warning: the SDK open, close, snapshot and screenshot results, the CLI human output and `--json`, and the MCP tool text and structured content. A batch delivers the script versions its own steps record. Each step is published through the session-script owner under its own command name, in step order, so a step that closes the recording retires the caller record the way a standalone close does, and a step that only records a version leaves the record open for the next one. The destination still comes only from the record this client's own `open --save-script` wrote, so a response never chooses a path, and a step script of another publication still writes nothing. That retires the `remote_script_batch_close_unsupported` refusal, which existed only because a batch delivered nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tted A batch answer carries one entry per step, and the client delivered whatever the answer named. That made the response the authority over a caller-owned record: an entry planted in place of a `wait` step could name this client's publication and retire it, and its artifact list was unbounded, so one answer asking for a thousand duplicate versions spent a thousand downloads. Delivery now runs on the plan THIS client submitted: an entry must be the plan's own command at the plan's own position and a step that finished, and anything else is reported exactly as the daemon answered it, with no download, no destination and no retirement. Of the versions one payload names, only the newest is taken, and a duplicate or a version no newer than one already accepted is dropped before any request, which caps one answer at one download per submitted step. A `close` step that names this client's publication now reaches the owner even when it carries no artifact, so a recording the daemon could not finish is still forgotten instead of staying active beside a file that never gained its final version. A failed batch reports the steps it finished in the error's `partialResults`, which never reached the code that materializes a successful response. Those steps are delivered before the error is rehydrated, under the same plan bound, so `[wait, close, snapshot]` that fails on `snapshot` still writes the final script and still ends the recording; the batch error itself stands. A batch's own output reads the batch payload, so a step's warning and typed `scriptDeliveryFailure` are lifted onto it: the CLI `Warning:` line, the MCP tool text and `--json` and structured content now say the caller file is stale, instead of printing only "OK Closed: journey". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A batch answer is untrusted input, and the per-step delivery path read it step by step. A failing step's report could carry successful entries for steps that never ran, so a forged partial result retired a close the caller never ran. A malformed publication ID threw while it was interpolated, which turned a successful batch into a client failure. Filtering revisions re-scanned every earlier version, so a large answer blocked the caller. And a successful batch whose steps carried no script stopped before its own payload, leaving the caller's file stale behind a newer version the daemon had stamped. Deliver at most ONE version per batch. Every version is the whole recording, so only the newest of the open publication matters: one linear, bounded scan reads the plan's finished steps and the batch payload and keeps that one, and one delivery goes through the session-script owner. Derive the completed prefix from the submitted plan and cross-check it against the step and executed count the error names, so entries at or after the failure authorize no download and no retirement. Retire only when that prefix contains the close step, with or without an artifact. Validate each candidate with the publisher's own guards, so no response value reaches a record lookup, a path, or a download request. Reports #4564 review findings 1 to 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ints ADR 0016 said every recorded action costs one download without naming the batch case, and the ledger rationale still described the per-step path this module no longer takes. Reports #4564 review finding 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ler path The batch script owner is replaced by one delivery path: read the plan the caller submitted, take its finished prefix, pick the newest publishable version the answer names, and run the single-response owner on that one artifact. `sessionScriptDelivery` takes an explicit `closedPublicationId` instead of a faked `command: 'close'`, and `isPublishableScriptVersion` is one predicate used by the publisher and the batch scan. Step names resolve through `normalizeBatchCommandName`, so the plan check and the daemon's own step naming cannot drift apart. A finished step's `scriptDeliveryFailure` now reaches the batch payload: this client's own failure wins, otherwise the last finished step's failure for that publication, unless the saved version came from a later step. Only the warning written beside that failure rides up. A step entry outside the finished prefix, or one whose report does not describe the submitted plan, authorizes nothing. The failed-batch catch emits the `session_script_delivery_failed` diagnostic, and the batch path rewrites the answer's own artifact list the way a single response does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a385901 to
f09f36f
Compare
|
Yes — it could, and it now is. Line counts
The batch side is 286 lines in two places instead of 333 in one. The second file exists so those readers stay off the client's eager import path: Finding 1 — a step's daemon-side failure now reaches the batch payload The disclosure takes this client's own failure first, else the last finished step's failure whose Finding 2 — one normalizer Imported from Cross-check items
Non-blocking notes, taken
|
Closes #4564.
An action that records a remote script version keeps its success when that version cannot reach the caller file. The wire already answered
scriptDeliveryFailure; nothing above it passed the field on, so a caller read a stale file as current.readScriptDeliveryFailurein the kernel reads the field from a response, andreadScriptDeliveryDisclosureadds the paired warning. Every result that can carry a script version now spreads both: the SDKopen,sessions.close,apps.close,snapshotandscreenshotresults, the CLI human output and--jsonpayload, and the MCP tool text and structured content.batchnow delivers the session script its answer carries, through the same session-script owner a single response uses. The destination still comes only from the record this client's ownopen --save-scriptwrote, so a response never chooses a path and a script of another publication writes nothing. That removesremote_script_batch_close_unsupported, which existed only because a batch delivered nothing.Every script version is the whole recording from the
open, so a batch is owed AT MOST ONE download: one linear, bounded scan reads the plan's finished steps and the batch payload itself, and keeps the newest version of the open publication, wherever it was named. Delivery is authorized by the plan the client submitted, never by the answer: the completed prefix comes from the plan, and on a failed batch it is cross-checked against the failing step and executed count the error reports. Entries outside that prefix, or naming another command, are reported exactly as the daemon answered them, with no download and no retirement, and a retirement follows only a close the plan itself ran and finished — with or without an artifact, so a recording the daemon could not finish is still forgotten. Each candidate is validated by the publisher's own guards before anything is looked up or requested. A batch that fails after a step closed still delivers what the finished steps recorded, and keeps its own error. The batch payload carriesscriptDeliveryFailurewhen this client's own delivery, or a step that finished, reports one for the open publication and no version saved after that report supersedes it, and only the warning written beside that failure rides up: the batch's own payload is the channel the CLIWarning:lines,--jsonand the MCP tool text read. Step names resolve throughnormalizeBatchCommandName, and one exportedisPublishableScriptVersionserves both the publisher and the batch scan, whilesessionScriptDeliverytakes an explicitclosedPublicationIdrather than a fakedcommand: 'close'.Tests cover each surface's disclosure and batch delivery end to end. ADR 0016 drops its known-limitation note.
🤖 Generated with Claude Code