A single Console IO type obscures direction and syscall descriptors.
Verification and traceability
Platform spec article
Verification and traceability
Spec standingStandard
-
stdin/stdout/stderr use separate System modules.
Context
Decision
Rule Detail Modules System.Input,System.Output,System.ErrorForbidden Monolithic console IO type for standard streams Consequences
Each module binds one
StandardStreamdescriptor; cross-stream APIs stay separate.Verification anchors
packages/runtime/src/System/Input.bd,Output.bd,Error.bd. -
Syscall write failures panic; reads surface Result.
Context
v1 write helpers are infallible at the type level; read paths need explicit error handling.
Decision
Rule Detail Write Write/WriteLinemust panic onWriteWithfailureRead Read/ReadLinereturnResult<string, SyscallError>Consequences
Diagnostics for write failures use fixed panic strings; callers cannot catch write errors in Beskid v1.
Verification anchors
Corelib stream tests; syscall integration in
beskid_runtime. -
WriteLine appends a single LF byte sequence.
Context
Cross-platform hosts may translate line endings below the Beskid API.
Decision
Rule Detail Ending WriteLinemust append\nonlyWindows Host/platform layer may translate later without API change Consequences
Authors see consistent Beskid source semantics; CRLF is not encoded in corelib strings.
Verification anchors
Output.bd/Error.bdtests; platform IO docs.
- Contracts and edge cases MUST rules for standard stream reads, writes, and error handling.
- Design model Stream module boundaries and syscall descriptor model for standard I/O.
- Examples Standard stream read and write usage patterns.
- Flow and algorithm Read and write algorithms for standard stream helpers.
- Verification and traceability Runtime syscall and corelib anchors for standard stream I/O.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Document verification and traceability for the Console Io Streams feature: role-specific normative detail beyond the feature hub.
Canonical references
Section titled “Canonical references”- Feature hub: Console Io Streams
- Sibling articles in this bundle (design model, contracts, flow, examples, verification)
Detailed behavior
Section titled “Detailed behavior”Source anchors
Section titled “Source anchors”| Path | Role |
|---|---|
compiler/corelib/packages/runtime/src/System/Input.bd | stdin reads |
compiler/corelib/packages/runtime/src/System/Output.bd | stdout writes |
compiler/corelib/packages/runtime/src/System/Error.bd | stderr writes |
compiler/corelib/packages/runtime/src/System/Syscall/ | Descriptor and request types |
compiler/crates/beskid_abi / BUILTIN_SPECS | __syscall_read, __syscall_write |
Tests and runtime checks
Section titled “Tests and runtime checks”- Console package integration tests write styled output via
System.Outputindirectly (FormatMarkdownTests.bd, controls tests). - Syscall behavior is covered by execution/runtime specs and runtime integration tests (see Panic, IO, and syscalls).
Traceability
Section titled “Traceability”Changes to IO-001–IO-006 must update the informative docs under compiler/corelib/beskid_corelib/docs/System/ when public behavior changes.
Verification
Section titled “Verification”See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Parent feature hub and Terminal and console area