docs(closed-traits): classify every public std error type in the table of 7.3 #790

Merged
argus merged 1 commit from loop/744-error-classification into main 2026-11-14 17:44:43 +00:00
Collaborator

Refs #713
Closes #744

Classifies every public error type of std in the table of decision 7.3 of docs/design/CLOSED-TRAITS.md. Documentation only: nothing under std/ or compiler/ changes, no seed impact.

What changes

  • The table of 7.3 gets a row with a verdict and one sentence of reason for each of the eight types it did not name (CliError, ResourceError, StorageFailure, CipherError, FramingError, PoolError, JsonPointerProblem, PatchProblem): all stay types with cases.
  • Counts corrected from source: SignatureError 6 (was 4), UriError 12 (was 11).
  • Changed verdict, for the reviewer: SignatureError moves from "stays" to newtype. It already grew from 4 to 6 cases with P-256 and RSA and mirrors an open set of key and signature formats, so rule 1 would be broken by the next algorithm. Section 7.3 prose and 9.3 now list it with the newtypes. Say so if you would rather keep it frozen.
  • New paragraph "The shape of a new error type": plain cases (default), newtype (open set), record with a public *Problem type (shared context, kinds complete for a fixed specification). StorageFailure is not renamed (open owner question in the audit report).
  • Step 7.3 of #713 (issue body) now lists one checklist line per newtype package, including SignatureError.

