Repository navigation
闸门按代价分层,反向对照只问「会不会红」。
钩子:提交跑快检,推送跑全套
signoff init装的三个钩子各司其职:pre-commit跑 p1 的快检层,pre-push与 CI 跑全套。快检入口取自
.signoff/config.json的fast_cmd或package.json的test:fast;两样都没有就退回全套——没声明就没有这一层。.signoff/cache.json的键带上运行模式(fast/full):快检通过不能替推送那一次的全套作保。- 本仓库新增
node test/smoke.js(8 项,约 2.4 s),断言落在真正渲染出的页面 chip 上,不是源码里的字符串。 npm test改成两段并行(test/run-all.js):用例一条没少,全套 93 s → 50 s 量级,推送闸门 126 s → 53 s。
node test/selftest.js仍是完整串行路径,并支持SIGNOFF_TIMING=1排出最慢的 12 条用例。
反向对照:改过的测试必须在旧代码上红
signoff p1 --negative-control 把这次改过的测试文件放进 git worktree 检出的 base 版本里跑一遍,必须红。
两棵树都绿判红(green-on-base),在 base 上跑不起来单列 cannot-run-on-base,不冒充「测出来了」。
推送与 CI 自动带上,只有 touched 非空才付这笔钱,--nc-budget 默认 180 s、超时算红。
它只问「会不会红」,所以套件在 SIGNOFF_NC=1 下第一条红就收工:反向对照 60.4 s → 2.2 s。
界面:金额带词、版面有据可查
- 侧栏与看板的金额一律先出词再出数:中文
费用 $0.02,英文cost $0.02;class="cost"的可见文本都形如费用 $…。 - 看板加「Token 与费用」:累计 token、金额、按天、按任务组、按提交的 agent 花费;
signoff tokens在终端问同一件事。
数据只读本机 DSH 会话记录,金额按 DeepSeek 峰/谷价估算,.signoff/prices.json可覆盖;读不到就写明原因而不是显示 0。 - 新增
docs/DESIGN.md、node tools/ui-shot.js(看板出图)、jsconfig.json+npm run typecheck(运行时依赖仍是零)。
修复(挑要紧的)
- 看板任务组的三个数字取同一个窗口,不再在一句话里自相矛盾。
integrity/review/fix统一走git -z:路径含中文或空格时不再被八进制转义骗成「没有改动」
(删掉tests/测试.test.js的断言曾判 clean,Lib/P1.js曾能覆盖lib/p1.js)。fix回滚不再删掉补丁自己新建、被.gitignore挡住的文件;patterns不再把回滚/被推翻/被拒算成门失败。dispute不再把拼错的命令当证据,--budget带 timeout 与 SIGKILL;uninstall收走新增状态。
English
Gates are layered by cost; the negative control only asks whether a test goes red.
- Hooks now have separate jobs:
pre-commitruns the p1 fast layer,pre-pushand CI run the full suite. The fast
command comes from.signoff/config.jsonorpackage.json; with neither declared the hook falls back to the full
suite instead of waving the commit through. The cache key carries the run mode, so a green fast run cannot stand
in for the full run at push time. npm testruns two shards in parallel (test/run-all.js): no case was dropped, the suite went 93 s → 50 s range,
and the push gate 126 s → 53 s.node test/selftest.jsremains the full serial path and accepts
SIGNOFF_TIMING=1to rank the slowest cases.- New
signoff p1 --negative-control: the test files touched by a change run inside a base version checked out with
git worktreeand must go red. Green on both trees isgreen-on-base; a base checkout where they cannot start
is reported ascannot-run-on-baseinstead of pretending the test proved anything. UnderSIGNOFF_NC=1the suite
stops at the first red, taking the negative control from 60.4 s to 2.2 s. - Amounts always carry a label first (
费用 $0.02/cost $0.02); the board gains a "Token and cost" block fed by
this machine's DSH session records (read-only, no network), andsignoff tokensanswers the same question in the
terminal. When the records are unreadable the block says why instead of showing 0. - New
docs/DESIGN.md,node tools/ui-shot.js,jsconfig.json+npm run typecheck; runtime dependencies stay zero. integrity,reviewandfixnow parsegit -zinstead of human-readable output: paths with Chinese characters
or spaces no longer look like "nothing changed". Rollback, refutation and rejection are recorded as tool outcomes,
not gate failures.
Full self-test: 619 passed / 0 failed. Published from GitHub Actions with a provenance attestation.