Skip to content

feat(datasource): 重构 Provider 数据链并移除 Dataset - #237

Merged
ohfei merged 18 commits into
mainfrom
codex/issue-234-datasource-refactor
Sep 1, 2026
Merged

feat(datasource): 重构 Provider 数据链并移除 Dataset#237
ohfei merged 18 commits into
mainfrom
codex/issue-234-datasource-refactor

Conversation

@ohfei

@ohfei ohfei commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

关联 issue

Closes #234
#236 已合入 main。

当前 base 为 main,diff 只包含 #234 的 datasource 重构与修复 commits。

SDD 摘要

问题:旧 Dataset、kat import、required_tables、Context 数据方法和原生 datasource 执行面与 PACK-owned Provider → dp.Table → Run Output 架构并存,形成两套数据模型和重复运行时职责。

非目标:不提供 Provider registry、统一基类、自动发现、生命周期托管、透明远端 federation、通用 Decoder trait、恢复协议或 datasource CLI。

考虑过的方案:保留 Dataset 作为兼容层;在 Framework 中统一托管 Provider;一次性删除旧执行面并让 PACK 显式拥有来源语义。

选中方案:Datasource Provider 保持 PACK 内普通 Python 类,由 Workflow 显式构造和调用;KAT 只提供 dataprovider Toolkit、严格 Table Output、独立 kat-datasource Hitrace wheel,以及双 wheel Payload 交付链。

最小切片:

  • 删除 kat import、Dataset CLI/存储/授权/transport、required_tables、Context 数据方法、DataFrame Output 与统一 Clock execution。
  • 两个 OpenHarmony PACK 各自提供只读 Trace Streamer SQLite Provider。
  • kat/platform/datasource 收窄为 Hitrace native decode,保留 descriptor-derived ftrace/native-hook relations 与 clock relations,退役根级规范化 sched_switch,并发布独立 kat-datasource wheel。
  • 保留 CPU、Disk I/O、GPU、Memory、Network、Process 的真实插件 Proto 格式资产;它们暂不编译,也不形成首版公共支持承诺。
  • Windows/Linux Payload 显式校验并安装两个无相互依赖的 wheel。
  • 候选 smoke 执行 Hitrace decode → Provider/dp.open → Inspect → kat test → Run Output → kat query NDJSON。

验证证据

本地实际执行并通过:

  • cargo test --locked --workspace
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • Workflow Python 契约:91 passed,207 subtests
  • Build 契约:57 passed,4 个 Windows 符号链接权限用例 skipped
  • kat-openharmony-thread-cpu-time:10 passed
  • kat-openharmony-critical-path:31 passed
  • 独立 kat-datasource wheel API:8 passed
  • 13 个未启用插件 Proto 与 main 内容逐字节一致,且未进入 build roots;kat-datasource Rust 合同 17/17 passed,覆盖 descriptor-derived Ftrace、Native Hook、clock relation、逐值与跨 flush 合同
  • pip check:No broken requirements found
  • Windows 实际 Payload:Inspect → kat test → Run → Query 全链成功,Query 返回原生对象行 NDJSON
  • kat-cli 与 kat-datasource 的禁止依赖门禁均为 absent
  • Standards / Spec 双轴终审:共享 framing 重复、relation 键链与逐值覆盖 finding 均已修复并复核关闭,无剩余代码、测试或验收 finding
  • Full CI 已移除不存在的 protobuf-source-contract-fixture feature;本地未触发 Full CI
  • git diff --check 通过,工作树洁净,PR diff 不包含 docs/sdd 或 docs/adr

本地产物:

  • kat-datasource 0.1.1rc1 Windows wheel SHA-256:D23106B3611226778774F47D4578FEB793D28A4C1C5616C2037AD0185187D743
  • kat-workflow 0.1.1rc1 wheel SHA-256:54AE474CED8FEECEA219B4131D48127FB6923A7E3809D875D368D1CC749F1003

