feat(tui): track sandbox creation as a per-target step#105
Open
raphaelvigee wants to merge 1 commit into
Open
Conversation
6b49cfe to
6df5cae
Compare
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]>
6df5cae to
da729a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— newSandboxCreate{Start,End}variants + a sender-basedemit_scope_tx(Option<EventSender>, …). The engine's existingemit_scopeneedsRequestState; the driver bridge sits below the engine, so it gets a variant keyed on a rawEventSender. Drop-guard fires End on completion,?, or cancellation.RunRequest.events: Option<EventSender>— plumbed fromRequestStateinexecute.rs.Noneis a transparent no-op (tests, remote serve path).run_innerwrap their materialization in the scope.Op::SandboxCreate(icon⊞), ordered between remote-read and execute.Tests
emit_scope_txemits start+end on success, captures error in End, still emits End on cancellation.runemits SandboxCreate Start+End carrying the target addr.lint(full--all-targetsclippy + fmt) and touched-crate tests green.🤖 Generated with Claude Code