Expand description
SRD-87 Output Channel — the single typed terminal-output conduit.
Push 1 lands the trait, the op-output bucket, and a test-capture
impl. Every adapter op line submits through
OutputChannel::op_output; the installed impl alone decides where
the bytes land. The remaining buckets (log / status / raster)
and the consolidation of RunObserver + DisplaySink arrive in
later pushes (SRD-87 §11/§13).
The op-output channel is selected once per run from the run’s
context (silent_console, is_tty) — replacing the prior
console_reserved_for_adapter global flag that op_output consulted
inline. A console-owning adapter (silent_console) and a piped run
both own a raw stdout surface; an interactive dashboard routes op
output through the live display so it composites without the raw-mode
staircase. The console-owning stdout adapter printing nothing on a
TTY (the SRD-87 §2 defect) falls out as a consequence: under the raw
impl the op line is the adapter’s, written to the surface it owns,
never suppressed alongside the diagnostics.
Structs§
- Capture
Channel - Test-capture impl: records every op-output line for assertions and
writes no fd. The SRD-87 §12 surface-agreement / no-bypass tests
install one of these and inspect
Self::op_lines. - Display
Routed Channel - op-output routed through the live display: the active
LogOnlySink/TuiSinkcomposites the line into its scrollback, avoiding the raw-mode staircase. Selected for an interactive dashboard that is not console-owning (tui=terminal/on). - RawStdout
Channel - op-output written raw to the stdout the producer owns, plus a
durable
session.logcapture. Selected for a console-owning adapter on a TTY (it owns the screen) AND for a piped/redirected run (sonmbrs run | grepand> filekeep working). This is the impl that makes a console-owning stdout adapter actually print: the line is the adapter’s, written to the surface it owns, never suppressed with the diagnostics.
Enums§
- Channel
Kind - Which op-output impl a run’s context selects (SRD-87 §10). Factored out so the selection is unit-testable without standing up a surface.
Traits§
- Output
Channel - The single conduit for the one user terminal. Exactly one impl is
installed per run via
install; producers submit to a bucket and only the impl touches an fd. Every method is non-blocking.
Functions§
- clear
- Clear the installed channel (end of run; tests).
- install
- Install the op-output channel for this run (SRD-87 §10 — chosen once per context). Replaces any prior install.
- installed
- The installed channel, if any. SRD-88 — task-local-first: a
concurrent in-process execution that scoped its own channel
(
ExecutionContext.channel) resolves to it; everything else (single-run, bootstrap, tests) falls back to the process-globalCHANNEL(axiom A1, a true no-op until a context scopes one). - log_
to_ surface - Project a diagnostic line to the log bucket (the live terminal).
Called by
observer::log_categorized/the observer impls after the L1 intake (session.log + fold ring) and after thesink_active/min_levelgate has decided the line should reach the live surface (SRD-87 §5). Routes to the installed channel — the sole fd owner — falling back to a direct colorized stderr write before any channel is installed (bootstrap), so behavior is unchanged. - raster
- Submit a raster frame (a self-contained, pre-rendered terminal
canvas) to the channel. Producers — the plotter — call this instead of
print!-ing the frame themselves (SRD-87 §5). Routes to the installed channel (the fd owner), falling back to a raw stdout write before any channel is installed (bootstrap / unit tests), so behavior is unchanged. - select
- Build the op-output channel a run’s context selects.
- select_
kind - The op-output routing a run’s context implies. A console-owning
adapter (
silent_console) owns a raw surface; a piped run (!is_tty) owns the pipe; only an interactive dashboard routes through the display.