refactor(sdk): split native SDKs and share golden harness - #44
Merged
Merged
Conversation
Signed-off-by: samzong <samzong.lu@gmail.com>
samzong
marked this pull request as ready for review
September 16, 2026 13:25
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.
Summary
The SDK entry files mixed bundle loading, host selection, filesystem ownership, and CLI interaction, while four golden runners repeated fixture setup and assertions. Split the native implementations by responsibility, centralize ownership and write paths within each SDK, and move shared golden setup and assertions into one Node harness with native SDK adapters.
The public package APIs, all 89 golden cases, host data, and schemas remain unchanged. The published Go, Rust, and Python packages remain native and do not depend on Node; repository golden tests now require Node.js 24.
Size and structure
Physical lines, including blank lines, measured against
6dc6e489f119fa63101c23781ddcd6992bffadc8:The source subset includes
.ts,.mjs,.go,.rs,.py,.sh,.yml,.yaml, andMakefile. New modules are included in both totals. The Rust, TypeScript, and Go entry files were 2,244, 1,990, and 1,933 lines; the largest SDK source file is now 468 lines.This draft does not satisfy the 30% overall reduction target.
Verification
node scripts/check.mjs(themake checkentry point).node scripts/check.mjs: passed spec and generated-data checks, all four native golden adapters, formatting, linting, builds, native tests, standalone Go modules, and all four examples.include-dir.The shared hash oracle exposes an existing difference: TypeScript sorts bundle paths with
localeCompare; Go, Rust, and Python sort lexically. This refactor preserves those persisted hashes and explicitly documents the limitation. It does not claim cross-language hash equality or introduce a hash migration.Scope Check
spec/hosts.jsonis unchanged and generation checks pass.