Every public type with case members under std/*/src named *Error, *Failure or *Problem

  • CipherError (2 cases, std/cipher/src/error.trb)
  • CliError (8 cases, std/cli/src/error.trb)
  • DnsError (8 cases, std/dns/src/error.trb)
  • ExtractError (2 cases, std/archive/src/extract.trb)
  • FramingError (2 cases, std/stream/src/reader.trb)
  • JsonPointerProblem (7 cases, std/json/src/pointer.trb)
  • OsError (5 cases, std/os/src/error.trb)
  • PatchProblem (7 cases, std/json-patch/src/error.trb)
  • PathError (2 cases, std/path/src/error.trb)
  • PoolError (2 cases, std/task/src/pool.trb)
  • ReadError (7 cases, std/binary/src/error.trb)
  • ResourceError (4 cases, std/resource/src/error.trb)
  • SignatureError (6 cases, std/signature/src/error.trb)
  • StorageFailure (5 cases, std/storage/src/storage.trb)
  • UriError (12 cases, std/uri/src/error.trb)

Produced by an awk pass over std/*/src/*.trb (type headers by name suffix, then indented case lines up to the next type).

Unverified until CI

Docs gates (docs check, format) were not run locally; CI covers them. The verdict for SignatureError is the judgement call above.

Refs #713 Closes #744 Classifies every public error type of `std` in the table of decision 7.3 of `docs/design/CLOSED-TRAITS.md`. Documentation only: nothing under `std/` or `compiler/` changes, no seed impact. ## What changes - The table of 7.3 gets a row with a verdict and one sentence of reason for each of the eight types it did not name (`CliError`, `ResourceError`, `StorageFailure`, `CipherError`, `FramingError`, `PoolError`, `JsonPointerProblem`, `PatchProblem`): all stay types with cases. - Counts corrected from source: `SignatureError` 6 (was 4), `UriError` 12 (was 11). - **Changed verdict, for the reviewer:** `SignatureError` moves from "stays" to newtype. It already grew from 4 to 6 cases with P-256 and RSA and mirrors an open set of key and signature formats, so rule 1 would be broken by the next algorithm. Section 7.3 prose and 9.3 now list it with the newtypes. Say so if you would rather keep it frozen. - New paragraph "The shape of a new error type": plain cases (default), newtype (open set), record with a public `*Problem` type (shared context, kinds complete for a fixed specification). `StorageFailure` is not renamed (open owner question in the audit report). - Step 7.3 of #713 (issue body) now lists one checklist line per newtype package, including `SignatureError`. ## Every `public type` with `case` members under `std/*/src` named `*Error`, `*Failure` or `*Problem` - `CipherError` (2 cases, `std/cipher/src/error.trb`) - `CliError` (8 cases, `std/cli/src/error.trb`) - `DnsError` (8 cases, `std/dns/src/error.trb`) - `ExtractError` (2 cases, `std/archive/src/extract.trb`) - `FramingError` (2 cases, `std/stream/src/reader.trb`) - `JsonPointerProblem` (7 cases, `std/json/src/pointer.trb`) - `OsError` (5 cases, `std/os/src/error.trb`) - `PatchProblem` (7 cases, `std/json-patch/src/error.trb`) - `PathError` (2 cases, `std/path/src/error.trb`) - `PoolError` (2 cases, `std/task/src/pool.trb`) - `ReadError` (7 cases, `std/binary/src/error.trb`) - `ResourceError` (4 cases, `std/resource/src/error.trb`) - `SignatureError` (6 cases, `std/signature/src/error.trb`) - `StorageFailure` (5 cases, `std/storage/src/storage.trb`) - `UriError` (12 cases, `std/uri/src/error.trb`) Produced by an awk pass over `std/*/src/*.trb` (type headers by name suffix, then indented `case` lines up to the next type). ## Unverified until CI Docs gates (`docs check`, format) were not run locally; CI covers them. The verdict for `SignatureError` is the judgement call above.
docs(closed-traits): classify every public std error type in the table of 7.3
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
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 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 4m13s
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 2m36s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 7m40s
ci / tier A (linux-x64) (pull_request) Successful in 46m35s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
d18c3c11ce
Name the eight error types the record did not, correct the case counts of
SignatureError (6) and UriError (12), convert SignatureError to the newtype
list (it grew from 4 to 6 cases), and state which of the three error shapes
a new package uses and when a record with a Problem type is right.
orion requested review from argus 2026-11-14 16:25:41 +00:00
argus approved these changes 2026-11-14 17:44:40 +00:00
argus left a comment

Approved at d18c3c1. Checklist:

  • Tests/CI: docs-only; combined status success on this head (gates, pdisc, bootstrap, tier A, conformance). OK.
  • Correctness: I re-counted cases from source at this head: SignatureError 6, UriError 12, CliError 8, ResourceError 4, StorageFailure 5, CipherError 2, FramingError 2, PoolError 2, JsonPointerProblem 7, PatchProblem 7. All match the table and the PR list. My own sweep of std/*/src for public types with cases named *Error/*Failure/*Problem finds the same 15 types, none missing. OK.
  • Scope = task: exactly #744 (one file, docs/design/CLOSED-TRAITS.md, nothing under std/ or compiler/). The #713 step 7.3 checklist line for SignatureError is in the issue body. OK.
  • Design: the SignatureError verdict change (stays -> newtype) is justified in the PR body (4 -> 6 cases, open set of key and signature formats, rule 1). It is decided on its stated rationale, and 7.3 prose, 9.3 and the table are consistent with it. OK.
  • Security/data/docs/architecture: nothing applicable; no boundary change. OK.

Non-blocking:

  1. [suggestion] std/http/src/h2frame.trb has public type ErrorCode with cases. It mirrors the open HTTP/2 error-code registry, so it looks like a newtype candidate. It falls outside the #744 name-suffix criterion, so consider a follow-up issue or a one-line note in the table.
Approved at d18c3c1. Checklist: - **Tests/CI:** docs-only; combined status success on this head (gates, pdisc, bootstrap, tier A, conformance). OK. - **Correctness:** I re-counted cases from source at this head: `SignatureError` 6, `UriError` 12, `CliError` 8, `ResourceError` 4, `StorageFailure` 5, `CipherError` 2, `FramingError` 2, `PoolError` 2, `JsonPointerProblem` 7, `PatchProblem` 7. All match the table and the PR list. My own sweep of `std/*/src` for public types with cases named `*Error`/`*Failure`/`*Problem` finds the same 15 types, none missing. OK. - **Scope = task:** exactly #744 (one file, `docs/design/CLOSED-TRAITS.md`, nothing under `std/` or `compiler/`). The #713 step 7.3 checklist line for `SignatureError` is in the issue body. OK. - **Design:** the `SignatureError` verdict change (stays -> newtype) is justified in the PR body (4 -> 6 cases, open set of key and signature formats, rule 1). It is decided on its stated rationale, and 7.3 prose, 9.3 and the table are consistent with it. OK. - **Security/data/docs/architecture:** nothing applicable; no boundary change. OK. Non-blocking: 1. [suggestion] `std/http/src/h2frame.trb` has `public type ErrorCode` with cases. It mirrors the open HTTP/2 error-code registry, so it looks like a newtype candidate. It falls outside the #744 name-suffix criterion, so consider a follow-up issue or a one-line note in the table.
argus merged commit 98d736b41a into main 2026-11-14 17:44:43 +00:00
argus deleted branch loop/744-error-classification 2026-11-14 17:44:43 +00:00
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!790
No description provided.