Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Contracts and edge cases

Platform spec article

Contracts and edge cases

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Document contracts and edge cases 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)
IDRequirement
IO-001System.Input.Read and ReadLine must target stdin only via Descriptor::Standard(Stdin).
IO-002System.Output.Write / WriteLine must target stdout only; System.Error must target stderr only.
IO-003WriteLine(text) must perform Write(text) then Write("\n") as two syscall writes (or equivalent atomic policy documented in runtime).
IO-004Write helpers must panic with a stable message when WriteWith returns an error (System.Output.Write failed / stderr variant).
IO-005Read helpers must not panic on EOF; they return Result with an empty or partial string per syscall contract.
IO-006Modules must not interpret ANSI sequences; validation of escape syntax is the responsibility of ANSI escape model.
FunctionBehavior
Input.Read()Read up to default byte limit from stdin
Input.ReadLine()Read until \n or EOF; line without trailing newline
Output.Write(text)Write UTF-8 bytes to stdout, no newline
Output.WriteLine(text)Write(text) + Write("\n")
Error.Write / WriteLineSame as output, descriptor stderr
  • Redirected stdout: Still writable; TTY detection happens only in Console capabilities, not in System.Output.
  • Binary data: string is UTF-8 text; writing invalid UTF-8 is undefined at the language level—console APIs assume valid strings.
  • Large writes: Syscall layer may chunk; stream helpers do not expose partial-write Result in v1.
  • Concurrent fibers: Multiple fibers writing stdout may interleave bytes; line-safe logging is the caller’s responsibility (channels or mutex).

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