docs(testing): record compaction fixture calibration

This commit is contained in:
Tianyi Cui committed 2026-09-12 15:02:37 +08:00
1 parent 65236780d1
commit ff03531b97
3 files changed
+4 -4

No files matched your search

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/testing/2026-09-12-connection-and-compaction-fixture-preconditions.md
2026-09-12-connection-and-compaction-fixture-preconditions.md: 8e00ffb1f3c101f6c6b329a8e6d96928dea4ff34
2026-09-12-connection-and-compaction-fixture-preconditions.zh.md: d77b992a6974ca70ffd04156f43e4a510d051e60
2026-09-12-connection-and-compaction-fixture-preconditions.md: 9b97657c7742bb37a8a70b04350d5e6b43868f6c
2026-09-12-connection-and-compaction-fixture-preconditions.zh.md: bc73a0e84ab4f60b7f3091f60a5217dcc950cb20
@@ -12,7 +12,7 @@ A reconnect label can appear while its hover color is still transitioning. Compa
The [connection recovery test](../../../../apps/web/tests/lifecycle-chrome.e2e.ts) reads the warning color tokens from an independent element, then polls the indicator's computed foreground and background until both equal those tokens. Browser CSS transitions use a different clock from the mocked JavaScript retry timers. This follows the [fixture completion decision](2026-09-08-ci-completion-observations.md): an intermediate visual state cannot satisfy the final assertion.
The [compaction smoke](../../../../apps/cli/tests/profiles/headless/tests/compaction.e2e.ts) completes each file-reading turn before submitting the next. Older file results are large enough to compress, and the synthetic context window permits more than the fixed prompt overhead. Separate completed turns prevent all four reads from becoming one retained tool group. Failure output includes the recorded compaction errors, while the test still requires a summary, replaced history, and a final answer.
The [compaction smoke](../../../../apps/cli/tests/profiles/headless/tests/compaction.e2e.ts) completes each file-reading turn before submitting the next. Each file contains 200 repetitions of its numbered sentence (4,600 characters). The 8,000-token synthetic context window triggers compaction at 50% usage, leaving a 4,000-token pressure threshold. In a fixture measurement, one completed read used 2,738 request tokens, including 1,274 tokens outside the conversation surface. A failing calibration run selected about 60 tokens of initial instruction but produced a 475-token framed checkpoint; the runtime correctly rejected that larger replacement. Separate completed turns prevent all four reads from becoming one retained tool group. Failure output includes the recorded compaction errors, while the test still requires a summary, replaced history, and a final answer.
## Alternatives considered
@@ -12,7 +12,7 @@ Status: implemented
[连接恢复测试](../../../../apps/web/tests/lifecycle-chrome.e2e.ts) 从独立元素读取警告颜色 token,再轮询指示器计算后的前景色与背景色,直到两者都等于相应 token。浏览器 CSS 过渡与被模拟的 JavaScript 重试计时器使用不同的时钟。这遵循[夹具完成条件决策](2026-09-08-ci-completion-observations.zh.md):中间视觉状态不能满足最终断言。
[压缩冒烟测试](../../../../apps/cli/tests/profiles/headless/tests/compaction.e2e.ts) 完成每一轮文件读取后才提交下一轮。较旧的文件结果足够大,能够被压缩;合成上下文窗口也为固定提示开销以外的内容留出空间。分开的已完成轮次避免四次读取全部成为一个被保留的工具组。失败输出包含已记录的压缩错误,同时测试仍要求产生摘要、替换历史并给出最终回答。
[压缩冒烟测试](../../../../apps/cli/tests/profiles/headless/tests/compaction.e2e.ts) 完成每一轮文件读取后才提交下一轮。每个文件将包含编号的句子重复 200 次,共 4,600 个字符。8,000 token 的合成上下文窗口在用量达到 50% 时触发压缩,因此压力阈值为 4,000 token。一次夹具测量中,完成一次读取后的请求用了 2,738 token,其中 1,274 token 位于对话 surface 之外。一次失败的校准运行选中了约 60 token 的初始指令,却生成了包含格式在内的 475 token 检查点;运行时正确拒绝了这个更大的替换。分开的已完成轮次避免四次读取全部成为一个被保留的工具组。失败输出包含已记录的压缩错误,同时测试仍要求产生摘要、替换历史并给出最终回答。
## Alternatives considered