本地未运行 Full CI;Docker Desktop 后端不可用,因此 Linux 候选归档的真实 smoke 由本 PR 的 GitHub Linux runner 门禁完成,不能用 Windows 结果替代。

领域文档边界:旧 accepted ADR 中仍有 Dataset/query/Clock 描述与新架构冲突。按本次交付约束,本 PR 不混入 SDD/ADR Markdown;这些状态关系需通过独立领域文档维护收口。

范围自检

  • 本 PR 没有引入临时 probe、本地调试程序、AI 中间产物或 generated dump。
  • 本 PR 没有引入未经 issue 批准的 UI、服务、命令或其他交付面。
  • 本 PR 没有把未验证 parser、format 或实验能力接入 production path。
  • 本 PR 的实际改动范围与 issue 中的预计文件 / 模块一致。
  • 本 PR 虽然删除面较大,但旧 Dataset/native 执行面的生产依赖、调用者、测试与 Payload 必须原子收口;重构 kat query 为 Run Output 原生 NDJSON 查询 #233 query 已拆为前置 PR,没有再把独立功能混入本 PR。
  • PR Guard:本次有意的大范围删除与二进制 fixture 删除已分别通过 approved-large-changeapproved-binary-artifact 显式批准。

最新 main 融合验证(481efd7)

已同步 main@b556784(含 #238 Agent Knowledge / Workflow 与 Provider inspection),并保留 #234 的无 Dataset、PACK-owned Provider、严格 dp.Table Output 合同。

最终融合树本地验证:

  • cargo check --workspace --locked 通过。
  • kat-cli 受影响合同:import 1、inspect 12、query 5、run 1、test 9,全部通过;平台/完整 Payload 专属用例按声明 ignored。
  • Workflow Python 全套:101/101 passed。
  • Build 全套:53 passed、4 个 Windows 符号链接权限用例 skipped(共 57)。
  • Bundled PACK:critical-path 32/32、thread-cpu-time 11/11;local-parquet-fusion 6/6。
  • 两个 Bundled TraceStreamerSQLiteProvider 的 declaration、guide 与真实 Provider inspection 均通过。
  • PR Guard 单测 19/19;真实 origin/main..HEADapproved-large-changeapproved-binary-artifact 下 PASS,AI identity 命中 0。
  • cargo fmt --all -- --checkgit diff --check、冲突标记/未解决索引/未跟踪生成物检查均通过。

本轮按约定未触发 Full CI。

@ohfei
ohfei requested a review from maokelong as a code owner August 31, 2026 11:05
@ohfei
ohfei changed the base branch from codex/issue-233-output-query to main August 31, 2026 14:58
@ohfei ohfei added approved-large-change approved-binary-artifact 允许有意提交的二进制产物。 labels Sep 1, 2026
shijifei and others added 6 commits September 1, 2026 10:13
🤖 AI[96%] 🔧 Human Fixed[0%] 🧑 Human[4%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
@ohfei
ohfei force-pushed the codex/issue-234-datasource-refactor branch from b5c9b1e to a3f7c85 Compare September 1, 2026 02:15
@ohfei
ohfei changed the base branch from main to codex/issue-233-output-query September 1, 2026 02:17
@ohfei
ohfei changed the base branch from codex/issue-233-output-query to main September 1, 2026 02:17
shijifei and others added 11 commits September 1, 2026 10:41
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[98%] 🔧 Human Fixed[0%] 🧑 Human[2%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[97%] 🔧 Human Fixed[0%] 🧑 Human[3%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
@ohfei ohfei added the full-ci 运行双平台完整 CI label Sep 1, 2026
🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%]
Co-authored-by: codex (gpt-5.6-sol) <ai@local>
@ohfei
ohfei merged commit a1c1a99 into main Sep 1, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-binary-artifact 允许有意提交的二进制产物。 approved-large-change full-ci 运行双平台完整 CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

重构 kat datasource 并删除旧 Dataset 执行面

1 participant