Skip to content

fix(qa): R14 P2 测试基建收口——BUG-07 契约漂移/门禁不干净 + BUG-09 Chrome 诊断被吞 - #7

Open
mycyg wants to merge 2 commits into
mainfrom
r14/test-infra
Open

fix(qa): R14 P2 测试基建收口——BUG-07 契约漂移/门禁不干净 + BUG-09 Chrome 诊断被吞#7
mycyg wants to merge 2 commits into
mainfrom
r14/test-infra

Conversation

@mycyg

@mycyg mycyg commented Jul 15, 2026

Copy link
Copy Markdown
Owner

R14 验收报告两条 P2 测试基建缺陷收口(不改产品行为,不降低任何门禁断言强度)。

BUG-07 契约漂移 + 门禁不干净

① product-shell-baseline 契约漂移:home loader 早已与 attention 并行调用 listProjects()scripts/qa/r4-web-product-shell-baseline.ts 的 fake client 缺该方法,脚本稳定误报 home error。照抄 routes.test.ts 的 fake 补齐;顺带把双语外壳锚点从 R4 时代的「工作入口/当前焦点、Work entry/Focus」更新到 Nav-v2 现行文案(提需求/总览、New request/Overview),同等强度(zh case 必含中文固定外壳、en case 必含英文固定外壳)。

② qa:r5-10-real 适配 option-first:R10 起有候选时首轮澄清返回 single_choice,脚本仍断言 long_text 导致 LLM 调用前失败。现按 R10-0c 契约双形态断言:single_choice → ≥2 个真实候选(id 唯一非空、label 非空),选中推荐项(无推荐则第一项)+ free_text 应答;long_text 诚实退化 → 0 选项;反模板门原样保留。报告证据新增 selected_option_id

③ R14 真库 smoke 隔离:chat smoke 会写「完播率」消息,共享 scratch 库时把 search smoke 的固定命中数从 1 污染到 2。新增 r14-smoke-db.ts:以 workhub_r14_*smoke 命名锚库为锚(命名门与 production 拒跑守卫原样保留),每次运行 CREATE DATABASE workhub_r14_{chat|search}_smoke_<hex> 唯一库,跑完(无论成败)DROP ... WITH (FORCE) 清理;并发建库撞 template 锁带退避重试。

④ verify 可复跑干净pnpm verify 之前每跑一次就改写 docs/.../2026-06-11-r4-rust-system-i18n/ 两个 tracked 审计文件;Chrome live QA 启动即 rm 输出目录,失败中断会删掉 86 个 tracked 截图。生成型审计产物(rust-system-i18n / live-route-interaction / product-shell-baseline)全部改落 gitignored artifacts/qa/,CI 的 evidence 上传路径同步;verify 末尾加 git diff --exit-code,跑完树不干净直接红。docs 下的历史审计快照原样保留不再被覆写。

BUG-09 Chrome CDP 诊断被吞

apps/web/src/chrome-launch.ts 原来 stdio:"ignore" 丢掉 Chrome stderr,启动失败只剩泛化 fetch timeout。现在:

  • 限长(16KiB 尾部)捕获 stderr;
  • 失败错误附完整诊断 JSON:启动参数、chrome --version、退出 code/signal(stopChrome 前快照,不被自己的 SIGTERM 污染)、端口探测轨迹(总次数 + 末 10 条,覆盖「Chrome 存活但 debug 端口不监听」的定位);
  • 子进程在 debug 端口起来前退出 → 立即失败,不再傻等整个 45s 超时窗;
  • 探测 fetch 加 2s AbortSignal 防挂死;
  • 新增 chrome-launch.test.ts 覆盖 fail-fast 与诊断内容,原有超时终止单测语义不变。

