Repository navigation
feat(console): Dashboard, a live build dashboard in place of Bazel's terminal UI - #1693
Open
gregmagolan wants to merge 87 commits into
Open
gregmagolan wants to merge 87 commits into
gregmagolan wants to merge 87 commits into
Conversation
gregmagolan
force-pushed
the
console-fullscreen-poc
branch
9 times, most recently
from
November 20, 2026 22:33
45f7745 to
3e019ce
Compare
gregmagolan
force-pushed
the
capture-bazel-stderr
branch
from
November 20, 2026 23:01
0379806 to
f5ceee0
Compare
gregmagolan
force-pushed
the
console-fullscreen-poc
branch
12 times, most recently
from
November 21, 2026 01:41
25b9a8f to
a500f18
Compare
gregmagolan
force-pushed
the
capture-bazel-stderr
branch
from
November 21, 2026 03:42
f5ceee0 to
dd2d625
Compare
gregmagolan
force-pushed
the
console-fullscreen-poc
branch
6 times, most recently
from
November 21, 2026 04:41
058549f to
a871169
Compare
- A dump's mark notes how much of the task's and the console's unended lines the terminal already shows (out::mark_dump). The dump leaves that start out, whether it is still pending or since written as the start of its line, whose start is kept apart in output.ansi for it. It then goes on from the line the terminal is on, with no new line first. A line begun before a take and ended under the screen shows once and whole, and a question answered at a prompt shows once; a Ctrl+Z cycle no longer dumps the same unended tail again. The task's and the console's unended lines are two lines in a dump, not one. - The stdout console waits for stderr's forwarder (a Gate) before it holds stdout's target, and holds it across a flush too. - A dump says it is written as it takes the mark, under the mark's lock, so a release racing a suspend's dump doesn't dump again; a failed resume keeps the screen given back without a fresh mark. - ASPECT_TEST_DUMP_DELAY_MS is capped at 5s. Docstrings follow. - Tests for the line begun before the take and the answered question, both failing without the mark's note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shown-prefix skip rendered a line's start and the rest apart, which broke the files themselves: a secret cut by a mark went unredacted, a carriage return or an erase across the cut was lost, a character split by it became two, and the dump glued what followed onto the terminal's line. It is gone (Stream::shown, the kept ranges, the continuation). Files are rendered from whole lines exactly as with no screen. A dump's mark notes only whether the task or the console had an unended line, the one the terminal is in the middle of; the dump then has that line whole and redraws its row from the start (CR, erase line) instead of a new line. std's buffered stdout is flushed under the dump's turn where it shares the terminal, so a line begun there shows once and nothing of it after the end. The task's and the console's unended lines are two lines in a dump. Also: a take sets its dump mark inside the descriptor switch, as resume does; the stdout console's gate is skipped for hidden writes; repeated dump_output() calls give the same answer. Tests: a secret split across Ctrl+Z, the older note on its own line, a buffered stdout line begun before the take (each failing on 5b168bb), and file-level tests that a mark changes nothing in the files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dump erased a forwarded child's unended line sharing the row (a child's start is shown, not copied until its line ends, and is never written again), because the redraw keyed on a flag from the mark. axl_types::terminal now notes, per target, whether its current row holds only the CLI's own output (its lines, the AXL streams, the build console, keep_output): the CLI started the row and nothing else has written to it since. A dump redraws the row only when that holds, the CLI had exactly one unended line at the mark, and that line wasn't stdout's on a target of its own. Any other row gets a plain newline: a start may show twice, never be lost. Also: the dump's stdout flush runs only with the target held. The take() comment and dump_output's doc follow. The out.rs part tests are described as whole-line rendering guards. The secret test asserts the CLI stopped before fg. main_screen erases a whole row on ESC [ 2 K. A test for childafter, childfirst, stdoutpiped (on the terminal and piped) and latedump fails with the old rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dump that finds the terminal mid-line now always starts with a newline. Redrawing the row with `\r\e[K` erased output the CLI cannot see the owner of: a child given the CLI's own stderr, a child's stdout piped through `| cat` to the same terminal, and it wrote escapes into a `2>file`. The cost is that a line left unended when a screen is taken shows its start again in the dump. Drops the row-owner tracking (CLI_ROW, wrote_cli), the dump's partial flag and mark_dump. The release and suspend dumps pass whether giving the descriptors back held every target, so a dump after a timed-out hand-off takes stderr's turn itself before flushing stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With stdout and stderr separate targets, a hand-off that gave up on stdout's (a forwarder stalled on a pipe nobody reads) made the release and suspend dumps take stderr's turn again, on the lock the same thread held: a 2s wait before every such dump and Ctrl+Z. every_turn_within now returns Turns, which says which targets it holds; the dumps pass whether stderr's is held. The dump's flush of std's buffered stdout waits for the terminal to take writes, so one stopped with Ctrl+S never blocks it with every target held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…patches
Dashboard:
- `]` `[` `}` `{` with the Failures pick on a target without a log
indexed past the logged records; the last of them stands in now.
- `}` `{` with the open log's target no longer listed (another list, a
newer build's failures) took a modulo of zero; the chosen record's
target is stepped instead.
- A build folded before any frame noted what it blocked kept `blocked`
as None, and Metrics for it failed on len(None).
- Metrics' elapsed for a folded build is its own run, not the task's
time so far.
- The Invocation tab hides the value of a secret-named setting inside
a flag's value (`--define=API_TOKEN=x`, `--test_arg=--password=x`).
Lint:
- A relative fix patch path (a remote cache's lint output) is taken in
the workspace: patch runs in the copies' directory and never found it.
One that isn't there, or that patch can't read, is warned about.
- A patch making a file already there with other bytes keeps its hunk
as a reject; BSD patch calls it applied already.
Runtime:
- The runtime's own FORCE_COLOR/CLICOLOR_FORCE removal on a reused
command no longer reads as the task's, so a later spawn colours again.
- The terminal lock tests run one at a time: where stdout and stderr
are one target they shared the mid-line flag and flaked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uble
Lint:
- A file a patch makes (old side /dev/null, no other header changing
it) that is there already is made apart from it and compared by its
bytes: the same count as applied, other bytes keep the file and the
hunks as a reject. GNU patch never says "previously applied" for it,
and the text compare was lossy for bytes that aren't UTF-8.
- patch exiting with trouble (2 or more, or a signal) applies nothing:
files before the bad hunk were copied back. A patch path that is a
directory says so.
Dashboard:
- } { step from the record shown, not the chosen one; one shown from a
list it is no longer in opens its target's first record, unstepped.
- Metrics' elapsed for the running build is since it started.
- The Invocation tab hides a secret flag's value given in the next
argument (`--test_arg=--password --test_arg=x`) or after a space, and
takes pwd/passwd/cookie/session for secret names too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lint: one check, before anything is copied or patched, refuses the whole patch with a warning naming the path and why: a path in more than one header (a type change, two creations, a rename onto a made file), one there that isn't a regular file, a parent that isn't a directory, a symlink on the way (a dangling one let a creation write outside the tree), or a patch past the 64 MiB read cap. A directory or a file where a parent should be raised mid-way, after earlier files were rewritten. Emptiness reads the file's size. Dashboard: a secret flag's value in the next argument is hidden only where that argument is the same flag again. child_output_test reads CARGO_MANIFEST_DIR at run time: env! embedded the build path, which Bazel's process wrapper refuses. history.axl's docstring no longer calls every option off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apply_fix_patch's refusal follows every symlink on a named path and refuses only one leading out of the workspace or to nothing: in-repo symlinked directories applied before the up-front check and refused every fix under them after it. Paths are compared with their symlinks followed and their case folded (a case-only rename on APFS left an empty file), and one with a `.` or empty component is refused (it evaded the duplicate check and crashed making the copy's directory). The size cap is checked before `seen` reads the patch, and its test now bites: a first hunk patch would apply, then 64 MiB of line ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI on a loaded runner failed three child_output tests on their first attempt and one crash_handler test: - The two stalled-stdout tests gave the whole run 20s from test start, which the runner spent before the CLI printed anything. They now give a run 90s to get there; the times they assert stay measured from the take, the leave and the ticks. - The Ctrl+Z test sent Ctrl+Z after 30s even if the screen never left; it now waits for the leave and asserts it. Its 1.5s bound stays under the 2s replay it guards against, so the target runs `exclusive` rather than beside the rest of //.... - crash_log_is_written_when_stderr_blocks killed the child once the log existed, but the handler opens the log before writing its marker: it now waits for the marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apply_fix_patch's refusal compared paths by spelling, case folded: it missed one file under two Unicode normalizations on APFS and under two hard-linked names (one hunk lost, or a file left empty), and refused two real files that differ only in case on a case-sensitive disk. Each named path is now keyed by the (dev, ino) of what it resolves to, or of its deepest ancestor that is there plus the rest as named, so a lookup that finds another spelling counts as that file. Also refused: removing a file through a symlink naming it (the link went, its target stayed), and a path in a directory it may not look in (which raised). A file where a directory should be is named as such. fs.Metadata gains `dev` and `ino` (None off Unix). The three child_output tests that assert durations take one lock, so they never run beside one another. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A case-sensitive checkout with the copies in a temp dir that folds case had src/a.txt and src/A.txt as two files in the tree and one copy: both hunks landed on it and the one result was written over both. The copies are now checked by identity once made and again once patched; two named paths that are two files in the tree and one there refuse the patch, nothing copied back. Where the temp dir folds two new names into one, that is now a clean refusal too, not a misleading reject. Off Unix, where dev/ino are None, a path's spelling is its identity. Refusals show characters past ASCII as \u escapes, so NFC and NFD spellings read apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
console_test's "hang" on Linux CI is its timeout: some ninety runs of the unoptimized CLI, each about a CPU-second evaluating the builtins, took 274s on the passing retry against the medium size's 300s, and the first attempt ran past it. HANG-DIAG's "stuck" process had one thread running (the evaluation) and the main thread waiting on it: slow, not held. The target is now large. HANG-DIAG now prints each thread's CPU over one second, so a busy thread reads apart from a stuck one, and every thread's stack from gdb or eu-stack (each tried under `sudo -n` too, as Ubuntu lets no non-ancestor attach), each bounded at 20s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Header names are read as patch opens them: to a tab, else to the first whitespace. A name with whitespace and no tab after it (rules_lint's `diff --label` gives that) opened another file than it named, and a git-quoted name is unquoted by GNU patch only: both refuse the patch. So do git headers the copy-back by bytes would not carry (a mode change, a rename or copy, a binary patch) and modes other than a regular file's (`120000`, a symlink). A named path that another named path is with `.rej`, `.orig` or `.~N~` after it is refused: patch's own output overwrote it. VERSION_CONTROL, PATCH_VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX are dropped from patch's environment. Once patched, a named path in the copies that isn't a regular file (a symlink GNU patch makes) or is gone unasked refuses the patch, nothing copied back: the copy-back followed such a link. Every path a warning or INFO line names is escaped: `\` doubled, control characters and those past ASCII as `\u`/`\U` codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tself Lint: a git header's refusal names its keyword alone (it printed the rest of the line, an escape sequence and all), and the path component a file stands in is escaped. patch runs with LC_ALL=C and no LANGUAGE, as _ignored_rejects reads its English. apply_fix_patch takes `say`, what prints its warnings, so a test checks them. A dead `Binary files ` entry is gone from _GIT_HEADERS. HANG-DIAG: a stack tool's stdout is drained as it comes (a report over 64 KiB blocked it until the kill, and read as "could not attach"), stderr dropped; under sudo it runs within `timeout -s KILL`, as a kill of sudo left a root gdb attached, and only where `timeout` is there. Stacks are printed for the first two processes, 40s at most each, and child_output_test is large, so the diagnosis prints before its timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From driving the Dashboard against real Bazel 9 builds of examples/dashboard: - A blocked top-level target counts as blocked, not failed, in Results, Metrics and the summary (target_counts); Metrics lists the failed actions and attempts on a row of their own. - A test whose summary is Aborted (it failed to build) counts as failed, as Bazel counts it; an interrupt is no verdict. - An attempt Bazel posts twice is one Failures row, the one with its log, and a failed TestRunner action folds into its test's attempts. - Metrics' spawns say "after the build" until the execution log is read, then "0 run" for a log with none; a cached build's slowest pane says nothing ran. The follow hint names J, the key that follows; the Tips tab's keys row shows only its own keys. - examples/dashboard/flaky.sh touches TEST_SHARD_STATUS_FILE, so its shards run on Bazel 9. Tests: exec_log_event_test, feature_shorthand_test, axl_load_failure_test and feature_color_test are large, each within reach of medium's 300s on a loaded CI runner. HANG-DIAG spends its stack budget on aspect-cli processes alone, counts only captures that worked, and tries no tool again once every one has failed to attach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From real Bazel 9 runs: - A test summary Aborted with no reason is failed only where one of its attempts failed (it failed to build); else Bazel skipped it (a build without --keep_going stopped first), counted as skipped in Results and Metrics. The last commit counted every one failed. - A target is blocked only by a root cause that failed in this build: a missing source file (an unconfigured root) is its own failure. - "nothing ran" shows only for a successful build its BuildMetrics say ran nothing; Metrics keeps no Slowest mid-build. - A build folded at its end keeps that its execution log was read (end_build), rather than saying "after the build" forever. - A failed TestRunner action folds into the attempt its output names, else stays; the Flaky group tells shards apart; the Tips keys row says undo where every tip shown is silenced. HANG-DIAG reserves a stack capture atomically and gives it back unless it worked, and gives up on the tools only where they failed to attach to a live process, not for time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From real Bazel 9.3.3 runs (shapes in the tests): - "nothing ran" leaves out the workspace status action, which Bazel runs on every build: a fully cached rebuild reports one executed. - A TestRunner action is the attempt after the last whose result came (Bazel sends an attempt's action before its result), its run and shard from the one folder after testlogs/<package>/<name>/ alone: a test named shard_9_x, a package folder run_2, or a folder naming both (shard_1_of_2_run_2_of_2) no longer misparse. It is dropped once that attempt's result comes with a log; where it never does (a shard that failed to build, an attempt cut off), its row is that attempt's. - An Aborted test summary is failed only beside a FAILED_TO_BUILD result: a flaky test whose later attempt was cut off is skipped, as Bazel counts it. A test target that failed to build or was blocked counts failed in the Tests row, once. - Blocked is decided from the build's failures as they end up, so a dependent Bazel reports before its root (one failed in analysis, an Aborted target_configured) is blocked. - A folded build is not building: picked with < while the next runs, it keeps its Slowest. Skipped tests show in the scrollback's summary and the narrow header; the Tips keys row names what s does to the chosen tip. HANG-DIAG treats a zombie as gone and gives all stack capture 60s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A test target that failed to build or was blocked counts as a failed test only under `test` or `coverage` (from BuildStarted's command): `aspect build` ran no test. - The finished pane's "nothing ran" row was nine cells short: its colour came inside the text `fit` pads by length. It is plain now, coloured by the box, as a running action's age is; the "+N earlier" row too. - A target blocked by a dependency it was not asked for, which failed analysis (an Aborted configured_label), is blocked, not failed. - A TestRunner action's attempt is keyed by its configuration too, and a retried attempt clears what a new build clears (root causes and the blocked cache), through one helper. HANG-DIAG's 60s stack budget is time spent capturing, not a deadline from the first capture: a slow CLI captured early leaves it for a hang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… own A root cause not asked for that failed analysis (an Aborted configured_label: a broken rule, a missing package) read "✗0": only its dependent was listed, blocked, and Enter on it said the root had no log. It now counts as a failed target, once per label though Bazel posts it per configuration, and is a ✗ row whose log is Bazel's error (the Aborted description). count_event and note_event take `aborted` (the payload's type by default), so a test feeds a real-shaped Aborted configured_label; the count_event docstring covers BuildStarted's gating and failed_roots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bazel 9 makes a requested target that fails analysis its own root cause: an Aborted configured_label for its label, then its Aborted target_configured with that as its child. Both counted it failed, so Results, Metrics and the summary said 2 failed beside Failures' one. The root is now counted through count_aborted, which counts a label once whichever of the two comes first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tool's line written as `ESC[32mINFO:ESC[0m two` (the colon inside the colour, the space after) matched Bazel's own end-of-build status line, which curses draws in its progress area. Taken for drawn, it and the line after it were erased under a terminal: lost from the Dashboard's console and the plain console alike. Inside an action's output, or streamed test output, such a line is the tool's, for every severity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
interrupt.rs and task_exit.rs spawn the CLI keeping the whole environment, so their fixture tasks (sleeper, waiting, stubborn, grouped, watching, owner, prompt, shell, ignores, refuse) were recorded in the developer's own task history, some 2,200 entries. The first aspect_cli() call in a test process now points ASPECT_HISTORY_DIR and ASPECT_CLI_CACHE at temp folders of its own, which every CLI it spawns inherits whatever its command keeps; base_env() carries them too, and a test that names its own still wins. A test spawns the CLI keeping the environment and finds the run in the test process's history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no tips, an inactive Tips tab and the console's state ("following",
"12 lines up · J to follow") were the same muted gray side by side, so
the state read as another tab. It now sits at the right end of the tab
border, a dash apart from the tabs, in the accent colour no tab has; it
is cut, then left out, rather than the tabs collapse for it. Seven
golden frames changed in that border line alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
w, e, z, m, p, a and Ctrl+O changed the screen with nothing said. Each
now has the keys row name the state it left and the key that undoes it
for two seconds ("long lines cut · w wraps them", "errors only · e
every line", "mouse off: the terminal selects text · m takes it back"),
from a `said` beside its overlay text in KEYS. What the keys row says of
its own first (cancelling, finishing, the countdown) still wins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… does
The Results pane's "Cached 4% of 1452 actions" read against the
header's "3,830 of 8,563 actions done" as a contradiction. The header is
Bazel's own progress count, every action in the build graph (one its
local action cache satisfies, and its internal ones, count as done
without running); the Results figure counts the execution log's spawns
so far (what ran, or a remote or disk cache served). It now says
spawns ("Cached 4% of 1,452 spawns"), and every count the Dashboard
prints has thousands separators (`_counts`).
As BuildBuddy's theme colours the seconds in Bazel's progress area, a
running action's time alone is drawn by its age (muted, then warning
once slow, error once stuck, `aged_time`), the rest of its row plain;
and the header's time is strong, as that theme makes Bazel's elapsed
time bold. Roles every theme defines, so NO_COLOR and mono follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tab widths - c27cccd let Bazel's own curses status rows through after --test_output=streamed (`streamed` never resets): five bare `INFO:` rows in the console. The status guard is the action's output alone; streamed output takes a status row only with nothing after its label or one of Bazel's status phrases. - Every note goes through say_note, so a mouse note after an expired toggle note shows; notes are timed by the screen's own clock, so one expires on the finished screen, whose header time stays. - z and p say what is so (console zoomed or unzoomed; no build panes before a build); the tab border's state is bold too, apart where colour is not shown. - A tool's `INFO:` coloured as Bazel colours a label (colon inside the colour) stays in its action's Ctrl+O fold. - At 49 columns the shown tab was cut to `onsole`: the collapse check was a cell looser than the room the tab gets. - Test history and cache folders are one per test binary, reused, not one per process left behind. The waiting-line doc comment is back on its test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- After --test_output=streamed a status-shaped row was Bazel's when its text began with one of Bazel's closing phrases, so a test's own colon-inside "Build completed…" line was drawn and trimmed. Bazel's own colon-inside status row is always bare; only that counts now. - The header's time was `strong` inside a bar already bold and in reverse video, so it showed no different. It now leaves the bar's reverse video, in `heading`: apart in every theme, mono included. - The slowest pane's minutes (`1m05s`, as `elapsed` writes them) got no colour: one word parser reads Bazel's times and `elapsed`'s. - Beside the caller's own binary or JSON execution log, a hook that only reads entries (the Dashboard's) no longer adds the compact log, which made Bazel refuse the build; its handle ends with no entries, and telemetry adds none either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the caller's own --execution_log_binary_file or --execution_log_json_file, Bazel writes no compact log for the Dashboard to read, so Metrics said "0 run: the execution log has none". It now says the build writes its own execution log, naming the flag, read from the build's options (an rc file's too); Results shows no cache row, having no spawns to count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rator is told An empty `--execution_log_*_file=` value now counts as no format in both the runtime and the dashboard, which also reads the last occurrence so a command-line value overrides the rc. Beside a caller's own binary or JSON log the iterators are released; the exec-log hook's is marked as such, and a task's own iterator warns once that it gets no entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Ships
Dashboard, a live dashboard of a task and its builds in place of the console and Bazel's terminal UI, with the CLI, forbuild,test,lint,gazelleandformat. It's off by default; try it with--dashboard:What it shows:
No build yet) before one.4 of 14 actions done(orloading/analyzing/startingbefore Bazel counts); after the task, only what ✔/✗ cannot say, fromBuildFinished(interrupted,ended without a result). No progress-bar row: the panes sit under the header, one height for the whole build, the Running list scrolling in it. When a build ends it folds to a row with the actions it ran (fromBuildMetrics);popens it again, and</>pick a build in Metrics and Invocation.?overlay, which is grouped (Scroll, Search, Failures, Screen, Leave) and leaves out keys that don't apply now. A toggle (w,e,z,m,p,a, Ctrl+O) says in the keys row for two seconds what it left and how to undo it (long lines cut · w wraps them).ssilences one on this machine).oopens a file only in an editor, never through afile://link.Cached 4% of 1,452 spawns): what the execution log has seen run or come from a remote or disk cache, not the header'sN of M actions done, which is Bazel's count of every action, including those its own action cache satisfies and its internal ones. Every count has thousands separators.ESC[32mINFO:ESC[0m two, the colon inside the colour) is the tool's: inside an action's output it is neither erased as Bazel's progress area nor taken for the start of a block (Ctrl+O folds it with its action). After--test_output=streamed, which never ends, only a bare status row, as Bazel's own always is, counts as Bazel's.--execution_log_binary_fileor--execution_log_json_file(an empty value clears it, as Bazel reads it) the CLI adds no compact log for execution-log iterators that only read entries: anexec_log_eventhook's (the Dashboard's) and a task's ownctx.bazel.build(execution_log = [iterator])alike end with no entries, the task's own with a warning, rather than have Bazel refuse the build. The Dashboard's Metrics then saysspawns: not read: this build writes its own execution log (--execution_log_binary_file), and Results shows no cache row.--keep_goingstopped first, or a flaky test's later attempt was cut off), and, undertestorcoverage, a test target that failed to build or was blocked is failed: Bazel's own counts. An attempt Bazel posts twice is one Failures row, the one with its log; a failedTestRunneraction is the attempt after the last whose result came (its run and shard from itstestlogsfolder), dropped once that attempt's result comes with a log, else its row is that attempt's. Metrics saysafter the buildfor spawns until the execution log is read; a successful build that ran nothing but Bazel's workspace status says nothing ran.output.ansifrom where the screen was taken, re-linked, then a summary. The dump is written as part of the release, with every writer held from the main screen coming back, so no line printed meanwhile shows twice or ahead of it. A forced exit and a panic dump it too; a crash ends withoutput: <path>.What changes for tasks under any run, not only the dashboard's:
patch's temp files kept there) and copied back by their bytes, sopatch's.rej/.origfiles never touch the user's. A file is removed only where its header's new side is/dev/null, with BSD and GNU patch alike: a fix that empties__init__.pyleaves it empty. A fix to a file that isn't there is named in an INFO line, and a patch with a malformed hunk range is skipped with a warning. Lint outputs count as complete by their byte length, read lossily, so a patch with a Latin-1 line applies rather than timing out. A patch identical to one already applied in the run is skipped, hunkspatchignored as already applied (and only those) aren't reported as rejects, and a patch naming a path outside the tree is refused. Real rejects are kept apart, and a line says where. A patch's relative path (a remote cache's lint output) is taken in the workspace, and one that isn't there is named in a warning. A patchpatchcan't read in full (exit 2 or a signal) is applied not at all, not even the files before the bad hunk. A patch is refused whole, before anything is copied, with a warning naming the path and why, where two named paths are one file by the filesystem's own identity (dev,ino), symlinks followed: a type change, two creations, a rename onto a made file, a hard link, or a case- or normalization-only rename where the disk takes the names as one. Also where a path has a.or empty component, isn't a regular file, goes through a file or a directory it may not look in, has symlinks leading out of the workspace or to nothing, or is a symlink the patch would remove; or where the patch is past the 64 MiB read cap. A symlink within the workspace is followed. The copies are checked the same way once made and again once patched: two files in the workspace that are one where the patch is applied (a case-sensitive checkout, a temp dir that folds case or Unicode) refuse it, nothing copied back. Header names are read as patch opens them (to a tab, else to the first space): a name with a space and no tab after it, a git-quoted name, a git mode, rename, copy or binary header, or a non-regular mode (120000) refuses the patch, and so does a named path patch would write its.rej,.origor.~N~over. Once patched, nothing but regular files is copied back: a symlink patch made, or a file gone unasked, refuses it. Paths in warnings are escaped. A file a patch makes that is there already (not empty) is made apart from it, with BSD and GNU patch alike: the same bytes count as applied already, other bytes keep the file and the hunks as a reject.dup2over a FIFO waits out a write in flight, which stalled a screen's take. A stdout nobody reads (a FIFO, a pager) therefore holds up only its own child: not a take, not stderr, and a release's stdout replay for at most 2s. Every write to fds 1 and 2 (the CLI's own lines, the AXL streams, the build console, forwarders, dumps, replays) takes one lock per target, shared when stdout and stderr are one file or terminal. So no two writers' lines are ever spliced; a dump waits briefly for a child's line to end. Moving the descriptors in or out of a screen's capture holds every target, so a Ctrl+Z leavesoutput.ansiwhole too.qcancels the run's root token once, so Bazel gets one interrupt sequence.ctx.std.process.command) reads/dev/nulland has its stdout and stderr piped through the CLI: flushed as they come, copied tooutput.loga line at a time (under the Dashboard, handed to its console a line at a time), and passed on until its pipes end, for 2s at most after it exits.FORCE_COLOR/CLICOLOR_FORCEare set when its stdout reaches a colour terminal, unless the task or the CLI's own environment sets them. A child marked.interactive(True)gets the real terminal when there is one, in the CLI's own process group (so Ctrl+Z,fgandbgare the shell's), with marker lines before and after it; without one (CI) it is piped like any other..interactive(True)withprocess_group(...)is refused at spawn.aspect runpasses its program the CLI's stdio explicitly.ctx.std.fs.create(...),"null"or"inherit") and leads its own group withprocess_group(0). One backgrounded by an unmarked child keeps that child's pipe: its child's wait, and then the CLI's exit, each wait for it for 2s at most, and then it dies when it next writes.fg: redrawn at the size it was drawn for, else cleared for its next frame, which reads the size anew.copy_output(a no-op while a capture copied), the windows where a CLI print racing a screen switch was copied twice or not at all, and CLI output stalling on a capture's pipe. The capture of fds 1 and 2 remains only for stray writers (code writing to the descriptors directly, a panic's message) and children given the CLI's own stdout.ctx.hooks.idle(fn)runs about every 100ms while the task waits on a child or sleeps.SURFACE_CLIwithoutSURFACE_DASHBOARDis kept out of the screen and dumped in its place.Known limitations:
ansi.unlinkedis linked again in the dump and in the Console's first lines:output.ansikeeps colour, not those markers.fg's by pty tests and goldens.dup2over fd 1 or 2 also waits for a write blocked on it. A write by the build console, the flush of std's stdout buffer, or a telemetry sink, blocked on a stalled stdout, can therefore hold up a take, release, Ctrl+Z orfg, with the screen's lock held, until that destination drains. Forwarders write through descriptors of their own and don't cause this.output.logtwice or not at all: a child's line written into a stopped capture at the instant offg.aspect run's program keeps the CLI's own stdin, stdout and stderr, as before: its output is not inoutput.log.resetputs the terminal right.QUESTION? y) shows again as the files have it (QUESTION? ANSWERED). Nothing is lost and no row is erased.#1197 gives a feature the console side:
output_display = "none";build.output_feed();BazelTrait.output_framehooks.This PR adds the terminal side and the feature.
ctx.std.term:take()gives the controlling terminal to a feature as a screen. The screen has:screen.key(); Shift+arrows are named too, and oncemouse(True)the wheel and the left button's presses, drags and releases with their cell (mouse-press:<col>:<row>; released with the screen);size();write(), which draws a frame in one write;interrupt(), which does what Ctrl+C does;interrupts(False), which turns Ctrl+C into a key.Ctrl+C still signals by default. While the screen is held, the CLI's own output goes to the screen through one ordered channel, and the process's stdout and stderr are captured, for stray writers and children given the CLI's stdout.
screen.output()hands them to the feature, andrelease()writes each back to its own stream. A child still holding the capture pipe gets its later writes copied through. A held screen is released:wait()fails;ctx.std.fs.try_read_tail(path, max_bytes): a file's last bytes, from a line's start (a character's when no whole line fits), and how many were left out; None on any I/O error. For a failing test's log, whose end is where its failure is.ctx.std.re: regular expressions in Rustregexsyntax, linear-time whatever the pattern.compile(pattern, case_sensitive =, whole_word =)gives aPatternwithsearch,filter(lines),replace(text, repl)andhighlight(text, before, after), each one call for a whole frame's lines.check(pattern)returns the error, since Starlark has notry.The feature is AXL (
feature/dashboard.axl) on top of the runtime pieces below.[n / m]actions. Running actions, oldest first, yellow past a minute and red past five;Running (N)counts from Bazel's status line, so a remote build's hundreds of actions are counted though Bazel lists only 8. A Results pane with target and test counts, cache hits from their sources of truth (actions' from the compact execution log, tests' from their results), and the failures counted. Each results page the invocation has as an OSC 8 hyperlink: the Aspect Build Results page the CLI streams to, and the BES page Bazel streams to itself with--bes_results_url(OpenInvocation'sresults_pagesbuilds both).test.log, its end when long. A test log a remote cache names bybytestream://is found in the output tree once the test's summary has come; before that the view says so rather than guess, and updates when it comes.]/[step to the next or previous failure, its log shown, from anywhere; Esc goes back to what a log or file was opened from.--dashboard:actions=all(which adds--build_event_publish_all_actions),aswitches the list to the actions that succeeded and wrote output, browsed the same way.less-style, none needing a key a MacBook lacks (no PgUp, Home, F-keys or Option): ↑/↓ ork/j; Shift+↑/↓,u/dand Ctrl+U/D half the console; Space/ball of it; Shift+K/J(or Home/End) oldest and following; the mouse wheel, three lines a turn, the screen taking the mouse so the terminal never scrolls up past it (mor--dashboard:mouse=falsegives it back to the terminal, its wheel then sent as ↑/↓). Scrolled up, the console counts the lines that arrive (12 new, J to follow); that state (following, lines up) sits at the right end of the tab border, bold in the accent colour, apart from the tabs.zgives the console the whole screen./opens a regex bar that jumps as you type to the newest match at or above the view, marks and centres it, and highlights every match;n/Nstep older and newer, and Esc clears it and goes back to where the bar opened. Tab in the bar filters to the matching lines instead. Smart case: a capital in the query matches case, and Ctrl+T (or Alt+C) forces it; Ctrl+B (or Alt+W) whole words; Ctrl+W (or Alt+Backspace) deletes a word. A paste types into the bar on one line.ecycles the console through all lines, errors and warnings, errors only. Scrolling,eand search work on a log as on the console.? keys;?shows them all. Esc closes the innermost of the bar, the list's focus and a log.qcancels.q, Enter or Esc with nothing open, or Ctrl+C (read as a key there, so it doesn't cancel a task that has already ended); its keys row saysDone ✔ · q, Enter or Esc to leave.--dashboard:stay=failurestays only when something failed and otherwise counts down 10 seconds and leaves;neverleaves at once; a non-terminal stdin leaves at once, as does a task that failed before any build. The scrollback then gets the task's output, Bazel's errors, each failure with its log's path, and the raw log's path. In the macOS Terminal, the links tip shows after it when the scrollback has written-out file links.Inspirations
less-style keys without PgUp/PgDn/Home/End, the jump-to-bottom count of new lines, and a mouse the screen takes: its own selection, copied on release, and links opened on a click.lessand vim:u/d, Ctrl+U/D as half a page,/withn/N, and&-style filtering (Tab in the bar).?overlay; lazygit's zoom of one pane.What building it turned up
build.interrupt()andbuild.cancellation.cancel(), and so did plain bazelisk: both signalled the spawned pid alone. fix(bazel): interrupt the real Bazel client behind bazelisk or a wrapper #1695 fixed that on main: a Bazel child's signals now go to its whole process tree.screen.interrupt()still signals the CLI's own group, as Ctrl+C does, since it cancels the run, not only the build.poll()doesn't support/dev/tty, so the terminal usesselect(). feat(bazel): process Bazel's console through stages, on by default #1197 handles the console side: Bazel lists running actions only on a terminal, it erases its progress area one row at a time, and the raw log is the only full copy when nothing is shown.wait(). A task that drains a build's events itself without callingrun_output_hooks()(delivery, for example) shows nothing until itswait(), and work that blocks the thread after the build (exec log, BES sinks) leaves the last frame up. A host-side render loop would fix both.ask) compete with the screen for keys.len()counts code points, not columns.post_taskhooks run before the task is timed.build_eventhook does.wait().output_feed()andscreen.output()lines have escapes stripped once the line has ended (so one split across reads is whole), a carriage return's redraw resolved as a terminal shows it, and every other control character but a tab dropped. Each line's OSC 8 links come beside it as character spans (output_feed()["links"],screen.output(with_links = True)): the console links a hidden build's output too, as it does a terminal's, with no URL written out beside a link, so the screen opens the same links without finding them again.take()refuses, andstd.term.size()is None, while the CLI is not the terminal's foreground job, where changing the terminal's modes would stop it (SIGTTOU); the example then shows Bazel's console as usual.pbcopy,wl-copy,xcliporxsel. A click on a link opens it withopen/xdg-open, a file in the editor--console:file-hyperlink-formatnames, at its line. Onlyhttp(s)and those editors' schemes are opened, since any tool's output can write a link; any other (file://), and any in an SSH session, is copied instead. The console's links are drawn underlined, and as OSC 8 for a terminal given the mouse back (m), wherescreen.wheel_keys(True)sends its wheel as ↑/↓ (alternate scroll,?1007);release()puts that mode back as the terminal had it (asked with DECRQM).screen.pastingsays a paste is still arriving in pieces.bazel-out/_tmp/actions/stdout and stderr as the build goes on, so a log the screen showed could be gone when looked at again. Failed actions' logs are now kept in the task history by default (BazelTrait.keep_action_logs = "failed", hard links), and the keep sink publishes each action's kept paths as it links them (build.kept_action_log(primary_output)), which the log view reads first. A log gone from both says so, and suggests--history:action-logs=failedwhen keeping is off.--history:action-logsand--history:test-logsgainauto, the default (config's choice), sononenow turns keeping off. Since keeping reads the build event stream, everyaspect buildandaspect testnow has one (the Artifact Upload feature already subscribed on most runs).TERMdumb or unset or under 40x12, saying why on stderr.--show_timestamps'd (which also hid the bar and the cache tally),TIMEOUT:and a test summary'sTIMEOUT; a tool's lines under anERROR:take its kind, soeshows a compiler's diagnostic. Each line is classified once.Elapsed time,Build completed; its first 5 and last 40 lines,Executed N out of M testsamong them), andaspect history show <id>.wcuts them.INFO: Fromand "… +N lines", as Claude Code folds a tool's output; Ctrl+O shows them all.e, and its "N new" count names the errors among them.q, Enter or Esc during its countdown leave at once.~that says it passed on a later attempt, counted apart, listed in the scrollback under their ownFlaky:and no longer stopping the success countdown; a timeout says after how long.?2026, inscreen.write()), and the idle finished screen reads a key a second; Ctrl+L redraws.std.term's) deletes a word, and whole words are Ctrl+B (or Alt+W).yandpcopying a repro and a log's path; a click choosing a failure row, and the wheel scrolling the pane under the pointer; failed targets told from those a failed dependency blocked (aspect's summary and the JSON alike); an inline mode (the dashboard in the bottom rows, the rest in the terminal's own scrollback).qsignals the CLI's whole process group, which a wrapping script or pipeline shares.Changes are visible to end-users: yes
Searched for relevant documentation and updated as needed: yes (the plugins README;
std.term,std.reandstd.fs.try_read_tailare documented in their Rust docstrings; a docsite page follows)Breaking change (forces users to change their own code or config): no (
--history:action-logs=noneand--history:test-logs=nonenow keep none rather than leaving config's choice, whichautonow does)Suggested release notes appear below: yes
AXL:
ctx.std.term.take()gives a feature the terminal as a full screen: the alternate screen, keys read without echo (pastes, the wheel, Shift+arrows), its size, and frames drawn in one write. The process's stdout and stderr are captured while it is held and replayed when it is given back, which happens on every way out: the run's return, a forced exit, a panic, a failing hook, a crash.AXL:
ctx.std.recompiles linear-time regular expressions (Rustregexsyntax) with case, whole-word,filter,replaceandhighlight.AXL:
ctx.std.fs.try_read_tail(path, max_bytes)reads a file's last bytes from a line's start.AXL:
screen.mouse(True)reports the left button's presses, drags and releases as keys (mouse-press:<col>:<row>…), andbuild.output_feed()andscreen.output(with_links = True)give each line's links as character spans, so a full-screen feature can select text and open the console's links itself.The console names each failed action's kept log: an
INFO: <label> <mnemonic> stderr: <path>line as the history keeps it (written where Bazel is not drawing its progress area), andfull stderr: <path>under the error in the end-of-build recap.Each task's history folder gets
output.log: the task's whole output as it was shown, colour stripped and secrets redacted.The dashboard: a click on a file's path shows the file in place (a peek of the whole file, syntax-highlighted, the line marked),
oopens the log or file in your editor andOpicks another (with how to keep it inconfig.axl); a target not built because a dependency failed readsblocked by :brokenand opens what blocks it; links light up under the pointer; a double click selects and copies a word; Page Up/Down and Option/Alt+arrows scroll.AXL:
ctx.std.syntax.highlight,ctx.std.fs.try_read_lines, andctx.std.io.editor(),editors(),editor_url()andeditor_target().The dashboard's main pane has tabs: the console, the failures, build metrics (cache hits by the execution log), the invocation's details and tips.
The dashboard's colours come from the theme (feat(console)!: themes for every colour the CLI draws #1730): borders, titles, the keys row, tabs, hover, selection, search matches (
search.currenton the current row), the marker, scrollbar, progress and thestatus_bartop bar. Bazel's lines colour only their label, by the theme'sbazel.*roles, or as Bazel does with"bazel": "tool". Taking the screen asks the terminal its background (OSC 11), so the background-painted roles get their fixed colours whereCOLORFGBGis unset (Terminal.app, VS Code).--dashboard:actions=allasks withpublish_all_actions, so the extra action events reach the task, not its BES sinks (fix(bes): keep the actions the CLI asks Bazel for out of downstream sinks #1729).The dashboard ships with the CLI as the
Dashboardfeature, off by default:--dashboard:enabled=true.The dashboard's console shows the task's output from its start, and on exit the scrollback gets that console as shown, then the failures with their kept logs, the counts and
aspect history show <id>.cargo buildcompiles the AXL interpreter optimized, so a debug build's full screen keeps up (a frame 71ms to 1ms).Failed actions' stdout and stderr are kept in the task history by default (
--history:action-logs=noneturns it off).--history:action-logsand--history:test-logsdefault toauto, config's choice;nonenow means keep none.AXL:
build.kept_action_log(primary_output)gives the logs the history has kept so far of one action.screen.write()sends each frame as one synchronized update (?2026), which terminals that know it draw whole.The dashboard stays off under a coding agent, wraps long lines, folds a successful action's output (Ctrl+O shows it), and leaves Bazel's own ending in the scrollback.
The dashboard takes the mouse: the terminal no longer scrolls past it, a drag selects and copies, and a click opens a URL or a file (in your editor).
Test plan
The integration tests keep every CLI they spawn out of the developer's task history and cache: the first
aspect_cli()in a test process pointsASPECT_HISTORY_DIRandASPECT_CLI_CACHEat temp folders of the test binary's own (one per binary, reused run to run), which a child that clears its environment gets back throughbase_env().New test cases added:
std.re: case, whole words, an alternation kept inside the word boundaries, and an invalid pattern's message;n/Nto either end, none found, Esc going back to where the bar opened: following, scrolled up, held on a match, from the top page after Shift+K, across a retry), the current match kept on its line and in view as lines arrive untilG, an empty query counting nothing, filtering with Tab, smart case (escapes, hex digits, flags and group names aside), toggles, a pattern still being typed,checkagreeing withcompile's options, Esc+key replayed as two keys, a paste on one line without control characters (ignored with the bar closed), highlighting that never lights the padding, and the bar's width;open), copied instead over SSH, and a drag reversed and copied (pbcopy, OSC 52 once) without the pane's border;?overlay (full screen, scrolled by ↑↓ and the wheel, any other key closes it and does nothing else), Tab andznever leaving a hidden list focused, the cache row leaving the list a row on a short terminal, the countdown over an open bar, the keys row's width, the countdown row,z,m,u/dand the wheel, new lines counted while scrolled up, the cache tally, running actions' ages and order, and the actions list (a, its own choice, Enter and]);bytestream://test log mapped into the output tree (last and earlier attempts, shards, unknown counts), the log view (escapes stripped, stderr and stdout divided, a cut log, a log not on the machine), Tab, Enter,]/[and the list's rows and width;std.fs.try_read_tail: a whole file, a cut at a line's start, a missing file;TERMand a tiny terminal; line kinds (indented, timestamped, timeouts, a diagnostic under itsERROR:); the 20,000-line cap and its count; the scrollback's report; small layouts; the countdown's keys; Ctrl+L; a search jump with lines wrapped and from a folded view; the cap's trim; the closing block's head and tail; flaky tests in the scrollback; Alt+Backspace and the leave sequence (term.rs); wrapping and a wrapped line's copy; flaky and timed-out rows; the critical path and slowest actions; folding; the search bar's keys; a synchronized frame (term.rs).Golden tests: the visible frames of
renderfor a running build, finished success and failure, the Failures tab with a log, the Tips tab, a narrow and a short terminal, and the keys overlay (aspect dev test-dashboard --updaterewrites them); and the bytes a take and release, a screen held at exit, Ctrl+Z andfg, a failure and Ctrl+C under a screen write to a pty (UPDATE_GOLDEN=1rewrites them).take()/release()swap the process's own stdout and stderr, so pty tests (child_output_test) and the harness below cover them rather than unit tests running in parallel.Manual testing: the command above in a terminal, under a 100x30 PTY harness:
[n / m];eandqtyped into the screen;?, the wheel, a search withn,z, andawith--dashboard:actions=allshowing an action's log;A redirected run with the flag on prints plain output.
Manual testing of the DX pass, under a pyte PTY harness against real Bazel:
CLAUDECODE=1refuses and the build finishes by itself; 40x10 refuses, 40x12 and 80x24 draw whole, a resize to 40x10 keeps the console and the keys row; a failing demo's scrollback ends with Bazel's own block and the history's copy of the log; a 12,000-line flood folds,greaches the top, a long line wraps to its end, andeshows the diagnostic.🤖 Generated with Claude Code