Files
Agent-System/.doc/test-reports/2026-09-23-chat-semantic-d3-closeout-test-report.md
weichen 8f00c97fae fix(chat): restore D3 semantic shadow under reasoning no-tools
Embed authorized messages in the PI summarizer prompt and recover narrative
from execution.log so MiniMax shadow works without REPLACE. Align chatflow
tests with async S1 drain and record closeout evidence.
2026-09-23 15:13:19 +00:00

4.8 KiB
Raw Permalink Blame History

chat-semantic-d3 收口重验 测试报告

一、 测试背景 (Background)

FEATURE-MATRIX chat-semantic-d3 长期 partial:PU6/W2/S1 已交付 shadow 能力,但声明范围含被 Wave5 X-2 密封的 SEMANTIC_SUMMARY_REPLACE,导致无法收敛。本轮收口:把 REPLACE 义务迁出,对当前 local dev tip 重验 shadow 路径,并修复 reasoning/--no-tools 下真 PI 无法产出叙事的回归。

二、 测试目标 (Test Objectives)

  • go vet / 相关 short 单测 / arch-check block 全绿
  • chatflow 授权可见 + injection 负例对齐 S1 异步 drain 后 PASS
  • 真实 PI Runner + MiniMax 产出 shadow narrative;不含「200万」注入秘密;REPLACE 仍不接线
  • 仓库零放量:SEMANTIC_SUMMARY_SHADOW 默认 off;SEMANTIC_SUMMARY_REPLACE 未接线

三、 测试方案与环境 (Test Plan & Environment)

  • OS:Linux;Go:go1.27.1
  • 分支/worktree:feature/chat-semantic-d3-closeout-2026-09-23 @ base 9d8332ad
  • Runner:http://127.0.0.1:18865,model MiniMax-M2.7-highspeed,DATA_DIR=主目录 data/dev(容器 bind-mount)
  • 层级:单元/表征 + 真实 PI;Playwright digest UI NOT REQUIRED(本行关闭条件不含 UI 替换;依据验证契约「纯工程/既有证据」)
  • 全量 go test ./...:NOT REQUIRED(本轮为 D3 收口与定向修复,非产品 PI 全链路交付;依据 PROJECT.md §8 / 验证契约纯工程范围)

四、 预期结果 (Expected Results)

  • short:flag off/on、fallback、watermark、chatflow injection 负例 PASS
  • live:非空中文 narrative;无「200万」;elapsed 数秒级
  • arch-check --mode block PASS

五、 实际测试结果与判定 (Actual Results & Evaluation)

5.1 go vet + short 语义套件

  • 测试输入 (Input):go vet ./internal/ctxmgr/... ./internal/app/...;go test -short -count=1 ./internal/ctxmgr/ ./internal/app/chatflow/ ./internal/app/ -run 'Semantic|Shadow|Summar|ChatLog_Semantic|PiSemantic|ExtractAssistant'
  • 实际输出 (Actual Output):
ok  	chat-agent-system/internal/ctxmgr	0.015s
ok  	chat-agent-system/internal/app/chatflow	0.009s
ok  	chat-agent-system/internal/app	0.005s
  • 评价判定 (Evaluation / Verdict):PASS
  • 性能与耗时 (Duration & Latency):<1s

5.2 chatflow 异步 drain 对齐(S1 residual)

  • 测试输入 (Input):TestChatLog_SemanticShadowAuthorizedOnlyAndInjectionCannotEscalate(pending → Drain/Wait → ok)
  • 实际输出 (Actual Output):--- PASS: TestChatLog_SemanticShadowAuthorizedOnlyAndInjectionCannotEscalate (0.01s)
  • 评价判定 (Evaluation / Verdict):PASS(修复前失败于 want shadow ok 而实际为 pending)
  • 性能与耗时 (Duration & Latency):~10ms

5.3 真实 PI MiniMax

  • 测试输入 (Input):RUN_PI_E2E=1 go test ./internal/app -run TestPiSemanticSummarizer_LiveMiniMax -v(token 自主目录 .env 注入,不入库)
  • 实际输出 (Actual Output):
=== RUN   TestPiSemanticSummarizer_LiveMiniMax
    semantic_summarizer_test.go:203: model=MiniMax-M2.7-highspeed protocol=semantic-summary-v1 elapsed=4.242s narrative="用户就高频超声手术刀系统的研发立项寻求建议,询问立项相关要点。助手回复指出需要重点关注电气安全要求和产品型检周期两个方面。"
--- PASS: TestPiSemanticSummarizer_LiveMiniMax (4.24s)
  • 评价判定 (Evaluation / Verdict):PASS(未出现「200万」;reasoning 路径经 prompt 内嵌消息 + execution.log 回落叙事)
  • 性能与耗时 (Duration & Latency):4.242s

5.4 arch-check

  • 测试输入 (Input):./scripts/arch-check.sh --mode block
  • 实际输出 (Actual Output):arch-check block: production gate passed
  • 评价判定 (Evaluation / Verdict):PASS
  • 性能与耗时 (Duration & Latency):<1s

5.5 已知非本行失败(记录,不挡收口)

  • TestProductionCompositionHasNoHookRegistration:internal/server/server.go 仍赋值 OnOutbox(与 D3 无关的既有失败;本轮未改 server)

六、 自动化测试套件汇总 (Test Suite Execution)

套件 结果
go vet ctxmgr/app PASS
short 语义相关 PASS
Live MiniMax PASS
arch-check block PASS
全量 go test ./... NOT REQUIRED(见第三节依据)

七、 测试结论与后续优化建议 (Conclusion & Next Steps)

达到 chat-semantic-d3 收窄后的 done 关闭条件。实现修正:PiSemanticSummarizer 在 reasoning/--no-tools 下内嵌授权消息,并从 execution.log 恢复助手叙事(对齐 pi-native)。SEMANTIC_SUMMARY_REPLACE 义务迁至独立 deferred 行 chat-semantic-replace;启用需独立授权 + fail-closed 灰度(Wave5 X-2)。不 push、不晋升、不改 gap-matrix。