验证

  • pnpm verify(typecheck + 全部测试 + lint + git diff --exit-code)本机全绿,跑完树干净。
  • ③:本机 PG 顺序跑 chat → search smoke,three_char_cjk 命中保持 1,唯一库跑完即删无残留。
  • ②:真 DeepSeek key(v4-flash)采样跑 R5_10_REAL_TASK_LIMIT=1:首轮澄清 single_choice 2 候选、选中推荐项、T1 AgentRun succeeded(agent_step+review 齐),成本 ¥0.025。
  • ①:本机 Chrome 处于自动更新过渡态(新起进程一律被系统 SIGKILL,与本 PR 无关),无法本机全跑截图 QA;已用等价方式验证:4 个 case 的 instrumented HTML 在真实浏览器按 QA 精确视口执行页内 instrumentation,marker 门禁全绿(shell/ready/无泄漏/无溢出/双语锚点/endpoint 调用含 attention+listProjects)。Chrome 恢复后 pnpm qa:r4-web-product-shell-baseline 可一键复核。
  • BUG-09:web 单测 2/2 绿(新 fail-fast 用例 + 原超时终止用例)。

🤖 Generated with Claude Code

mycyg and others added 2 commits July 15, 2026 10:48
① r4-web-product-shell-baseline 的 fake client 补 listProjects()(home loader
   已并行拉项目清单,缺失导致稳定误报 home error;照抄 routes.test.ts 的 fake),
   双语外壳锚点更新到 Nav-v2 现行文案(提需求/总览、New request/Overview)。
② qa:r5-10-real 适配 R10 option-first 首轮澄清契约:single_choice 时断言 ≥2 个
   真实候选(id 唯一非空、label 非空)并选中推荐项应答;long_text 诚实退化时断言
   0 选项;反模板门保留。报告新增 selected_option_id 证据。真 key 采样验证通过
   (T1 succeeded,agent_step+review 齐,¥0.025)。
③ R14 chat/search 真库 smoke 各自 CREATE 唯一命名 scratch 库、结束 DROP(FORCE)
   ——互不污染,「完播率」固定命中数断言不再受运行顺序影响。锚库命名门与
   production 拒跑守卫原样保留(r14-smoke-db.ts)。
④ 生成型审计产物(rust-system-i18n / live-route-interaction / product-shell-
   baseline)改落 gitignored artifacts/qa/,CI evidence 上传路径同步;verify 末尾
   加 git diff --exit-code 保证跑完树干净。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stdio:"ignore" 丢 stderr 导致启动失败只剩泛化 fetch timeout。现在限长(16KiB)
保留 stderr 尾部,失败错误附完整诊断:启动参数、Chrome --version、退出
code/signal(stopChrome 前快照,不被自杀 SIGTERM 污染)、端口探测轨迹
(计数+末 10 条);子进程在 debug 端口起来前就退出时立即失败,不再傻等整个
CDP 超时窗。探测 fetch 加 2s AbortSignal 防挂死。新增单测覆盖 fail-fast 与
诊断内容,原有超时终止单测语义保留。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mycyg pushed a commit that referenced this pull request Jul 16, 2026
…ion topic (#7)

emitRunEvent now also publishes the status-level lifecycle subset
(started/failed/escalated + the succeeded terminal agent_run.step[kind:'done'])
to topics.conversation(source_conversation_id) when a run carries one. The army
context panel subscribes to that conversation stream, so a purely-executing run
no longer stalls on the snapshot captured when the conversation was opened.
Per-step high-frequency increments are NOT dual-published (same trade-off as the
workitem stream) to avoid fan-out amplification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mycyg pushed a commit that referenced this pull request Jul 16, 2026
…lldown, background (#7/#8/#19/#20/#21/#32/#33)

Desktop army panel wiring for the G3 gaps:
 - #7  panel refreshes on run lifecycle events forwarded through the conversation
       stream (isIncomingAgentRunLifecycleEvent; new army/events.ts).
 - #8  background-tasks section re-rendered from GET /api/army/background (scheduled
       tasks + proactivity feed), honest loading/error/empty states; lazy-loaded once.
 - #19 abort entry on cancellable run cards + a confirm→busy→status flow in the run
       detail, wired to the existing abortAgentRun (/agent-runs/:id/abort).
 - #20 escalated split out of the wait bucket into its own danger "waiting on you"
       badge + a "handle" action that opens the decision inbox.
 - #21 army-overview cards drill down: selectProject + auto-open the run detail in
       the right pane (openRunId threaded through showForConversation).
 - #32 overview header "loaded N minutes ago" annotation next to the refresh button.
 - #33 returning from run detail to the list re-fetches the conversation panel.

Interactive run cards are restructured to div + inner hit-button + footer actions to
keep action buttons out of nested buttons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant