fix(doctor): report unavailable channels and computer-use share - #195
Open
titanwings wants to merge 2 commits into
Open
titanwings wants to merge 2 commits into
titanwings wants to merge 2 commits into
Conversation
Doctor lists CHANNELS that lack <ch>_config.json and reports ledger provenance buckets including computer-use.
Keep PLANNED empty. Doctor lists feishu, slack, dingtalk, and x when those config files are missing.
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.
Why
doctor --json的unavailable来自空的PLANNED表,所以永远是[]。本机到底能不能采集某个渠道,回执不说。账本里 note、本地 harvest、browser 采集和 API 采集的占比也不出现。CONTRACT §1 要求 doctor 报不可用渠道和 computer-use 占比。T48 因此一直红。数据形状如下。
HOME与空DISTILLY_HOMEdoctor --jsonunavailable恰好四条:feishu、slack、dingtalk、x。每条{channel, reason}。reason 以no credential at开头,并含feishu_config.json等文件名slack_config.jsondoctor --jsonunavailable不含 slack,其余三条仍在notedoctor --jsonprovenance.model-read.entries为 1。model-read、browser、api、file四类share之和为 1。JSON 能被/computer[-_ ]?use/i命中doctor --jsonprovenance四类 entries 与 share 都是 0。退出 0--require-shapedoctor --require-shape --jsonok为 false,shape[0].verdict为 FAIL。unavailable仍在。退出码只由 shape 决定Scope
只改
unavailable的来源,并新增provenance统计。unavailable由credentialed.mjs的CHANNELS表乘DISTILLY_HOME(否则~/.distilly)下<ch>_config.json是否存在得出。doctor 在run里动态import("./credentialed.mjs"),不在模块顶层 import。credentialed.mjs只把const CHANNELS改成export const CHANNELS。provenance按账本method与credentialed分成model-read、browser、api、file四类,报告 entries、bytes、share。note的 method 是model-read。harvest 本地文件走file。credentialed且 method 含 browser 的走browser。其余凭据采集走api。browser一类就是 computer-use 占比,回执另有computer-use键,指向同一对象。人读输出保留
Unavailable / 未实现一行,另加Provenance / 来源一行。退出码仍只由悬空锚点与--require-shape决定。不改
corpusShape。不改deliveredAnchors。不改 collect 路由、--mode或 help 文案。tests/doctor-coverage.test.mjs加无凭据渠道与占比两条用例。A7 补进两份测试。只改
unavailable断言与过时注释。Object.keys(PLANNED)为空保持。tests/commands.test.mjs。渠道列表改为["feishu","slack","dingtalk","x"]。tests/note.test.mjs。unavailable改为四条{channel, reason},reason 含对应配置文件名。tests/gates/baseline/audit-tests.txt只删这一行。该行对应
tests/audit/retrospect-doctor.test.mjs的 T48。删前数据行 16,删后 15。没有删 R08、R21、R23、R28、R56、R58。Blast Radius
空 HOME 下
doctor --json的unavailable从[]变成四条渠道。这是要修的行为。有配置文件的渠道不会出现在列表里。已 harvest 的 text 与账本不用迁移。--require-shape与悬空锚点的退出码不变。面试语料形状仍 PASS。us-house harvest 后--require-shape仍 FAIL,exit 1。栈停在 dot-skill-test,dot-skill 保留。
Verification
T48 由红转绿。基线从 16 行减到 15 行。
改前,Node v22.14.0,HEAD d05717b:
T48 失败原文:
新用例在 base 上失败。
doctor lists every CHANNELS channel this machine has no credential file for:doctor reports model-read entries and a computer-use share whose four buckets sum to 1:改后,Node v22.14.0,HEAD 57ffcbf:
改后,Node v20.20.2:
node --test tests/doctor-coverage.test.mjs tests/commands.test.mjs tests/note.test.mjs在 Node v22.14.0 上是# tests 33、# fail 0。T48 单独跑# pass 1。node scripts/run-gates.mjs --without playwright在 Node v20.20.2 与 Node v22.14.0 都是8/8 gates passed。unit-tests 是# tests 405、# fail 0、# cancelled 0。DISTILLY_PLAYWRIGHT_ROOT=/tmp/pw-root node scripts/run-gates.mjs --requires playwright在 Node v22.14.0 上是3/3 gates passed。三份语料都是验收结果:18/18 通过。us-house 含FAIL · units=2744 speakers=18 attributed=85。引用上一版实测,本拍未重跑。You see,Node v22.14.0。
node bin/distilly.mjs实测。空 HOME 与空DISTILLY_HOME下doctor --json的unavailable恰好 feishu、slack、dingtalk、x,reason 含feishu_config.json。含一条note的工作区provenance.model-read.entries为 1,四类字节占比之和为 1。无账本工作区四类都是 0,退出 0。us-house--require-shape退出 1,unavailable仍在。人读输出有Unavailable / 未实现与Provenance / 来源两行。doctor 在已 harvest 的 us-house 工作区三次墙钟中位数 68 ms。低于 0.5 秒预算。Rollback
回退 57ffcbf 与 f59b468。已 harvest 的 text 与账本不用迁移。栈停在 dot-skill-test,dot-skill 保留。