docs: 记录 Target 派单输出收敛
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Failed
Pipelines as Code CI / platform-infra-gitea-nc01- Success
Pipelines as Code CI / unidesk-host- Success

This commit is contained in:
Codex
2026-07-13 09:59:47 +02:00
parent d5a6a4f43c
commit f5e5f937b1
@@ -0,0 +1,55 @@
# R6.4 任务报告
## 结论
Target 单命令 live 输出已在 PR #1916 中改为同源有界投影。默认 human、显式 JSON 与 YAML 不再嵌入完整 task、prompt、payload 或 Aipod 对象,同时保留派单身份、状态、决策和可直接执行的下钻命令。
任务保持处理中,等待主代理审查、合并与真实运行面复测后再完成。
## 根因
- `renderMutationSummary()` 对 JSON/YAML 直接序列化 auto-dispatch 原始结果;
- 原始结果包含完整 task、run、command、latestAttempt、prompt、payload 与 Aipod
- 外层 Target trans 重新渲染后超过 YAML-first `output.maxStdoutBytes=10240`
- stdout guard 因而用 `stdout-text-bytes-exceeded-threshold` 替换整个结果,导致 task/run/session identity 丢失。
## 实现
- 新增 `scripts/src/agentrun/target-task-output.ts`
- 只对 Target live 的 `dispatched``idempotent-replay``concurrent-replay` 生效;
- 输出 task、attempt、run、command、runner、session identity 与 state
- 输出 auto-dispatch decision、Target/MDTODO 摘要;
- 输出 Aipod 与 provider/tool SecretRef presence 摘要;
- 输出绑定本次 identity 并继承 Target/lane 的 `Next` 命令;
- 对字符串和 credential 列表限界,并在裁剪前移除仓库 URL userinfo
- `scripts/src/agentrun/render.ts` 让默认 human、JSON 与 YAML 共用紧凑事实;
- `--raw` 继续保留显式完整服务端对象语义;
- target-trans 与 auto-dispatch 的提交、幂等和恢复逻辑没有修改;
- CLI 参考已同步到 `.agents/skills/unidesk-code-queue/references/resources.md`
## 回归与证据
- 命令:`bun test scripts/src/agentrun.test.ts`
- 结果:21 pass、0 fail、445 assertions
- 新回归构造超过 10 KiB 的 prompt,并覆盖默认 human、`-o json``-o yaml`
- 代表性原始 JSON93,322 B
- 默认 human1,959 B
- JSON5,385 B
- YAML3,282 B
- 三种输出均保留六类 identity,不包含测试 prompt 或 URL credential
- `git diff --check` 通过。
## 交付
- 分支:`fix/artificer-compact-output`
- commit`49b45ed868eca3dae4b305b59d709a5c10cf388e`
- PRhttps://github.com/pikasTech/unidesk/pull/1916
- 未合并、未部署;
- 未触碰正在运行的 selfmedia task 或其业务 worktree。
## 后续验收
- 主代理按受控 PR 流程完成审查与合并;
- 自动交付后重新执行 Target live canary
- 验证外层结果不再出现 `stdout-text-bytes-exceeded-threshold`
- 验证真实 task、run、session identity 与 id-specific `Next` 可见。