Skip to content

Commit 4d41c2d

Browse files
author
Antoni T
committed
computer: document the second reason a pull skips
SkippedEntry became a union of two reasons when the per-command write capability landed: an entry can be refused because it targets a read-only mount root, or because the command ran without write access and the post-command pull refused everything it was offered. The comments on ExecResult.skipped and Workspace.pull still described only the mount case, and ExecResult went further and claimed the field is empty when no read-only mounts are registered. That is wrong for a container command that ran read-only. Describe both reasons, and note that a backend sharing the workspace store never fills the field because it has no pull to refuse.
1 parent 6a334d5 commit 4d41c2d

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

packages/computer/src/shell.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ export interface ExecResult<E extends ExecEncoding = undefined> {
5555
// VFS sync stats from the docs/05 bracket.
5656
// pushed — entries shipped by the pre-exec pushOnce.
5757
// pulled — entries the post-drain pullOnce applied locally.
58-
// skipped — entries the post-drain pullOnce did NOT apply
59-
// because they targeted a read-only mount root.
60-
// Empty when no read-only mounts are registered or
61-
// the container stayed clear of them.
58+
// skipped — entries the post-drain pullOnce did not apply,
59+
// either because they targeted a read-only mount
60+
// root or because the command ran without write
61+
// access and the pull refused everything it was
62+
// offered. Always empty for a backend that shares
63+
// the workspace store: there is no pull to refuse,
64+
// and a write fails inside the command instead.
6265
// pushed is observed before the stream is returned. The remaining
6366
// fields describe the post-command pull when result() is used.
6467
pushed: number;

packages/computer/src/workspace.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ export class Workspace {
626626
// pull() returns the dofs ApplyResult { applied, skipped } —
627627
// `applied` is the number of entries written into the local
628628
// store, `skipped` surfaces remote-side writes the apply path
629-
// rejected because they targeted a read-only mount root.
629+
// rejected, either because they targeted a read-only mount root
630+
// or because the pull ran without write access.
630631
//
631632
// Both methods emit a `workspace.sync.push` / `workspace.sync.pull`
632633
// span on the configured observer, tagged with the resolved

0 commit comments

Comments
 (0)