Diagnostic and cause
LinkHost input failure
- Family
- topaz
- Phase
- run
- Code
TPZ4008- Operation
- std.io.readStdin
Cause and conditions
read reads the remaining standard input bytes through EOF. UTF-8 validity and text preservation follow UTF-8 decoding. It does not append or remove a newline.
No remaining bytes produces an empty string. A later call reads from the stream position left by the earlier call and therefore returns an empty string at EOF. A terminal follows the same EOF rule as redirected input.
The call may wait for input or EOF. Reading consumes input even when the result is later discarded. A host read failure or invalid UTF-8 produces a structured runtime fault at the readStdin call because the function returns a string rather than a Result.
The Topaz 6.0 host input fault is TPZ4008. Its primary location is the readStdin call.
Related rule: Read standard input through its endResponse
Provide valid UTF-8 through a readable input stream. Keep input recovery in the embedding host until structured fault production is available.
Source evidence
- topaz.decision.file-stream-boundaries.1 at
topaz.decisi - compiler/crates/topaz_resolve/src/std/521/io.tpz at
912a5e86e1f9· 4 - compiler/crates/topaz_self_frontend/topaz/emitter/builtins.tpz at
912a5e86e1f9· 174 - compiler/crates/topaz_host_native/src/lib.rs at
912a5e86e1f9· 311 - compiler/crates/topaz_value/src/value/runtime.rs at
912a5e86e1f9· 448 - topaz.decision.host-io-fault-codes.1 at
working-tree
Topaz 6.0.0 specifies this diagnostic during runtime.
The product message wording awaits owner approval.
The pinned SELF source does not emit this diagnostic.
A failed host read or invalid UTF-8 produces a structured runtime fault at the readStdin call. The input operation consumes host bytes and validates their text encoding. The standard input contract defines consumption and valid text preservation.
Response
LinkProvide valid UTF-8 through a readable input stream. Keep input recovery in the embedding host until structured fault production is available.