Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Flow and algorithm

Platform spec article

Flow and algorithm

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Document flow and algorithm for the Console Io Streams feature: role-specific normative detail beyond the feature hub.

  • Feature hub: Console Io Streams
  • Sibling articles in this bundle (design model, contracts, flow, examples, verification)
  1. Caller supplies a Beskid string (UTF-8).
  2. Module builds WriteRequest with Descriptor::Standard(Stdout | Stderr) and payload bytes.
  3. Syscall.WriteWith invokes __syscall_write.
  4. On Result::Error, module panics with the stable panic string (IO-004).

WriteLine chains two writes; callers should not embed \n in text when using WriteLine unless a double newline is intended.

  1. Loop ReadWith on stdin with a byte limit until:
    • buffer contains \n → return slice before newline, or
    • EOF / error → return Result per syscall mapping.
  2. No ANSI parsing occurs; escape bytes in stdin are returned literally to the caller.

Console.RunTick polls resize and may write control sequences via System.Output after formatting. The tick loop should run on a fiber that owns the terminal UI; see Console terminal events.

Markup or Ansi builders → gated string → System.Output.Write / WriteLine. Capability probing runs before write, not inside Output.bd.

See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.