Skip to content

codecs: one verb for every library: value_formats, basic_armor, the decode bound and over in place - #3

Merged
pinhopro merged 31 commits into
mainfrom
codecs/one-verb
Dec 3, 2026
Merged

pinhopro merged 31 commits into
mainfrom
codecs/one-verb

Conversation

@pinhopro

@pinhopro pinhopro commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

codecs' change one-verb (webcpporg/proposals, libraries/codecs/openspec/changes/one-verb/): codecs::encode and codecs::decode are the verbs of every library (owner decision 31).

  • A value codec may state max_decode_input_size, the longest input its decode accepts, never below max_encoded_size (the build stops). The core refuses a longer input with codecs::error::input_too_long on every path, directly and through over (owner decision 29).
  • over decodes a value in place under that bound, up to 4096 bytes, with no heap and noexcept. Above 4096 it uses the allocator, refusing an over-long input before it allocates, and wipes the intermediate when the value is secret (owner decision 30).
  • The constant-time lane gains the path of a secret value through over, and a new fuzz target, over_value.
  • A library declares its value types' formats and their reasons with codecs::value_formats, format_list, direction and check_conversion. Every value operation, the buffer and token forms included, refuses a pair through that declaration with one error: the library's sentence or the type's list. A declared type that is also a byte input or a byte result follows its declaration too.
  • formats::basic_armor<Label>: an armor whose label is fixed by its type, with an exact capacity (text<241> against text<347> for 138 bytes under PRIVATE KEY).
  • The guide, the examples over_value and value_formats, pem's fixed_label region, and the changelog.

Verified locally on the final head, with no CI run (owner's rule):

  • the five lanes from scratch: clang, gcc-15, wasip2, wasip3 and Emscripten, with codecs and crypto passing together;
  • the doc;
  • MSVC 14.3 and 14.5 x64 debug;
  • codecs' constant-time and fuzz lanes on Linux;
  • the macOS and Linux full lints.

The crypto pull request that follows removes crypto::encode and crypto::decode.

🤖 Generated with Claude Code

R added 30 commits December 2, 2026 14:45
…put its decode accepts, never below max_encoded_size; the core refuses a longer input on every path
…ecode bound, refusing a longer intermediate before it is made
…ons, and every value operation refuses a pair through the declaration, one error
…, the armor with its label in its type, and where a value's intermediate lives under its decode bound
…bers a library keeps, the examples' regions and namespace
…odec is governed by its declaration

encodable and decodable take the bytes' path only when no value codec of the pair converts, and
the typed decode takes a byte result's path on the same condition, so that a refused pair of such
a type is refused by its declaration in every form, never converted by the value codec or as
bytes. value_formats_test pins the concepts and the forms; the message tests
declared_byte_input_reason and declared_byte_result pin the one error. One spelling of
composition_inner's type, with typename.
…ic_armor's row, the decode bound's error and intermediate); the example's helper in the anonymous namespace
…the lint takes without typename (lint fix)
…e for a byte value's value codec its own paragraph (doc fix)
@pinhopro
pinhopro merged commit 8535c31 into main Dec 3, 2026
1 of 8 checks passed
@pinhopro
pinhopro deleted the codecs/one-verb branch December 3, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant