book: Reference, errors (slice of #590) #620

Closed
opened 2026-10-29 21:23:22 +00:00 by orion · 8 comments
Collaborator

Slice of #590 (Reference, part 2), which is a slice of the epic #582. Starts after nothing; #585 is merged. The Guide slices (#587, #588) write book/guide/ and the Reference part 1 slices (#589) write other pages of book/reference/; they are independent of this one and none of them replaces the old pages below. Governing note: book/CONCEPT.md ("How a page is written", "What CI checks"). Touches the seed: no (documentation only; no syntax change, no native, no driver flag, no std name looked up by the compiler).

Goal

Write the Reference page(s) reference/errors.md. Error values and the Error trait, Result, and the error types a program declares. reference/propagating-errors.md (?, option chaining) and reference/panics.md (panics, errors at the top level) are separate slices of #590: link to them only once they are on main. Read like book/reference/bindings.md and book/reference/cases-and-patterns.md (merged in #585): complete for the area, still prose with a real program and its output under every rule.

Replaces in docs/

  • docs/language/errors/index.md
  • docs/language/errors/error-types.md
  • docs/language/errors/the-error-trait.md
  • docs/language/errors/result.md

Acceptance criteria

  • Every page has the kind page, status: stable, front matter in the shape of book/reference/bindings.md (title, summary, order, keywords), and is written as book/CONCEPT.md, "How a page is written", says: the first paragraph says in two to four sentences what the page covers, headings name ideas, prose first, no history words, no internal references (no issue numbers, no links into docs/design, docs/contributing, docs/internals, CONCEPT.md), no Related/Next/See also sections, lists of at most seven items, every section starts with a sentence; links only to book pages that exist on main
  • Every trb run and trb error block is followed by its output block with the real output (a trb error block shows what torb check prints, from error: on); no fragments, no // prints comments
  • Every form, rule and compiler error a reader can hit in the area is on the page, as prose with trb run/trb error examples, not as a template of Syntax/Rules/What this is not; Every compiler error a reader can hit with Result and with implementing Error has a trb error example; the page grows one error type across its sections.
  • The signature features of book/CONCEPT.md that the area touches are shown, not just named
  • book/reference/index.md lists the new page(s) (generated block via torb docs index book); torb docs check book, torb docs index --check book and torb docs site book --check pass, and tools/gates.sh passes in CI
  • The old pages listed under "Replaces in docs/" are deleted in the same PR unless a skill is still built from them (skills are generated by torb docs skill docs skills): for every old page a skill still needs, it stays in docs/ unpublished and the PR description names it and why; the others are deleted together with every link to them, and the skills are regenerated so docs skill --check stays green
  • No other book page is changed except the links that must follow from the deletion; the other Reference slices of #590 are not started

Notes for the implementer

  • Read book/CONCEPT.md, book/reference/bindings.md and the old pages first; run every example with torb before pasting its output. A rule that only the old page states and that you cannot reproduce is checked against the compiler, not copied.
  • Commits: one or two Conventional Commits, for example docs(book): reference errors and, if needed, docs: retire the pages the reference replaces.
  • Size: one PR, 30-40 minutes. Do not write the other Reference pages.

Implementer notes (added in refine)

  • Pages that may be linked, all on main: book/tour/errors.md, book/guide/handling-errors.md, book/std/core.md, book/reference/bindings.md, book/reference/cases-and-patterns.md. Do not link reference/propagating-errors.md, reference/panics.md or any other Reference page that is not on main (book/reference/ holds syntax.md, bindings.md, cases-and-patterns.md and index.md today); torb docs check book fails on a link that does not resolve.
  • Front matter: kind: page, status: stable, order between bindings.md (10) and cases-and-patterns.md (40) is free; pick one that does not collide with the existing pages (syntax.md 5, bindings.md 10, cases-and-patterns.md 40).
  • The four pages under "Replaces in docs/" exist on main. The other pages of docs/language/errors/ (option-chaining.md, panic.md, question-mark.md, top-level-errors.md) belong to the two sibling slices and stay where they are; do not delete or edit them, except links that point at a page this PR deletes.
  • Deleting an old page: the Language skill is built from docs/language/errors/* (skills/torbscript-language/references/language/errors/ holds all eight pages), and about 25 pages of docs/ and the skill references link to the four pages (among them docs/guide/errors.md, docs/how-to/define-an-error-type.md, docs/language/index.md, docs/language/values-and-types/option.md, docs/standard-library/core.md, docs/glossary.md, docs/explanation/why-no-exceptions.md). docs/language/errors/index.md also lists the sibling pages. Precedent: when bindings.md landed, the old bindings page was deleted while docs/language/pattern-matching/* and docs/language/types/var-paths.md stayed for the skills. Decide per page (a page the skill still needs stays in docs/, unpublished, and the PR description names it and why), fix every link to a deleted page, then run torb docs skill docs skills and commit the regenerated skills/ so torb docs skill docs skills --check is green.
  • Run torb docs index book after adding the page so the generated block of book/reference/index.md lists it; do not edit that block by hand.
  • Verifiable by someone else: the page file exists; torb docs check book, torb docs index --check book, torb docs site book --check and tools/gates.sh pass in forge CI; each trb run/trb error block has its output block (asserted by torb docs check); the deleted pages are gone from docs/ and from skills/ (or named in the PR description as kept); git diff --stat shows no file under book/ other than the new page, book/reference/index.md and links that followed from a deletion.
  • Seed: this issue touches no seed (no syntax change, no native, no driver flag, no std name the compiler looks up by string). If an example turns up a compiler bug, file it as its own issue; do not fix it in this PR.
Slice of #590 (Reference, part 2), which is a slice of the epic #582. Starts after nothing; #585 is merged. The Guide slices (#587, #588) write `book/guide/` and the Reference part 1 slices (#589) write other pages of `book/reference/`; they are independent of this one and none of them replaces the old pages below. Governing note: `book/CONCEPT.md` ("How a page is written", "What CI checks"). Touches the seed: no (documentation only; no syntax change, no native, no driver flag, no std name looked up by the compiler). ## Goal Write the Reference page(s) `reference/errors.md`. Error values and the `Error` trait, `Result`, and the error types a program declares. `reference/propagating-errors.md` (`?`, option chaining) and `reference/panics.md` (panics, errors at the top level) are separate slices of #590: link to them only once they are on main. Read like `book/reference/bindings.md` and `book/reference/cases-and-patterns.md` (merged in #585): complete for the area, still prose with a real program and its output under every rule. ## Replaces in `docs/` - `docs/language/errors/index.md` - `docs/language/errors/error-types.md` - `docs/language/errors/the-error-trait.md` - `docs/language/errors/result.md` ## Acceptance criteria - [ ] Every page has the kind `page`, `status: stable`, front matter in the shape of `book/reference/bindings.md` (`title`, `summary`, `order`, `keywords`), and is written as `book/CONCEPT.md`, "How a page is written", says: the first paragraph says in two to four sentences what the page covers, headings name ideas, prose first, no history words, no internal references (no issue numbers, no links into `docs/design`, `docs/contributing`, `docs/internals`, `CONCEPT.md`), no Related/Next/See also sections, lists of at most seven items, every section starts with a sentence; links only to book pages that exist on main - [ ] Every `trb run` and `trb error` block is followed by its `output` block with the real output (a `trb error` block shows what `torb check` prints, from `error:` on); no fragments, no `// prints` comments - [ ] Every form, rule and compiler error a reader can hit in the area is on the page, as prose with `trb run`/`trb error` examples, not as a template of Syntax/Rules/What this is not; Every compiler error a reader can hit with `Result` and with implementing `Error` has a `trb error` example; the page grows one error type across its sections. - [ ] The signature features of `book/CONCEPT.md` that the area touches are shown, not just named - [ ] `book/reference/index.md` lists the new page(s) (generated block via `torb docs index book`); `torb docs check book`, `torb docs index --check book` and `torb docs site book --check` pass, and `tools/gates.sh` passes in CI - [ ] The old pages listed under "Replaces in `docs/`" are deleted in the same PR unless a skill is still built from them (skills are generated by `torb docs skill docs skills`): for every old page a skill still needs, it stays in `docs/` unpublished and the PR description names it and why; the others are deleted together with every link to them, and the skills are regenerated so `docs skill --check` stays green - [ ] No other book page is changed except the links that must follow from the deletion; the other Reference slices of #590 are not started ## Notes for the implementer - Read `book/CONCEPT.md`, `book/reference/bindings.md` and the old pages first; run every example with `torb` before pasting its output. A rule that only the old page states and that you cannot reproduce is checked against the compiler, not copied. - Commits: one or two Conventional Commits, for example `docs(book): reference errors` and, if needed, `docs: retire the pages the reference replaces`. - Size: one PR, 30-40 minutes. Do not write the other Reference pages. ## Implementer notes (added in refine) - Pages that may be linked, all on main: `book/tour/errors.md`, `book/guide/handling-errors.md`, `book/std/core.md`, `book/reference/bindings.md`, `book/reference/cases-and-patterns.md`. Do not link `reference/propagating-errors.md`, `reference/panics.md` or any other Reference page that is not on main (`book/reference/` holds `syntax.md`, `bindings.md`, `cases-and-patterns.md` and `index.md` today); `torb docs check book` fails on a link that does not resolve. - Front matter: `kind: page`, `status: stable`, `order` between `bindings.md` (10) and `cases-and-patterns.md` (40) is free; pick one that does not collide with the existing pages (`syntax.md` 5, `bindings.md` 10, `cases-and-patterns.md` 40). - The four pages under "Replaces in `docs/`" exist on main. The other pages of `docs/language/errors/` (`option-chaining.md`, `panic.md`, `question-mark.md`, `top-level-errors.md`) belong to the two sibling slices and stay where they are; do not delete or edit them, except links that point at a page this PR deletes. - Deleting an old page: the Language skill is built from `docs/language/errors/*` (`skills/torbscript-language/references/language/errors/` holds all eight pages), and about 25 pages of `docs/` and the skill references link to the four pages (among them `docs/guide/errors.md`, `docs/how-to/define-an-error-type.md`, `docs/language/index.md`, `docs/language/values-and-types/option.md`, `docs/standard-library/core.md`, `docs/glossary.md`, `docs/explanation/why-no-exceptions.md`). `docs/language/errors/index.md` also lists the sibling pages. Precedent: when `bindings.md` landed, the old bindings page was deleted while `docs/language/pattern-matching/*` and `docs/language/types/var-paths.md` stayed for the skills. Decide per page (a page the skill still needs stays in `docs/`, unpublished, and the PR description names it and why), fix every link to a deleted page, then run `torb docs skill docs skills` and commit the regenerated `skills/` so `torb docs skill docs skills --check` is green. - Run `torb docs index book` after adding the page so the generated block of `book/reference/index.md` lists it; do not edit that block by hand. - Verifiable by someone else: the page file exists; `torb docs check book`, `torb docs index --check book`, `torb docs site book --check` and `tools/gates.sh` pass in forge CI; each `trb run`/`trb error` block has its `output` block (asserted by `torb docs check`); the deleted pages are gone from `docs/` and from `skills/` (or named in the PR description as kept); `git diff --stat` shows no file under `book/` other than the new page, `book/reference/index.md` and links that followed from a deletion. - Seed: this issue touches no seed (no syntax change, no native, no driver flag, no std name the compiler looks up by string). If an example turns up a compiler bug, file it as its own issue; do not fix it in this PR.
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop), not a duplicate, no owner question, no collision with a design record; documentation only, seed untouched. Links to propagating-errors.md and panics.md only once those are on main. next: refine, start when a slot is free.

[loop:torbscript] intake: in scope (author orion, label loop), not a duplicate, no owner question, no collision with a design record; documentation only, seed untouched. Links to propagating-errors.md and panics.md only once those are on main. next: refine, start when a slot is free.
Author
Collaborator

[loop:torbscript] refine: next: waiting (ready buffer is full, 7 issues are ready; refine resumes when fewer than 4 are ready)

[loop:torbscript] refine: next: waiting (ready buffer is full, 7 issues are ready; refine resumes when fewer than 4 are ready)
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-620-refine until 2026-11-16T12:30:00Z

Reason: #620 is starved (deferred 3 times, orion/infra#2915), so it is started now: a worker slot is free and refine is the next stage.

[loop:torbscript] claim refine by session:loop-torbscript-620-refine until 2026-11-16T12:30:00Z Reason: #620 is starved (deferred 3 times, orion/infra#2915), so it is started now: a worker slot is free and refine is the next stage.
Author
Collaborator

[loop:torbscript] refine: ready. Added an implementer-notes section to the body: 5 linkable pages on main (tour/errors, guide/handling-errors, std/core, reference/bindings, reference/cases-and-patterns), 2 sibling pages not to link (propagating-errors, panics), 4 sibling docs pages that stay (option-chaining, panic, question-mark, top-level-errors), the skill dependency (skills/torbscript-language/references/language/errors/ holds all 8 pages; about 25 docs pages link to the 4 old ones) with the precedent from the bindings slice, the free order range (11-39), checks someone else can run, and the seed statement (touches no seed). Replaces list verified: all 4 files exist on main. Goal and 7 acceptance criteria were already testable and are unchanged.

next: implement (oldest ready first when a slot is free)

[loop:torbscript] refine: ready. Added an implementer-notes section to the body: 5 linkable pages on main (tour/errors, guide/handling-errors, std/core, reference/bindings, reference/cases-and-patterns), 2 sibling pages not to link (propagating-errors, panics), 4 sibling docs pages that stay (option-chaining, panic, question-mark, top-level-errors), the skill dependency (skills/torbscript-language/references/language/errors/ holds all 8 pages; about 25 docs pages link to the 4 old ones) with the precedent from the bindings slice, the free `order` range (11-39), checks someone else can run, and the seed statement (touches no seed). Replaces list verified: all 4 files exist on main. Goal and 7 acceptance criteria were already testable and are unchanged. next: implement (oldest ready first when a slot is free)
Author
Collaborator

[loop:torbscript] release by session:loop-torbscript-620-refine

[loop:torbscript] release by session:loop-torbscript-620-refine
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-620-impl until 2026-11-16T16:10:00Z

Reason: #620 is the focus, now ready, no PR yet, a worker slot is free.

[loop:torbscript] claim implement by session:loop-torbscript-620-impl until 2026-11-16T16:10:00Z Reason: #620 is the focus, now ready, no PR yet, a worker slot is free.
Author
Collaborator

[loop:torbscript] release by session:loop-torbscript-620-impl
implement: PR #835 open (commits 1ed735a, c6bff12), merge gate review requested from Argus; forge CI is pending (runner queue), commit messages, what the change touches and pdisc are green, no job red.
next: waiting (CI running, then the merge gate; a red job gets a fix worker on branch loop/620-reference-errors)

[loop:torbscript] release by session:loop-torbscript-620-impl implement: PR #835 open (commits 1ed735a, c6bff12), merge gate review requested from Argus; forge CI is pending (runner queue), commit messages, what the change touches and pdisc are green, no job red. next: waiting (CI running, then the merge gate; a red job gets a fix worker on branch loop/620-reference-errors)
argus closed this issue 2026-11-16 14:47:25 +00:00
Author
Collaborator

Status (orion): PR #835 merged to main as 81080c0, approved by argus. The merge closed this task. Main CI (ci gates, images site:edge, pdisc) was still pending at 15:55 Berlin, outcome not confirmed. Not in a release yet: the latest tags are nightly-20261116 and v0.1.0-rc.1, and the change is docs-only. Next step: confirm main CI is green, then include it in the next release cut per the release cycle (docs/design/RELEASE.md). No stable release cut in this run.

Status (orion): PR #835 merged to main as 81080c0, approved by argus. The merge closed this task. Main CI (ci gates, images site:edge, pdisc) was still pending at 15:55 Berlin, outcome not confirmed. Not in a release yet: the latest tags are nightly-20261116 and v0.1.0-rc.1, and the change is docs-only. Next step: confirm main CI is green, then include it in the next release cut per the release cycle (docs/design/RELEASE.md). No stable release cut in this run.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#620
No description provided.