Repository navigation
compat: the facts each frozen version provides for comline@2 - #159
Merged
Merged
Conversation
- Package id: `id = "<32 hex>"` in config.idp, checked; `package::id` generates one and adds it to a config.idp minimally. Changing it is a major change (identity); adding one is none. - `comline_core::compat`: each protocol's line (the release it last broke at, by the diff's rules, counting what it reaches, dependencies included; a package wire change moves every line) and each function's since, recorded per build as a `facts` blob in the root tree and computed for versions built before. Lines and sinces name releases: a build carries what it leads to, and a release made as another version renames them. - Wire-shape hash per protocol (canonical CBOR, wire-reaching content only) and parameter hash per encoding, computed on demand. - core#156: validator calls are compared with their arguments resolved against the validator's parameter defaults. Refs #119, ComlineProject/runtime#15. Closes #156.
This was referenced Nov 1, 2026
- Facts are keyed by `namespace::Protocol`: two protocols of the same name in different schemas get their own lines and sinces. Each protocol's changes come from the diff with every other protocol left out, and its reach is taken from its own schema. A renamed namespace or protocol keeps its history. `ProtocolFacts` gains `path` and `namespace`; the shape hash still leaves the namespace out. - The shape hash keeps function order only where the framing calls by index, and field and variant order only where the format goes by position (the profiles' `calls`, `struct_fields`, `enum_variants`, as `WireFacts` reads them); otherwise sorted by name. An encoding without an official profile counts as order-sensitive.
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.
Step 2 of 3 of the compatibility work (#119, ComlineProject/runtime#15): what each frozen version records and provides for
comline@2.Package id
id = "<32 lowercase hex>"in config.idp (128 random bits; std's randomly seeded hasher, the clock and the pid through blake3, no new dependency). Checked when config.idp is interpreted.package::id::{generate, check, add_to_config_source, ensure_in_config}: the CLI'snewwrites one,buildadds one to a config.idp without it, inserting a single line aftercongregation.PackageIdChanged, major (identity). Adding one where there was none is no change.comline_core::compat(behindcompiler)facts(project, version) -> PackageFacts { id, version, protocols: [{name, line, shape_hash, functions: [{name, since}]}], encodings: [{kind, name, params, param_hash}] }, serde-serializable; alsofacts_of_commitandfacts_of_context.namespace::Protocol): protocols of the same name in two schemas have their own facts.ProtocolFactscarriespath,namespaceandname. Each protocol's changes come from the diff with every other protocol left out, and its reach is taken from its own schema. A renamed namespace or protocol keeps its history (line and sinces).compare: a breaking change counts for a protocol when it concerns the protocol or a declaration it reaches (diff::protocol_reach,diff::concerns_protocol; dependencies by reach; thrown errors and constants named by validator arguments included). Namespace and protocol renames don't count, since names don't reach the wire. A change to the package'swire.format,wire.framingorhandshakemoves every line.0.xminor. A build carries the line and since values of the release it leads to (0.2.0-dev.2→0.2.0). Ifcomline releasemakes a different version (a raised bump, or--stable), it renames them in a tree of its own. The values are computed against the last release, not build by build.factsblob in each build's root tree, besideconfiganddocs. Schema blobs andschema_ir_hashdon't change. The no-change check ignores the blob, so an old store doesn't produce an empty build. A commit without the blob gets its facts computed on read. A test recomputes every commit's facts and compares them with the stored ones.@provider/@consumer) and every declaration they reach. Aliases are resolved, and declarations are numbered in the order first reached, so no type name or namespace goes in. Order counts only where it travels. Function order counts where the framing calls by index (calls), and field and variant order where the format goes by position (struct_fields,enum_variants); otherwise they're sorted by name. An encoding without an official profile counts as order-sensitive. Tests: a function reorder keeps the hash underjsonrpcand changes it underdatagram@2, and a field reorder keeps it underjson@1and changes it underpacked@1. Docstrings, spans, validators, constants, defaults and advisory annotations are left out. Tests show that docstring, span, namespace, alias and constant edits leave the hash alone, while field, argument, function-name and thrown-error edits change it, and only for the protocol that reaches them.(kind, name, params), covering each format, framing and handshake in play. A declared encoding's profile hash counts as itsprofileparameter.For step 3: identifying a protocol on the wire
Facts are keyed by the qualified path, but the shape hash leaves the namespace out, as decided. How
comline@2names a protocol in its offer is step 3's question (runtime#15). It could send the path, which would break peers on a namespace rename even though the namespace doesn't travel today. Or it could send the bare name plus the shape hash, which is ambiguous when two schemas have a protocol of the same name.core#156
A field's effective validators are compared with each call's arguments resolved against the validator's parameter defaults. A narrowed default now reports
validation_tightenedon every use that relies on it, and writing a default out is no change.Not here: core#155
@opendoesn't exist in the language yet: the grammar'senumtakes no annotations, and runtime#17 is still open. Freezing enum annotations needs a grammar change plus an IR field, so it stays open.Refs #119, ComlineProject/runtime#15. Closes #156.