Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)

未关闭 适合新手
#1,219 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
90/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, github-actions, shell

调研方向

阅读 docs/adoption.md 中的传感器契约,然后检查 do-harness.toml 和 tests/do-harness-path-selection.bats。更新配置及其路径选择断言,使其使用当前的 [[sensors]] 模式,同时保持离线路径与 CI 路径筛选器之间的对齐。完成的标准是 do-harness explain --changed 能够解析该文件,schema-version 为 1,并且路径选择测试通过。

由索引模型根据 Issue 内容生成。

描述

chore config priority: low

Summary

do-harness.toml uses the legacy [sensors.<name>] map shape. The current do-harness CLI (v0.6.0) rejects it:

$ do-harness explain --changed
error: invalid config file do-harness.toml: TOML parse error at line 7, column 2
7 | [sensors.feedback]
  |  ^^^^^^^
invalid type: map, expected a sequence

do-harness migrate cannot fix it automatically (--write refuses: "refuses conflicts it cannot resolve"); its dry run only offers schema-version = 1, which still leaves the map-vs-sequence mismatch.

Required change

  1. Rewrite do-harness.toml to the [[sensors]] array contract (name, argv, when-changed, severity, timeout per docs/adoption.md):
    • command = "pnpm run lint && ..." becomes argv = ["bash", "-lc", "pnpm run lint && ..."] (argv is executed without a shell).
    • paths maps to when-changed globs.
    • Name the advisory/lifecycle semantics explicitly (severity = "warn" for advisory sensors, --strict behavior documented).
  2. Update tests/do-harness-path-selection.bats, which asserts the old shape (tomllib.load(f).get("sensors", {}) + s in sensors): with [[sensors]], tomllib yields a list, so the membership assertion must index by name instead.
  3. Keep the offline-paths ↔ CI path-filter alignment assertions green (do-harness-path-selection.bats checks alignment with the CI workflow's path filters).
  4. Bump schema-version to 1 in the same change.

Impact

  • Unblocks the entire do-harness CLI workflow (verify, explain, status, hook install) in this repository; today every command exits with a config error.
  • No behavior change to CI; the file feeds only the local agent harness.

References

主要语言
TypeScript
星标
3
派生
2
平均合并
11 小时 49 分钟
30 天内合并 PR
102

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

d-oit/do-knowledge-studio 的其他 Issue

查看 d-oit/do-knowledge-studio 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。