Skip to content

signoff-cli 4.8.0:闸门按代价分层

Latest

Choose a tag to compare

@ayuanxx-max ayuanxx-max released this 12 Nov 15:14
· 38 commits to master since this release

闸门按代价分层,反向对照只问「会不会红」。

钩子:提交跑快检,推送跑全套

  • 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-commit runs the p1 fast layer, pre-push and CI run the full suite. The fast
    command comes from .signoff/config.json or package.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 test runs 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.js remains the full serial path and accepts
    SIGNOFF_TIMING=1 to 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 worktree and must go red. Green on both trees is green-on-base; a base checkout where they cannot start
    is reported as cannot-run-on-base instead of pretending the test proved anything. Under SIGNOFF_NC=1 the 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), and signoff tokens answers 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, review and fix now parse git -z instead 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.