Skip to content

conformance: pin the generators at their entry-point revisions - #152

Merged
Kinflou merged 1 commit into
masterfrom
conformance/generators-entry-points
Nov 15, 2026
Merged

Kinflou merged 1 commit into
masterfrom
conformance/generators-entry-points

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 15, 2026

Copy link
Copy Markdown
Member

Pins conformance/Cargo.toml at the merged generator heads and re-blesses the goldens (CONFORMANCE_BLESS=1 cargo test -p comline-conformance):

  • comline-codegen-rust 2d2c885 -> dd1c29e6560a0ffd7893c59715b31d43b88c585f (comline-rust#131 entry-point header, #[doc(hidden)] plumbing, Connection<T>/Framing aliases, Format/CONNECTION_IR_HASH defined once; includes Bump core to 35ab4b8 #132's STD_REV bump)
  • comline-codegen-typescript c44b39d -> d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc (comline-typescript#172 header, @internal plumbing, shared wire.ts)

Both pin core 14ce546 and generation e22109e, same as this branch's core pin. FEATURES.md / features.json did not change in the bless run, so they are untouched.

Golden diff

Every changed line was reviewed (changed lines reduced to a unique-line histogram, then read). All of it falls in the allowed categories.

Rust: 33 of 43 files changed, +510/-230, no files added or removed.

  • //! entry-point header (28 files with header lines: the protocol files and the connection files).
  • #[doc(hidden)] on plumbing items (83 top-level, 40 impl-level).
  • use imports replacing fully qualified comline_runtime::... paths (Transport, AsyncTransport, RuntimeError, Peer, Reason, Negotiated, Comline2Handshake, Json, JsonRpcFraming).
  • pub type Framing (datagram@3, jsonrpc) and pub type Connection<T> aliases, and the accept/connect/provide_on signatures using them.
  • Format and CONNECTION_IR_HASH defined in connection.rs; 14 protocol files pub use crate::connection::{CONNECTION_IR_HASH, Format}; and the jsonrpc one re-exports CONNECTION_IR_HASH only (it has no Format).
  • Corrected connect doc ("run the handshake. Call the server's protocols through their senders." where there are no client services).

TypeScript: 42 of 56 files changed (29 modified, +371/-289; 13 new wire.ts, 182 lines).

  • Header block (Where to start: with serve/dial/implement/call lines).
  • /** @internal */ on plumbing (57) and the @internal in doc blocks.
  • New wire.ts per package that has a connection (13): Format and CONNECTION_IR_HASH.
  • Format/CONNECTION_IR_HASH removed from the per-protocol files and from connection.ts's own definition; connection.ts re-exports from ./wire.js (export { CONNECTION_IR_HASH, Format } from "./wire.js") and imports it.
  • Doc fixes (handshake doc, connect doc, "Format and CONNECTION_IR_HASH are in ./wire.js" pointer in provideOn docs).

Nothing outside those categories moved.

Wire invariance

A script extracted, per golden file, before (committed goldens at the merge base) and after (re-blessed): every IR_HASH, the CONNECTION_IR_HASH value set per fixture and language (the definition moved files, so it is compared per fixture/language rather than per file), every HELLO byte array, every PROTOCOL number, every call id and name (Call::new(id, "name") and { id, name }), every dispatcher arm id, and Envelope::Err { id } ids, plus per-file occurrence counts of each.

Kind Rows
IR_HASH 33
CONNECTION_IR_HASH (value set per fixture/language) 29
HELLO byte arrays 6
PROTOCOL 39
Call ids/names (Rust / TS) 33 / 30
Dispatcher arm ids (Rust / TS) 29 / 26
Error ids (Rust) 5
Occurrence counts 242

diff before.txt after.txt is empty: 425 lines each, sha256 1754c461725ab8233ba806e6daa35ce59b21703c52a676cb779bf5dbb86cb8a7 for both.

Extraction script
import sys, re, os
root = sys.argv[1]
rows = set()
patterns = [
  (re.compile(r'^\s*(?:pub )?(?:const|static readonly|export const)\s+(PROTOCOL)\b[^=]*=\s*(.+?);?$'), 'PROTOCOL'),
  (re.compile(r'^\s*(?:pub const|export const)\s+(IR_HASH)\b[^=]*=\s*(.+?);$'), 'IR_HASH'),
  (re.compile(r'Call::new\((\d+), "([^"]*)"\)'), 'CALL_RS'),
  (re.compile(r'\{ id: (\d+), name: "([^"]*)" \}'), 'CALL_TS'),
  (re.compile(r'^\s+(\d+) => \{'), 'ARM_RS'),
  (re.compile(r'^\s+case (\d+):'), 'ARM_TS'),
  (re.compile(r'Envelope::Err \{ id: (\d+u16)'), 'ERRID_RS'),
]
conn = {}
for dp, _, fs in os.walk(root):
    for f in sorted(fs):
        p = os.path.join(dp, f); rel = os.path.relpath(p, root)
        parts = rel.split(os.sep); fx, lang = parts[0], parts[1]
        if not f.endswith(('.rs','.ts')): continue
        lines = open(p).read().split('\n')
        i = 0
        while i < len(lines):
            l = lines[i]
            m = re.match(r'^\s*(?:pub )?const CONNECTION_IR_HASH\b[^=]*=\s*(.+?);$', l) or re.match(r'^\s*export const CONNECTION_IR_HASH\s*=\s*(.+?);$', l)
            if m: conn.setdefault((fx,lang),set()).add(m.group(1))
            if re.match(r'^\s*(pub const|export const) HELLO\b', l):
                blk=[]
                while True:
                    blk.append(lines[i].strip())
                    if lines[i].strip().startswith(']'): break
                    i += 1
                rows.add((rel,'HELLO',''.join(blk)))
            for rx, kind in patterns:
                m = rx.search(l)
                if m: rows.add((rel, kind, '|'.join(m.groups()) + f'@{i+1}' if False else '|'.join(m.groups())))
            i += 1
# multiset for per-file rows: count occurrences too
from collections import Counter
cnt = Counter()
for dp, _, fs in os.walk(root):
    for f in fs:
        if not f.endswith(('.rs','.ts')): continue
        p=os.path.join(dp,f); rel=os.path.relpath(p,root)
        for l in open(p).read().split('\n'):
            for rx, kind in patterns:
                m=rx.search(l)
                if m: cnt[(rel,kind,'|'.join(m.groups()))]+=1
out=[]
for r in sorted(rows): out.append('\t'.join(r))
for k,v in sorted(conn.items()): out.append('\t'.join([k[0]+'/'+k[1],'CONNECTION_IR_HASH_SET',','.join(sorted(v))]))
for k,v in sorted(cnt.items()): out.append('\t'.join([k[0],'COUNT:'+k[1],k[2],str(v)]))
print('\n'.join(out))

Run as python3 -I wire.py conformance/tests/golden > {before,after}.txt.

CI is the check for the rest: the comline-conformance tests (corpus_matches_golden, support_is_proven) run against the new pins.

…-bless the goldens

comline-rust dd1c29e (entry-point header, doc(hidden) plumbing, Connection<T>/Framing
aliases, Format and CONNECTION_IR_HASH defined once) and comline-typescript d377fbf
(header, @internal plumbing, shared wire.ts). No wire value changes.
@Kinflou
Kinflou marked this pull request as ready for review November 15, 2026 00:33
@Kinflou
Kinflou merged commit ac2d771 into master Nov 15, 2026
23 checks passed
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