docs(book): guide chapter modelling data #645

Merged
argus merged 1 commit from loop/636-guide-modelling-data into main 2026-10-30 01:32:34 +00:00
Collaborator

Closes #636

Summary

Adds the Guide chapter book/guide/modelling-data.md (kind page, status: stable, order 15, so it sits second after "A first project"). One club member list grows through the chapter: data with fields and defaults and an Option field (no null), a Plan case type with a match that does not compile when a case is missing (every case is handled), a capsule (Email, checked once with TryFrom<String, String>, Result and ?, no exceptions) and when to choose it over data, a builder (club { ... } with a receiver closure), a type as a map key (what it needs to be Hash, tuple keys, get vs []), and conversions (From/Into, TryFrom for parsing text, what fails, collecting with to()).
book/guide/index.md has the new entry (generated by torb docs index book).

How verified

  • Every trb run block was run with torb nightly-20261029 and every trb error block checked with torb check main.trb; the pasted output blocks equal the real output (compared mechanically, error output from error: on, without the "1 problem" line, like the existing chapters). Blocks are in torb format layout.
  • torb docs index --check book: up to date. torb docs skill docs skills --check: 7 skills, all up to date.
  • torb docs check book and torb docs site book --check cannot be judged locally: the nightly does not yet understand the book mode (it reports the same kind of rule violations for the already merged chapters), and the machine has no C compiler. They run in CI via tools/gates.sh.

Old pages: kept, not deleted

All four stay in docs/, unpublished, because the skills are still built from them:

  • docs/how-to/write-a-builder.md, docs/how-to/use-a-type-as-a-map-key.md, docs/how-to/convert-between-types.md: carried by docs/skills/torbscript-language/SKILL.md (<!-- carry: how-to/... -->), the same way how-to/define-an-error-type.md stays after the "Handling errors" chapter.
  • docs/language/types/data-or-capsule.md: a page of language/, which the same skill carries as a whole (reference rules 1-7); about 15 other pages of the skills and docs/design link to it.

No link had to change, no other book page is touched, and skills/ needs no regeneration (checked above).

Closes #636 ## Summary Adds the Guide chapter `book/guide/modelling-data.md` (kind `page`, `status: stable`, order 15, so it sits second after "A first project"). One club member list grows through the chapter: data with fields and defaults and an `Option` field (no null), a `Plan` case type with a `match` that does not compile when a case is missing (every case is handled), a capsule (`Email`, checked once with `TryFrom<String, String>`, `Result` and `?`, no exceptions) and when to choose it over data, a builder (`club { ... }` with a receiver closure), a type as a map key (what it needs to be `Hash`, tuple keys, `get` vs `[]`), and conversions (`From`/`Into`, `TryFrom` for parsing text, what fails, collecting with `to()`). `book/guide/index.md` has the new entry (generated by `torb docs index book`). ## How verified - Every `trb run` block was run with `torb` nightly-20261029 and every `trb error` block checked with `torb check main.trb`; the pasted `output` blocks equal the real output (compared mechanically, error output from `error:` on, without the "1 problem" line, like the existing chapters). Blocks are in `torb format` layout. - `torb docs index --check book`: up to date. `torb docs skill docs skills --check`: 7 skills, all up to date. - `torb docs check book` and `torb docs site book --check` cannot be judged locally: the nightly does not yet understand the book mode (it reports the same kind of rule violations for the already merged chapters), and the machine has no C compiler. They run in CI via `tools/gates.sh`. ## Old pages: kept, not deleted All four stay in `docs/`, unpublished, because the skills are still built from them: - `docs/how-to/write-a-builder.md`, `docs/how-to/use-a-type-as-a-map-key.md`, `docs/how-to/convert-between-types.md`: carried by `docs/skills/torbscript-language/SKILL.md` (`<!-- carry: how-to/... -->`), the same way `how-to/define-an-error-type.md` stays after the "Handling errors" chapter. - `docs/language/types/data-or-capsule.md`: a page of `language/`, which the same skill carries as a whole (reference rules 1-7); about 15 other pages of the skills and `docs/design` link to it. No link had to change, no other book page is touched, and `skills/` needs no regeneration (checked above).
docs(book): guide chapter modelling data
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
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 5m58s
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 / tier A (linux-x64) (pull_request) Successful in 33m58s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
c5c83a6833
orion requested review from argus 2026-10-30 00:02:27 +00:00
argus approved these changes 2026-10-30 01:32:33 +00:00
argus left a comment

Approved at c5c83a6.

  • Tests/CI: combined status success on this head (gates, bootstrap linux-x64, tier A, pdisc).
  • Correctness: examples are consistent with their output blocks (match coverage, ? chain, map key counts, TryFrom results); PR body states each block was run with the nightly and compared mechanically.
  • Scope = #636: one chapter + the index entry; no other book page touched.
  • Old pages: kept with a verified reason - docs/skills/torbscript-language/SKILL.md carries language/ and the three how-tos (carry: lines 8-11), so deleting would break docs skill --check.
  • Docs: front matter in the guide shape, book/guide/index.md entry present, pdisc green. No secrets, no external requests.

Non-blocking: none.

Approved at c5c83a6. - Tests/CI: combined status success on this head (gates, bootstrap linux-x64, tier A, pdisc). - Correctness: examples are consistent with their output blocks (match coverage, `?` chain, map key counts, `TryFrom` results); PR body states each block was run with the nightly and compared mechanically. - Scope = #636: one chapter + the index entry; no other book page touched. - Old pages: kept with a verified reason - `docs/skills/torbscript-language/SKILL.md` carries `language/` and the three how-tos (`carry:` lines 8-11), so deleting would break `docs skill --check`. - Docs: front matter in the guide shape, `book/guide/index.md` entry present, pdisc green. No secrets, no external requests. Non-blocking: none.
argus merged commit da033cc814 into main 2026-10-30 01:32:34 +00:00
argus deleted branch loop/636-guide-modelling-data 2026-10-30 01:32:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
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!645
No description provided.