From 69a3e37ae788a91c5f72dd047d6196aa4c95fdef Mon Sep 17 00:00:00 2001 From: Kinflou Date: Tue, 13 Oct 2026 02:27:09 +0800 Subject: [PATCH 1/3] feat: carry the target's language version on GenRequest A generator knew which language version selected it only implicitly - the registry looked it up and then dropped it. So the Rust generator's `lib` mode had nothing to put in `Cargo.toml`'s `rust-version`, despite the target naming `rust#1.70.0` right there. `Mode::Code` has no manifest to record it in, and other generators ignore it the same way they ignore `default_framing` and `external_std`. Also bumps `comline-core` for the reserved-schema-name check (step 1 of the cascade); `codegen` itself is unaffected by it. --- codegen/Cargo.toml | 2 +- codegen/src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 3485842..889ecd2 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -8,6 +8,6 @@ license = "GPL-3.0-only" # Interim: track `core` by git rev (see design/runtime-repo-structure.md — no # crates.io publishing at this stage). Local iteration: uncomment the # workspace-root [patch] onto a sibling checkout. -comline-core = { git = "https://github.com/ComlineProject/core", rev = "5c1f3474b462ed912f4f2f5a518b87a5f6576aaa" } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "016e38603152444f9b51fddfd46b1e6b1d73f1d8" } eyre = "0.6.8" diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 71243df..1e6193b 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -49,6 +49,13 @@ pub struct GenRequest<'a> { /// built-in default. The value is a framing name the generator recognises /// (`"jsonrpc"`, `"datagram"`, …); an unknown one falls back to the default. pub default_framing: Option, + /// The target's language/toolchain version - the `#`-suffix of the + /// language the congregation declared (`rust#1.70.0` -> `"1.70.0"`, + /// `typescript#5.0` -> `"5.0"`), which is also what selected this + /// generator. A generator records it in whatever its own ecosystem's + /// manifest calls that (`rust-version` in a `Cargo.toml`), and ignores + /// it otherwise - `Mode::Code` has no manifest to put it in. + pub lang_version: String, /// `comline.toml`'s `[generate] external_std` - `true` means `std` /// should be referenced as its own crate instead of inlined into this /// package's own generated output. Only a generator that knows how to From 1d87c80b7941ff7095c45d1203cf790c0d21c7ae Mon Sep 17 00:00:00 2001 From: Kinflou Date: Tue, 13 Oct 2026 02:34:36 +0800 Subject: [PATCH 2/3] chore: realign conformance on the new core and generator revs Step 3 of the cascade. The corpus builds a `GenRequest` directly, so it names each generator's own registered `LANG_VERSION` rather than one value shared across both - `Mode::Code` has no manifest to record it in, so no golden depends on it, but a request naming the wrong version would still be a lie about what is being asked for. The goldens do not move, which is the point: the new field reaches no generated code. --- conformance/Cargo.toml | 6 +++--- conformance/tests/conformance.rs | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/conformance/Cargo.toml b/conformance/Cargo.toml index cfd51e3..db5eace 100644 --- a/conformance/Cargo.toml +++ b/conformance/Cargo.toml @@ -11,9 +11,9 @@ publish = false # to their own repos. See design/runtime-repo-structure.md (rollout step 3). [dependencies] -comline-core = { git = "https://github.com/ComlineProject/core", rev = "5c1f3474b462ed912f4f2f5a518b87a5f6576aaa" } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "016e38603152444f9b51fddfd46b1e6b1d73f1d8" } [dev-dependencies] comline-codegen = { path = "../codegen" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "eb8396a337e0efe452cea32cdb0e6a50dd56f2d5" } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "d8a1df17b83752314a34d9c0b7817e4feb16820e" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "c95ce654458c262f96fe9ba2e17459d7ff483c2c" } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "bfa088c7ca898aca0e8fa74e77d40e2fbb45a0a6" } diff --git a/conformance/tests/conformance.rs b/conformance/tests/conformance.rs index 3eecc8a..425834c 100644 --- a/conformance/tests/conformance.rs +++ b/conformance/tests/conformance.rs @@ -31,7 +31,7 @@ fn golden_path(fixture: &str, lang: &str, ext: &str) -> PathBuf { .join(format!("{lang}.{ext}")) } -fn request(schemas: &[(String, Vec)]) -> GenRequest<'_> { +fn request<'a>(schemas: &'a [(String, Vec)], lang: &str) -> GenRequest<'a> { GenRequest { mode: Mode::Code, schemas, @@ -39,6 +39,16 @@ fn request(schemas: &[(String, Vec)]) -> GenRequest<'_> { name: "conformance".to_string(), version: "0.0.0".to_string(), }, + // Each generator's own registered version. `Mode::Code` has no + // manifest to record it in, so no golden depends on it - but a + // request that named the wrong one would still be a lie about what + // is being asked for. + lang_version: match lang { + "rust" => comline_codegen_rust::LANG_VERSION, + "typescript" => comline_codegen_typescript::LANG_VERSION, + other => panic!("unknown language `{other}`"), + } + .to_string(), default_framing: None, external_std: false, } @@ -52,7 +62,7 @@ fn corpus_matches_golden() { for fx in corpus() { let schemas = vec![(fx.namespace.to_string(), fx.units.clone())]; for &(lang, ext) in LANGS { - let req = request(&schemas); + let req = request(&schemas, lang); let files = generate(lang, &req); assert_eq!( files.len(), From 6531337d92ea05cae2da81cb53833ff5b241b6cf Mon Sep 17 00:00:00 2001 From: Kinflou Date: Tue, 13 Oct 2026 02:52:04 +0800 Subject: [PATCH 3/3] chore: point conformance at the merged generator revs Including comline-rust#38's STD_REV repoint, so a generated crate links the current comline_std rather than the one the previous pin named. --- conformance/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conformance/Cargo.toml b/conformance/Cargo.toml index db5eace..d55d9aa 100644 --- a/conformance/Cargo.toml +++ b/conformance/Cargo.toml @@ -15,5 +15,5 @@ comline-core = { git = "https://github.com/ComlineProject/core", rev = "016e3860 [dev-dependencies] comline-codegen = { path = "../codegen" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "c95ce654458c262f96fe9ba2e17459d7ff483c2c" } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "bfa088c7ca898aca0e8fa74e77d40e2fbb45a0a6" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "5b1ba2b099cc295c6768935623f4c084f134e6b8" } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "c484b764b4341d8a8529eb52613e4ce2fb6c35d5" }