Repository navigation
test: drop the v0.13.0 guards now that libkcl 0.13.1 is in the tree - #402
Merged
Merged
Conversation
Peefy
force-pushed
the
behaviour/v0.13.1
branch
3 times, most recently
from
October 8, 2026 02:10
ac40faf to
274e086
Compare
11 tasks done
Peefy
force-pushed
the
behaviour/v0.13.1
branch
from
October 8, 2026 02:38
2d9e15f to
f0a74c5
Compare
#399 replaced the checked-in binaries with the v0.13.1 release. That release closes three RPC-registry gaps the bindings had been working around, and every workaround for them is now dead code: - `BuiltinService.ListMethod` and `BuiltinService.Ping` are registered, so the bindings that treated an empty method table as "the RPC doesn't exist" now always get a table. - `KclService.FormatTestReport` and the five `Generate*` RPCs are registered, so the skip/empty-payload guards in front of their assertions never fire. - `KclService.ListDepFiles` was dropped in favour of new `LoadPackageResult.imports` / `kcl_mod` / `apps` fields. Removes the `t.Skip` / `pytest.skip` / `pending()` / empty-table guards in go, python, dart, zig and julia, and replaces them with the assertions they were written to enable. Where a guard was the only thing keeping a test green, the assertion now pins the registry size at 28, so the next core-side RPC removal cannot pass unnoticed — `ListDepFiles` is exactly the case that slipped through. Verified against the v0.13.1 `darwin-arm64` dylib: go native/path/plugin ok (6 Generate*/FormatTestReport now assert) python 160 passed, 2 skipped (skips want PyYAML, unrelated) nodejs 109 passed (listMethod returns 28) dart 124 passed, analyze ok zig exit 0 (BuiltinService.Ping now dispatches) julia 129 + 106 + 168 + 18 (coverage and report are populated) Also corrects the docs that described the old behaviour: the service-name divergence notes in dart/zig/julia/lua, `zig/README.md`'s RPC count, the `getVersion` examples in wasm/julia, and the `ListDepFiles` drift entry in `docs/architecture.md` — which the core resolving item A has now closed. Not covered here, because these suites cannot run in this environment: swift, ruby, cpp and the c/examples guards still carry the same predates-the-RPC wording. lua's spec guards are updated but unverified — `luarocks make` fails to link mlua against Homebrew's Lua 5.4 locally, which is unrelated to this change. java, kotlin and dotnet are updated but unrun (no JRE / dotnet SDK here). Signed-off-by: Peefy <xpf6677@163.com>
Same cleanup as the other bindings: v0.13.1 registers
`KclService.FormatTestReport` and the five `Generate*` RPCs, so the
guards in front of their assertions no longer have anything to guard.
ruby, swift
- Drop `skip "core does not list KclService.FormatTestReport"` from
the two report tests and the `XCTSkipIf(report.isEmpty, ..)` pair
from `testFormatTestReport` / `testFormatTestReportEmpty`. The
assertions underneath -- the 80-dash separator, `PASS: 2/2`, and
`"no test files\n"` -- now run.
cpp
- The six `Generate*` / `FormatTestReport` examples each carried a
comment saying the linked runtime "currently prints nothing" and
then asserted nothing at all, so a regression could not fail CI.
They all produce real output on 0.13.1; they now check it, and
`cpp-test`'s `exit 1`-on-failure loop actually has something to
catch.
- `src/lib.rs` hand-copied 12 proto messages for these RPCs on the
stated grounds that "the kcl-api revision pinned in Cargo.lock
predates the RPC, so the wrapper has no generated counterpart".
It does have them: `kcl_api::FormatTestReportArgs`,
`GenerateTomlArgs`, `GenerateKclArgs`, `GenerateOpenApiArgs`,
`GenerateProtoArgs` and `GenerateDocArgs` (plus the matching
`*Result`) are all generated at the pinned rev, field-for-field.
The copies and their doc comments are gone; the `From` impls stay
because they still convert the cxx types to the prost ones.
`call_rpc` and `list_method` stay too -- `kcl_api` still exposes
no typed *client* method for these, only `kcl_api::call`, so the
dispatcher is still the only route.
The one skip that is not a version artifact
`AstJsonAlignmentTest` skipped on "the pinned kcl runtime does not
copy the parent into mixins". That is not what the pin does: the
parser fills `mixins` only from an explicit `mixin [...]` clause
(`crates/parser/src/parser/stmt.rs`), and the parent goes to
`parent_name` alone. No future pin will make the skip stop firing,
so the skip is replaced with the invariant it was standing in for --
a schema with a parent and no mixins has an empty `mixins`.
Verified locally against the v0.13.1 darwin-arm64 core:
swift 102 tests, 0 failures, 0 skipped
ruby 145 runs, 654 assertions, 0 failures, 0 errors, 0 skips
cpp 9/9 ctest, 13/13 consistency cases, 0 skipped, examples all
exit 0 under the CI loop; `cargo fmt` adds no new diffs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Peefy <xpf6677@163.com>
`call_rpc` takes `&Req` with `Req: prost::Message`, so passing `&args.into()` leaves the type parameter pinned only by the argument. `Into` has too many candidate impls for the compiler to pick one and `Req` is never pinned elsewhere in the signature, so all six dispatch functions fail with E0283. Bind the conversion to a named local instead, which both fixes the inference and documents which generated message each RPC expects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Peefy <xpf6677@163.com>
Peefy
force-pushed
the
behaviour/v0.13.1
branch
from
October 8, 2026 03:20
f0a74c5 to
0525da6
Compare
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.
Sits directly on
main— #399 (the v0.13.1 release bump) is merged, so this PR's diff is exactly the three commits below.Follow-up to #399. That PR replaced the checked-in binaries with the v0.13.1 release and fixed the two CI failures the bump caused; this one removes the workarounds that release made dead, and corrects the docs that described the old behaviour.
Why the guards are dead
v0.13.1 closes three RPC-registry gaps the bindings had been compensating for:
BuiltinService.ListMethodandBuiltinService.Pingare registered. Bindings that treated an empty method table as "this RPC doesn't exist" now always get a table.KclService.FormatTestReportand the fiveGenerate*RPCs (GenerateToml,GenerateKcl,GenerateOpenAPI,GenerateProto,GenerateDoc) are registered, so the skip guards in front of their assertions never fire.KclService.ListDepFileswas removed, replaced by newLoadPackageResult.imports/kcl_mod/appsfields.28 RPCs are now advertised: 26 under
service KclServiceplusPingandListMethodunderservice BuiltinService.What this changes
Removes the
t.Skip/pytest.skip/markTestSkipped/pending()/ empty-table guards across go, python, dart, zig, julia, lua, nodejs, java, kotlin, dotnet, ruby, swift, cpp and replaces them with the assertions they were written to enable.Where a guard was the only thing keeping a test green, the assertion now pins the registry size at 28 — so the next core-side RPC removal cannot pass unnoticed.
ListDepFilesis exactly the case that slipped through: it was deleted from the core and these bindings kept carrying a skip for it.Doc corrections that the release made stale:
dart/lib/src/kcl_lib.dart— the old comment claimedspec.protodeclaresFormatCode/LintPath/ etc. underBuiltinService. It does not; the core registers every RPC underKclServiceexcept the twospec.protoputs inBuiltinService.zig/README.mdRPC count (20 → 26),julia/README.md,dart/README.md,wasm/README.mdgetVersionexamplesdocs/architecture.md— theListDepFilesdrift entry is now closed, and item A's core half landed in v0.13.1Deliberate non-changes: the per-case
new_coreskips (python, ruby, swift, cpp, lua, dotnet, kotlin, java, go, c) stay. They query the live core throughlist_method()and skip only when the loaded core genuinely does not advertise the RPC — an evidence-driven capability check, not a v0.13.0 artifact.cpp: three separate things
The six examples asserted nothing. The
Generate*/FormatTestReportexamples each carried a comment saying the linked runtime "currently prints nothing" — and then asserted nothing at all, socpp-test'sexit 1-on-failure loop had nothing to catch. They all produce real output on 0.13.1; they now check it.cpp/src/lib.rshand-copied 12 proto messages for these RPCs, on the stated grounds that "thekcl-apirevision pinned inCargo.lockpredates the RPC, so the wrapper has no generated counterpart". It does have them:kcl_api::FormatTestReportArgs,GenerateTomlArgs,GenerateKclArgs,GenerateOpenApiArgs,GenerateProtoArgs,GenerateDocArgs(and the matching*Result) are all generated at the pinned rev, field-for-field. The copies are gone. TheFromimpls stay — they convert the cxx types to the prost ones — and so docall_rpcandlist_method, becausekcl_apistill exposes no typed client method for these, onlykcl_api::call.The first CI run of this PR caught a build break in the above.
call_rpctakes&ReqwithReq: prost::Message, socall_rpc(b"...", &args.into())leavesReqpinned only by the argument;Intohas too many candidate impls and the type parameter is never pinned elsewhere, so all six dispatch functions fail withE0283. Fixed by binding the conversion to a named local — which also documents which generated message each RPC expects. Worth noting how this survived local testing:cpp/CMakeLists.txt'sadd_custom_commandlists${RUST_BRIDGE_CPP} ${RUST_LIB} ${RUST_HEADER_FILE}as outputs but has noDEPENDSon${RUST_SOURCE_FILE}, so editingcpp/src/lib.rsdoes not re-runcargo buildand the previous ctest/consistency run was against a stale staticlib. That is a pre-existing bug in the build, left alone here — the re-verification below builds the crate explicitly first.The one skip that was not a version artifact
swift/Tests/KclLibTests/AstJsonAlignmentTest.swiftskipped on "the pinned kcl runtime does not copy the parent into mixins". That is not what the pin does. The parser fillsmixinsonly from an explicitmixin [...]clause (crates/parser/src/parser/stmt.rs); the parent goes toparent_namealone. No future pin will make that skip stop firing, so it is replaced with the invariant it was standing in for — a schema with a parent and no mixins has an emptymixins.The stale
ruby/Cargo.lockis not here — it is release correctness, so it rides in #399 with the manifest bump.Verification
Run locally against the v0.13.1
darwin-arm64dylib:cargo build --releaseclean · 9/9 ctest · 13/13 consistency cases, 0 skipped · all 31 examples exit 0 under the CI loop ·cargo fmt --checkadds no new diffs (3 pre-existing at 1775/1805/2328)Generate*/FormatTestReportguards now assert instead of skippinglistMethodreturns 28)dart analyzecleanBuiltinService.Pingnow dispatches)swift, ruby and cpp all report zero skips, which is the direct evidence that every guard removed here was dead.