Repository navigation
Read guarantees, facts and spellings from the specification's catalog - #236
Merged
Merged
Conversation
added 2 commits
November 9, 2026 22:35
core depends on comline-catalog, the specification's catalog as a no_std Rust crate, and reads from it what it kept its own copies of: - Guarantee's names, titles and new descriptions. The enum stays hand-written (it's frozen into the IR, and each guarantee needs core's logic for when it's given up); a test holds it to the catalog exactly, in order and by its frozen spelling. - ProfileKind::facts: each kind's facts and their values. Profile::parse, grammar and establishes follow, and the fact names core's logic acts on (diff, compat, unverified, freezing) are the catalog's constants. A test checks every value that logic compares with is one the catalog allows. - The official encodings' aliases and frozen spellings, in place of SPELLINGS, and the encoding name constants. A test holds the official package's declarations to the catalog's encodings.
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 of the #219 rollout: core reads the catalog instead of keeping its own copies.
Depends on ComlineProject/specification#2 (the
comline-catalogcrate). It is pinned to that PR's head for now. Once that merges, I'll repin to the merge commit before merging this.What now comes from the catalog
Guarantee:name()maps each variant to the catalog's id constant.describe()and the newdescription()andentry()read the catalog.guarantees_are_the_catalogsrequires exactly the catalog's set, in its order, with each variant's frozen spelling equal to its catalog name in CamelCase. A guarantee added to the spec therefore fails core's tests until core implements it.ProfileKind::facts()now returns the catalog's facts (an iterator ofcomline_catalog::Fact) instead of a hand-kept table. Nothing outside core called it.Profile::parse,grammarandestablishesfollow.establishesreads each fact'sestablishesrelation, and skips one core doesn't know, which fails closed.diff,compat,unverifiedandfreezingare now the catalog'sfact::*constants.the_values_core_acts_on_are_the_catalogschecks that every value that logic compares with is allowed by the catalog.a_profile_is_held_to_the_catalogs_factscoversparse's errors.official::spellingsbuilds each name's aliases and canonical (frozen) spelling from the catalog, replacingSPELLINGS.every_name_and_alias_resolves_as_beforestill passes unchanged.FORMAT_*,FRAMING_DATAGRAM2/3,DEFAULT_HANDSHAKE,IMPLICIT_HANDSHAKEandHANDSHAKE_NONEare the catalog's constants.FRAMING_DATAGRAMandFRAMING_JSONRPCstay literal, because they're the frozen spellings;the_frozen_spellings_are_the_catalogschecks them.the_declarations_are_the_catalogschecks that the stdlib'sconfig.idpdeclares exactly the catalog's encodings that have a profile, in order and with matching kinds, withhas_vectorswhere the catalog names a feature, and thatnoneis the one encoding not declared.Frozen IR is unchanged: the same names and the same serde form, and
the_snapshot_is_what_freezespasses.Not in this PR: refusing unknown annotation names, settings keys and diagnostic codes (#171, #178). The catalog doesn't hold those yet.
Tested locally:
cargo test --workspace: 633 integration and 326 lib tests pass.--no-default-features) builds.