std: classify every public error type by CLOSED-TRAITS decision 7.3 #744

Open
opened 2026-11-13 12:39:36 +00:00 by orion · 2 comments
Collaborator

Context

Decision 7.3 of docs/design/CLOSED-TRAITS.md says a public type with cases never grows, and what must grow is a newtype. The record classifies the error types it knew. The audit finds public error types of std the record does not name, two whose case count drifted since, and three shapes of error side by side (plain cases, a record with a public *Problem type, a newtype with a private kind).

Not named in the record: CliError (8 cases, std/cli/src/error.trb:13), ResourceError (4, std/resource/src/error.trb:27), StorageFailure (5, std/storage/src/storage.trb:13), CipherError (2, std/cipher/src/error.trb:7), FramingError (2, std/stream/src/reader.trb:36), PoolError (2, std/task/src/pool.trb:30), JsonPointerProblem (7, std/json/src/pointer.trb:140), PatchProblem (7, std/json-patch/src/error.trb:6).

Drifted: SignatureError has 6 cases (the record says 4, std/signature/src/error.trb:7), UriError has 12 (the record says 11, std/uri/src/error.trb:8).

Source

  • Cleanup audit 2026-11 (#742), finding F5; the report is docs/project/2026-11-cleanup-audit.md.
  • CLOSED-TRAITS.md 7.2 and decision 7.3; step 7.3 of #713.

Goal

The table of 7.3 names every public type with cases that std exports as an error, each with one verdict: frozen (its cases are complete by construction) or newtype (it mirrors an open set: an operating system, a protocol, a format that gains codes). After this issue the conversions of step 7.3 of #713 are a closed list.

Design record point

docs/design/CLOSED-TRAITS.md 7.2, decision 7.3 (rules 1 to 5), 9.4 (the last row).

Acceptance criteria

  • A script or test lists every public type with case members under std/*/src whose name ends in Error, Failure or Problem, and the list is in the PR description
  • The table of 7.3 has a row for each of them with the verdict and one sentence of reason; the counts of SignatureError and UriError match the source
  • The record states which of the three error shapes a new package uses, and when the record-with-Problem shape is right
  • Step 7.3 of #713 lists every type with the verdict newtype, one checklist line per package
  • No source under std/ or compiler/ changes in this PR

Dependencies

None. The naming question (StorageFailure beside *Error) is an owner decision listed in the audit report; this issue records the rule and does not rename.

Seed

None (documentation only).

Size

One PR, one commit.

## Context Decision 7.3 of `docs/design/CLOSED-TRAITS.md` says a public type with cases never grows, and what must grow is a newtype. The record classifies the error types it knew. The audit finds public error types of `std` the record does not name, two whose case count drifted since, and three shapes of error side by side (plain cases, a record with a public `*Problem` type, a newtype with a private kind). Not named in the record: `CliError` (8 cases, `std/cli/src/error.trb:13`), `ResourceError` (4, `std/resource/src/error.trb:27`), `StorageFailure` (5, `std/storage/src/storage.trb:13`), `CipherError` (2, `std/cipher/src/error.trb:7`), `FramingError` (2, `std/stream/src/reader.trb:36`), `PoolError` (2, `std/task/src/pool.trb:30`), `JsonPointerProblem` (7, `std/json/src/pointer.trb:140`), `PatchProblem` (7, `std/json-patch/src/error.trb:6`). Drifted: `SignatureError` has 6 cases (the record says 4, `std/signature/src/error.trb:7`), `UriError` has 12 (the record says 11, `std/uri/src/error.trb:8`). ## Source - Cleanup audit 2026-11 (#742), finding F5; the report is `docs/project/2026-11-cleanup-audit.md`. - CLOSED-TRAITS.md 7.2 and decision 7.3; step 7.3 of #713. ## Goal The table of 7.3 names every public type with cases that `std` exports as an error, each with one verdict: frozen (its cases are complete by construction) or newtype (it mirrors an open set: an operating system, a protocol, a format that gains codes). After this issue the conversions of step 7.3 of #713 are a closed list. ## Design record point `docs/design/CLOSED-TRAITS.md` 7.2, decision 7.3 (rules 1 to 5), 9.4 (the last row). ## Acceptance criteria - [ ] A script or test lists every `public type` with `case` members under `std/*/src` whose name ends in `Error`, `Failure` or `Problem`, and the list is in the PR description - [ ] The table of 7.3 has a row for each of them with the verdict and one sentence of reason; the counts of `SignatureError` and `UriError` match the source - [ ] The record states which of the three error shapes a new package uses, and when the record-with-`Problem` shape is right - [ ] Step 7.3 of #713 lists every type with the verdict newtype, one checklist line per package - [ ] No source under `std/` or `compiler/` changes in this PR ## Dependencies None. The naming question (`StorageFailure` beside `*Error`) is an owner decision listed in the audit report; this issue records the rule and does not rename. ## Seed None (documentation only). ## Size One PR, one commit.
Author
Collaborator

[loop:torbscript] claim intake by session:loop-torbscript-20261114-0802 until 2026-11-14T10:02:00Z

[loop:torbscript] claim intake by session:loop-torbscript-20261114-0802 until 2026-11-14T10:02:00Z
Author
Collaborator

[loop:torbscript] refine: single task, no split. Checked against docs/design/CLOSED-TRAITS.md: decision 7.3 (rules 1-5) and the 7.3 table ("What it means for std") match the issue; the table currently lists SignatureError with 4 cases and UriError with 11 (the issue reports 6 and 12 from source), and has no rows for the eight unnamed types. Section 9.3 holds the "Beside the phases" newtype list that step 7.3 of #713 mirrors. Scope is documentation only (one PR, one commit), no seed impact, no dependencies; #713 and #742 are open and the audit report exists at docs/project/2026-11-cleanup-audit.md. No duplicate among open issues.

[loop:torbscript] decided by the loop: the per-type verdicts (frozen vs newtype) are a technical classification under the already owner-decided rule 7.3 (newtype where the set mirrors an OS, protocol or format that gains codes; frozen where cases are complete by construction), so no owner question. The StorageFailure naming stays out of scope as the issue states. Implementer note: verify each case count against source when writing the table, since the issue figures may drift again.

next: implement (label ready set)

[loop:torbscript] release intake by session:loop-torbscript-20261114-0802

[loop:torbscript] refine: single task, no split. Checked against `docs/design/CLOSED-TRAITS.md`: decision 7.3 (rules 1-5) and the 7.3 table ("What it means for `std`") match the issue; the table currently lists `SignatureError` with 4 cases and `UriError` with 11 (the issue reports 6 and 12 from source), and has no rows for the eight unnamed types. Section 9.3 holds the "Beside the phases" newtype list that step 7.3 of #713 mirrors. Scope is documentation only (one PR, one commit), no seed impact, no dependencies; #713 and #742 are open and the audit report exists at `docs/project/2026-11-cleanup-audit.md`. No duplicate among open issues. [loop:torbscript] decided by the loop: the per-type verdicts (frozen vs newtype) are a technical classification under the already owner-decided rule 7.3 (newtype where the set mirrors an OS, protocol or format that gains codes; frozen where cases are complete by construction), so no owner question. The `StorageFailure` naming stays out of scope as the issue states. Implementer note: verify each case count against source when writing the table, since the issue figures may drift again. next: implement (label `ready` set) [loop:torbscript] release intake by session:loop-torbscript-20261114-0802
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#744
No description provided.