Repository navigation
去掉 PROTOCOL,包与宿主的运行时对齐只认 tinyui 版本 - #24
Conversation
PROTOCOL 从 M1 起一直是 1,改 mount 参数、加 host.call 时都没加,核对永远通过; 真正生效的兼容判据是"tinyui 版本相等"(宿主快照、publish、PackageCheck)。 现在把它作为唯一判据贯穿到底: - core:protocol.ts 换成 version.ts(VERSION 移入),__tinyui 暴露 version - PageHost:K0 核对 __tinyui.version == TinyUI.version,先于取入口函数;删 PROTOCOL - manifest:删 protocol 字段;bundle 改为要求 tinyui 字段 - Updates:客户端核对 manifest.tinyui(此前客户端不读),Mismatch.PROTOCOL → TINYUI - 签名夹具换钥重签 - 文档同步;roadmap D 组加"运行时 ABI 版本",触发条件为宿主升级 tinyui 导致的重新发布成为负担 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewer's Guide本 PR 删除形同虚设的 PROTOCOL 兼容层,改由 tinyui-core VERSION 贯穿 JS 运行时、PageHost、manifest、CLI 与 Updates:运行时在 K0 校验 __tinyui.version,客户端在构建、内置包和热下发流程中统一核对 tinyui 版本,并同步 API、测试夹具和文档。 Sequence diagram for tinyui version compatibility checkssequenceDiagram
participant Updates
participant Manifest
participant PageHost
participant RuntimeCore
participant TinyUI
Updates->>Manifest: readManifest()
Manifest-->>Updates: manifest.tinyui
Updates->>TinyUI: compare manifest.tinyui with TinyUI.version
alt version mismatch
Updates-->>Updates: Mismatch.TINYUI
else version matches
Updates-->>Updates: package is eligible
end
PageHost->>RuntimeCore: evaluate("__tinyui")
RuntimeCore-->>PageHost: __tinyui.version
PageHost->>TinyUI: compare version with TinyUI.version
alt version mismatch
PageHost-->>PageHost: E6
else version matches
PageHost->>PageHost: resolve entry functions
PageHost->>RuntimeCore: mount(...)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change replaces the numeric protocol identifier with the TinyUI version across runtime startup checks, build manifests, package compatibility checks, and update mismatch reporting. It also removes the protocol constant and updates related tests and documentation. ChangesTinyUI version compatibility
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant PageHost
participant TinyUICore
participant TinyUI
participant LoadFailure
PageHost->>TinyUICore: Read entries.version
PageHost->>TinyUI: Compare with TinyUI.version
PageHost->>LoadFailure: Report E6 when versions differ
Merge Risk: ⚪ Minimal · up to No new merge-blocking risk is established; the compatibility change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 16 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
CodeSeer 审查
结论:不批准(本轮 1 条严重或建议级意见)
摘要
本次改动将运行时兼容性从 PROTOCOL 切换为 tinyui 版本,并同步更新了 core 导出、manifest、CLI、PageHost、Updates 与文档。下发新包时已经会核对 manifest.tinyui,但启动时恢复已安装包的路径遗漏了同一核对。因而旧 manifest 或宿主升级前遗留的已安装包仍可能被选中并在页面启动后才以 E6 失败。
其他意见
不在改动行上,无法挂为行内评论:
updates/src/commonMain/kotlin/app/tinyui/updates/Updates.kt:170[严重]loadInstalled只检查包名、hostVersion、失败记录和创建时间,未核对manifest.tinyui == tinyui(也未重核对engine)。因此本次升级前落盘的旧 manifest(tinyui为空)或不同 tinyui 版本的已安装包,在宿主未变更hostVersion时仍会被选为current,随后页面只能在PageHost中报 E6;这与“旧 manifest 在客户端判 TINYUI 不兼容”不符。应在此处将engine/tinyui不匹配视为不可加载,清除该 installed 版本并回退到 embedded 包。
整个 PR 至 0cc6a78 · gpt-5.6-terra
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. This changes the persisted bundle manifest format and the compatibility gate used before installing or running runtime modules. A wrong version-alignment decision could make packages fail with E6 or be skipped until a compatible bundle is published; reverting the code would not repair manifests or packages already produced under the new format, though those can be replaced or re-run.
宿主换了引擎或 tinyui 而沿用 hostVersion 时,旧的 installed 包会被选中、进页面才 E6; 现在与下载前的核对一致,不符即当场删除、回到内置包。 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
背景
PageHost.PROTOCOL从 M1 起一直是 1:改mount参数、加__host_call时都没加,K0 与热下发的核对永远通过,形同虚设。实际守住 JS 运行时 ↔ Kotlin 边界的是"tinyui 版本相等"(宿主快照 →publish核对、PackageCheck),但客户端Updates并不读 manifest 的tinyui。拍板选 A:删掉PROTOCOL,只认 tinyui 版本。改动
protocol.ts→version.ts(VERSION移入,index.ts转导出),删tinyui-core/protocol子路径导出;__tinyui.protocol→__tinyui.version__tinyui.version == TinyUI.version,不等 E6;核对提前到取入口函数之前(否则缺入口的旧运行时先报类型转换错误);删PROTOCOLprotocol字段;bundle改为要求tinyui字段;CLI 读 tinyui-core 版本改从主入口向上找 package.jsonmanifest.tinyui == TinyUI.version;Mismatch.PROTOCOL→Mismatch.TINYUIprotocol换成tinyui)影响
PageHost.PROTOCOL、BuildManifest.protocol;Mismatch.PROTOCOL改名TINYUI(api 快照已更新)。TrendingAI 与 tinyui-updates-server 均未引用tinyui字段)在客户端会被判TINYUI不兼容;线上包都由 0.4.0+ 的 CLI 产出,均带该字段VERSION改在packages/core/src/version.ts验证
pnpm -r test:core 42 / native 5 / cli 78 全过:compose:allTests:updates:allTests:sample:shared:allTests(Android host + iOS 模拟器)、apiCheck、sample APK 全过Running(EMBEDDED),页面正常渲染,无EmbeddedIncompatible🤖 Generated with Claude Code
Summary by Sourcery
Replace the obsolete protocol version contract with tinyui version alignment across the runtime, package manifests, host checks, and update flows.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by CodeRabbit