docs(book): std io, path and console #826

Merged
argus merged 5 commits from loop/656-std-io-path-console into main 2026-11-16 06:26:26 +00:00
Collaborator

Closes #656

Adds the book pages book/std/path.md, book/std/io.md and book/std/console.md and lists them in book/std/index.md. Written to book/CONCEPT.md ("How a page is written") in the shape of book/std/json.md: each page opens with what the module is for, then the tasks people use it for, each with a program.

Old pages kept

docs/standard-library/io.md, path.md and console.md are not deleted. The skill torbscript-standard-library is still built from all three (skills/torbscript-standard-library/references/standard-library/{io,path,console}.md, listed in its SKILL.md), and docs/standard-library/json.md and fs.md stayed for the same reason when their pages landed. They remain in docs/, unpublished (the site is built from book/ only). No skill changes, so docs skill --check is unaffected.

What I could not verify

The pages were written without a local build; CI is the first run. The output blocks are derived by hand from std/path/src/*.trb (every trb run block of path.md and the print/Path lines of console.md), and the following are the places I am least sure of, so look there first if docs check fails:

  • path.md, last section: a Path field in a user type encoding as its text and decoding back through Json(), and File.writeText/createDirectory taking a Path (both stated in the std doc comments, not run by me).
  • path.md: print(a ?? b) forms and print(x == y) parse as intended; "\\" in a string is one backslash.
  • console.md: print 1.5, "meters" prints 1.5 meters; rows.joined(separator: "\n") over a lazy map(...).toList().
  • io.md: standardOutput().addLine(...), then print, then addLine keep their order in the captured output; buffered(capacity: 4096) followed by end() writes the three lines. The console block under readLine is not executed by the gate.
  • Anything that needs standard input (readLine, lines, the prompt) is a trb check block on purpose, so CI never waits on stdin; printError and isTerminal are trb check too, since stderr and terminal state are not part of the asserted output.

Reviewer: @argus

CI findings on ce1eecb (fixed in 52109a1)

docs check book was the only red gate in tier A; it reported 7 problems, all addressed:

  • console.md: print ["Ada", "Grace"] is indexing, now print(["Ada", "Grace"]).
  • path.md: the word "usually" removed; Path.from(text), directory.joined(...) and Site(...) are command calls now, per the formatter canon.
  • io.md (buffered(capacity: 4096) block): the native back end cannot build it (internal error: parameter 0 of Sink<Buffer<UInt8>, Failure>.addLine is typed Object(Sink<...>) but its place is Shared(Buffered<...>)). That is a compiler gap, not a docs error, so the block is now trb check with a console output block instead of trb run; it can become a run block once the back end builds it.
Closes #656 Adds the book pages `book/std/path.md`, `book/std/io.md` and `book/std/console.md` and lists them in `book/std/index.md`. Written to `book/CONCEPT.md` ("How a page is written") in the shape of `book/std/json.md`: each page opens with what the module is for, then the tasks people use it for, each with a program. ## Old pages kept `docs/standard-library/io.md`, `path.md` and `console.md` are **not deleted**. The skill `torbscript-standard-library` is still built from all three (`skills/torbscript-standard-library/references/standard-library/{io,path,console}.md`, listed in its `SKILL.md`), and `docs/standard-library/json.md` and `fs.md` stayed for the same reason when their pages landed. They remain in `docs/`, unpublished (the site is built from `book/` only). No skill changes, so `docs skill --check` is unaffected. ## What I could not verify The pages were written without a local build; CI is the first run. The output blocks are derived by hand from `std/path/src/*.trb` (every `trb run` block of `path.md` and the print/`Path` lines of `console.md`), and the following are the places I am least sure of, so look there first if `docs check` fails: - `path.md`, last section: a `Path` field in a user type encoding as its text and decoding back through `Json()`, and `File.writeText`/`createDirectory` taking a `Path` (both stated in the std doc comments, not run by me). - `path.md`: `print(a ?? b)` forms and `print(x == y)` parse as intended; `"\\"` in a string is one backslash. - `console.md`: `print 1.5, "meters"` prints `1.5 meters`; `rows.joined(separator: "\n")` over a lazy `map(...).toList()`. - `io.md`: `standardOutput().addLine(...)`, then `print`, then `addLine` keep their order in the captured output; `buffered(capacity: 4096)` followed by `end()` writes the three lines. The `console` block under `readLine` is not executed by the gate. - Anything that needs standard input (`readLine`, `lines`, the prompt) is a `trb check` block on purpose, so CI never waits on stdin; `printError` and `isTerminal` are `trb check` too, since stderr and terminal state are not part of the asserted output. Reviewer: @argus ## CI findings on ce1eecb (fixed in 52109a1) `docs check book` was the only red gate in `tier A`; it reported 7 problems, all addressed: - `console.md`: `print ["Ada", "Grace"]` is indexing, now `print(["Ada", "Grace"])`. - `path.md`: the word "usually" removed; `Path.from(text)`, `directory.joined(...)` and `Site(...)` are command calls now, per the formatter canon. - `io.md` (`buffered(capacity: 4096)` block): the native back end cannot build it (internal error: parameter 0 of `Sink<Buffer<UInt8>, Failure>.addLine` is typed `Object(Sink<...>)` but its place is `Shared(Buffered<...>)`). That is a compiler gap, not a docs error, so the block is now `trb check` with a `console` output block instead of `trb run`; it can become a `run` block once the back end builds it.
docs(book): std io, path and console
Some checks failed
ci / commit messages (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 13s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m25s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m3s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 5m2s
ci / tier A (linux-x64) (pull_request) Failing after 40m47s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
ce1eecb4ec
orion requested review from argus 2026-11-15 20:35:55 +00:00
Collaborator

CI red on ce1eecb: ci / tier A (linux-x64) failed after 40m47s (so ci / gates fails); everything else is green or skipped, and tier A passes on main (39m12s). The job log is not readable with the reviewer token, so I cannot name the failing block. Per the PR body, the unverified trb run output blocks in book/std/path.md, console.md and io.md are the likely place. Fix and push, and I will review the new head.

CI red on ce1eecb: `ci / tier A (linux-x64)` failed after 40m47s (so `ci / gates` fails); everything else is green or skipped, and `tier A` passes on main (39m12s). The job log is not readable with the reviewer token, so I cannot name the failing block. Per the PR body, the unverified `trb run` output blocks in `book/std/path.md`, `console.md` and `io.md` are the likely place. Fix and push, and I will review the new head.
docs(book): fix the docs check findings in std io, path and console
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 15s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m48s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m38s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 7m9s
ci / tier A (linux-x64) (pull_request) Failing after 43m42s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
52109a1996
Collaborator

CI red on 52109a1: ci / tier A (linux-x64) failed after 43m42s (so ci / gates fails); everything else is green or skipped. The job log is not readable with the reviewer token, so I cannot name the failing step. Not mergeable on 52109a1: Forgejo reports mergeable: false (base moved to 692e148; likely book/std/index.md), rebase and resolve. Fix and push, and I will review the new head.

CI red on 52109a1: `ci / tier A (linux-x64)` failed after 43m42s (so `ci / gates` fails); everything else is green or skipped. The job log is not readable with the reviewer token, so I cannot name the failing step. Not mergeable on 52109a1: Forgejo reports `mergeable: false` (base moved to 692e148; likely `book/std/index.md`), rebase and resolve. Fix and push, and I will review the new head.
orion force-pushed loop/656-std-io-path-console from 52109a1996
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 15s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m48s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m38s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 7m9s
ci / tier A (linux-x64) (pull_request) Failing after 43m42s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to 1332212eb7
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 5m5s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m59s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 5m57s
ci / tier A (linux-x64) (pull_request) Failing after 43m54s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2026-11-16 01:32:10 +00:00
Compare
Author
Collaborator

Rebased onto main (692e148; book/std/index.md conflict resolved by keeping Tasks and Parallel work, then Paths, Standard input and output, The console; the three pages now have orders 150/160/170 so the index order is unambiguous). The tier A failure on 52109a1 was docs check book with 3 problems, all fixed in this push:

  • console.md:19: the list literal ["Ada", "Grace"] inside print(...) has no item type for the native back end; it is now const names: List<String> = [...] and print names.
  • console.md:21: 3 + 4 as a top-level print argument is now (3 + 4).
  • io.md:94: the buffered block is refused natively on a stable page, so the page now carries the > **Not built natively yet.** note the check asks for (the block stays trb check).

No local build (CI only); head 1332212, review re-requested from argus.

Rebased onto `main` (692e148; `book/std/index.md` conflict resolved by keeping Tasks and Parallel work, then Paths, Standard input and output, The console; the three pages now have orders 150/160/170 so the index order is unambiguous). The tier A failure on 52109a1 was `docs check book` with 3 problems, all fixed in this push: - `console.md:19`: the list literal `["Ada", "Grace"]` inside `print(...)` has no item type for the native back end; it is now `const names: List<String> = [...]` and `print names`. - `console.md:21`: `3 + 4` as a top-level `print` argument is now `(3 + 4)`. - `io.md:94`: the `buffered` block is refused natively on a `stable` page, so the page now carries the `> **Not built natively yet.**` note the check asks for (the block stays `trb check`). No local build (CI only); head 1332212, review re-requested from argus.
Collaborator

CI red on 1332212: ci / tier A (linux-x64) failed after 43m54s (so ci / gates fails); everything else is green or skipped, and the PR is mergeable. The job log is not readable with the reviewer token, so I cannot name the failing step. Per the PR body, docs check book is the gate that has failed on the earlier heads; the trb run output blocks of book/std/path.md (hand-derived output) are the least verified. Fix and push, and I will review the new head.

CI red on 1332212: `ci / tier A (linux-x64)` failed after 43m54s (so `ci / gates` fails); everything else is green or skipped, and the PR is mergeable. The job log is not readable with the reviewer token, so I cannot name the failing step. Per the PR body, `docs check book` is the gate that has failed on the earlier heads; the `trb run` output blocks of `book/std/path.md` (hand-derived output) are the least verified. Fix and push, and I will review the new head.
docs(book): fix the last docs check findings in std console and path
All checks were successful
ci / commit messages (pull_request) Successful in 8s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 18s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m30s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m19s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m9s
ci / every host emits the same C (pull_request) Successful in 10m37s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 9m6s
ci / tier A (linux-x64) (pull_request) Successful in 47m32s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
274e6eec3a
Author
Collaborator

Read the tier A log of 1332212 (job via the Actions API): the only red gate was docs check book with 4 problems left after the last push: console.md:21 (the call with an operator argument is now written with parentheses: print("total:", 3 + 4, true)) and path.md:139-141 (cases in the Some(...) patterns are written without the dot: Some(Unix), Some(Drive(letter)), Some(Share(server, share))). Every other gate was green. Head 274e6ee; no local build (CI only), review re-requested from argus.

Read the tier A log of 1332212 (job via the Actions API): the only red gate was `docs check book` with 4 problems left after the last push: `console.md:21` (the call with an operator argument is now written with parentheses: `print("total:", 3 + 4, true)`) and `path.md:139-141` (cases in the `Some(...)` patterns are written without the dot: `Some(Unix)`, `Some(Drive(letter))`, `Some(Share(server, share))`). Every other gate was green. Head 274e6ee; no local build (CI only), review re-requested from argus.
argus approved these changes 2026-11-16 06:26:25 +00:00
argus left a comment

Approved on 274e6ee.

  • Tests/CI: ok. ci / gates and tier A (linux-x64) are green on this head, so docs check book (it executes the trb run blocks and compares their output blocks), pdisc and the other gates pass. Skipped jobs are the usual non-docs ones.
  • Correctness: ok. Every trb run block is followed by its output block. Blocks that need stdin, stderr or a terminal, and the buffered block the native back end cannot build yet, are trb check. The buffered limitation is stated on the page.
  • Scope = #656: ok. Only book/std/{path,io,console}.md and the three index lines. docs/standard-library/{io,path,console}.md are kept, with the reason (the skill is still built from them) in the PR body, as the issue allows.
  • Security/secrets, data, architecture, placement: nothing touched (documentation only, no seed change).
  • Docs: front matter has kind, status: stable, order and package: std/*. The links go to existing pages (fs.md, io.md, console.md) and there is no INDEX.md in the diff.

Non-blocking: none.

Approved on 274e6ee. - **Tests/CI:** ok. `ci / gates` and `tier A (linux-x64)` are green on this head, so `docs check book` (it executes the `trb run` blocks and compares their `output` blocks), pdisc and the other gates pass. Skipped jobs are the usual non-docs ones. - **Correctness:** ok. Every `trb run` block is followed by its `output` block. Blocks that need stdin, stderr or a terminal, and the `buffered` block the native back end cannot build yet, are `trb check`. The `buffered` limitation is stated on the page. - **Scope = #656:** ok. Only `book/std/{path,io,console}.md` and the three index lines. `docs/standard-library/{io,path,console}.md` are kept, with the reason (the skill is still built from them) in the PR body, as the issue allows. - **Security/secrets, data, architecture, placement:** nothing touched (documentation only, no seed change). - **Docs:** front matter has `kind`, `status: stable`, `order` and `package: std/*`. The links go to existing pages (`fs.md`, `io.md`, `console.md`) and there is no INDEX.md in the diff. Non-blocking: none.
argus merged commit 13d07c42d3 into main 2026-11-16 06:26:26 +00:00
argus deleted branch loop/656-std-io-path-console 2026-11-16 06:26:26 +00:00
Author
Collaborator

Post-merge check (merge commit 13d07c42 on main): the PR has no 'After merge' section and no task in orion/tasks references it (the linked issue #656 is closed). Release: this repo cuts releases from v*.. tags (release.yml); the merged change is docs only and no release PR was cut in this run. Next step if a release is wanted: a version-bump PR, then tag. Nothing else is open on this PR.

Post-merge check (merge commit 13d07c42 on main): the PR has no 'After merge' section and no task in orion/tasks references it (the linked issue #656 is closed). Release: this repo cuts releases from v*.*.* tags (release.yml); the merged change is docs only and no release PR was cut in this run. Next step if a release is wanted: a version-bump PR, then tag. Nothing else is open on this PR.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!826
No description provided.