feat: Multi Driver Registry——drivers.directories Package 扫描装配(V2 PR-4) - #38
Merged
Conversation
…,§37.3/§8/§41.1) Collector 配置新增 drivers: 段(DriversOptions): - directories:Driver Package 目录列表,启动时经 driver_package::scan_directories 扫描校验(driver.json 唯一事实来源, §7),逐包加载 NativePlugin 注册进 NativeDriverFactory——同一 Collector 同时注册多个不同 Driver; - isolation_overrides:部署级隔离覆盖(id → 级别),只允许相同或更 严格(低于 Manifest minimum_isolation 启动即拒);身份元数据不可覆盖; - legacy driver: 段保持反序列化兼容(Option 承载区分显式提供与缺省), 显式提供时打印 COLLECTOR_CONFIG_DRIVER_DEPRECATED 警告并按既有单插件 路径装配(Transitional §41.1);与 drivers.directories 互斥(validate 强制);isolation_overrides 必须配合 directories 使用。 runtime.rs 拆出 synthetic_manifest(Package v2 → ABI v1 加载用 manifest 字段搬运)与 legacy_manifest;Transitional 注记 Host 路径落地后删除。 修复 deploy/profiles/siemens-s7-demo.json 的存量缺陷:bool 属性 plc.motor.running 带 scale=1.0 违反 profile-engine 校验(String/Bytes/ Bool 禁止缩放)——该示例此前从未被测试加载故未暴露。 验收(§37.3):multi_driver.rs e2e——同一 Collector 经 packages 目录 同时注册 modbus-tcp + s7comm 两包并正常启停;互斥/deprecated 标记/ 隔离覆盖偏序单测。门禁全绿:fmt / check --all-targets --all-features / test --workspace --all-features(869 通过 0 失败)/ clippy -D warnings 0 警告;只读构建复验通过。 Refs: docs/FORGLINK_RUNTIME_V2_IMPLEMENTATION_PLAN.md §37.3、§46
Merged
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.
内容(方案 §37.3 Phase 2,§8/§41.1)
Collector 配置新增
drivers:段directories:Driver Package 目录列表。启动时经driver_package::scan_directories扫描校验(driver.json 唯一事实来源),逐包加载 NativePlugin 注册进 NativeDriverFactory——同一 Collector 同时注册多个不同 Driver。isolation_overrides:部署级隔离覆盖(driver id → 级别)。只允许相同或更严格——低于 Manifestminimum_isolation启动即拒;身份元数据不可覆盖(§8)。driver:兼容(Transitional §41.1):内部改 Option 承载以区分显式提供与缺省;显式提供时打印COLLECTOR_CONFIG_DRIVER_DEPRECATED并按既有单插件路径装配(synthetic manifest 转换);与drivers.directories互斥(validate 强制);isolation_overrides必须配合 directories 使用。存量缺陷修复
deploy/profiles/siemens-s7-demo.json的 bool 属性plc.motor.running带 scale=1.0,违反 profile-engine 校验规则(String/Bytes/Bool 禁止缩放)——该示例此前从未被测试加载故未暴露,本 PR 的多 Driver 测试首次引用它时发现并修复。验收与门禁(§37.3、§39)
tests/multi_driver.rse2e:packages 目录同时注册 modbus-tcp + s7comm 两包,Collector 正常启停driver:可转换并打印 deprecated ✅(既有 e2e 全部继续走该路径回归通过)cargo check -p collector --no-default-features --features collector✅Transitional 说明
legacy
driver:段按 §41.1 保留一个过渡版本,下一 major 删除;synthetic_manifest/legacy_manifest 转换函数在 Host 路径落地(Phase 7+)后随 direct ABI v1 runtime 一并删除。Refs: docs/FORGLINK_RUNTIME_V2_IMPLEMENTATION_PLAN.md §37.3、§46