Skip to content

feat(tui): track sandbox creation as a per-target step#105

Open
raphaelvigee wants to merge 1 commit into
masterfrom
worktree-bridge-cse_01Ga6LENvk1dwt9TkTtTTXno
Open

feat(tui): track sandbox creation as a per-target step#105
raphaelvigee wants to merge 1 commit into
masterfrom
worktree-bridge-cse_01Ga6LENvk1dwt9TkTtTTXno

Conversation

@raphaelvigee

Copy link
Copy Markdown
Member

What

Adds a SandboxCreate step, tracked start→end and rendered as a per-target op in the TUI (flagged slow when it runs long), like any other step (execute, cache read/write).

It wraps the sandbox build — creating the dirs + materializing every declared input (unpack / hardlink-stage / FUSE-slot register) — which is the slow part on big inputs, a cold stage, or a FUSE mount (see #102). This is distinct from the Execute op, which covers only the subprocess run, so the TUI now shows why a target stalls.

How

  • hcore::events — new SandboxCreate{Start,End} variants + a sender-based emit_scope_tx(Option<EventSender>, …). The engine's existing emit_scope needs RequestState; the driver bridge sits below the engine, so it gets a variant keyed on a raw EventSender. Drop-guard fires End on completion, ?, or cancellation.
  • RunRequest.events: Option<EventSender> — plumbed from RequestState in execute.rs. None is a transparent no-op (tests, remote serve path).
  • Driver bridge owns the create step, so it emits: both OS and FUSE run_inner wrap their materialization in the scope.
  • TUI Op::SandboxCreate (icon ), ordered between remote-read and execute.

Tests

  • core: emit_scope_tx emits start+end on success, captures error in End, still emits End on cancellation.
  • driver-bridge: run emits SandboxCreate Start+End carrying the target addr.
  • tui: folds ahead of Execute in the breakdown; a long-running sandbox build surfaces on its own slow row with the right icon.

lint (full --all-targets clippy + fmt) and touched-crate tests green.

🤖 Generated with Claude Code

@raphaelvigee raphaelvigee force-pushed the worktree-bridge-cse_01Ga6LENvk1dwt9TkTtTTXno branch from 6b49cfe to 6df5cae Compare June 20, 2026 13:15
Bracket the sandbox build (create dirs + materialize every input: unpack /
hardlink-stage / FUSE-slot register) with SandboxCreate{Start,End} events so it
renders as its own per-target op in the TUI and is flagged slow when it runs
long — distinct from the Execute op that covers the subprocess run.

The driver bridge owns the create step, so it emits the events. It sits below
the engine, so plumb an Option<EventSender> through RunRequest (populated from
RequestState) and add a sender-based emit_scope_tx to hcore::events (the
engine's emit_scope needs RequestState). Both bridge paths (OS + FUSE) wrap
their materialization in the scope; the guard fires End on success, `?`, or
cancellation.

TUI gets an Op::SandboxCreate variant ordered between remote-read and execute.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@raphaelvigee raphaelvigee force-pushed the worktree-bridge-cse_01Ga6LENvk1dwt9TkTtTTXno branch from 6df5cae to da729a0 Compare June 20, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant