test(status): fix observation clock for collection parity - #5157
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed exact head: 5157@6b567900fc0dbb519b4502186c6a914558f170de; base: 96a3b90f41094bd2ddea7263b9c7ee37371a9c3b. No blocking finding at this unchanged head. GitHub CI was not consulted under the current repository policy.
English verdict: APPROVE
动机
完整公共测试与隔离的真实复现都发现状态 wrapper 对比失败:两次读取使用不同的源读取时间,已有 envelope 的 staleness 随耗时变化,即使 registry、Todo 和实际状态未变化也不能相等。失败观察已保留。这是原有验证输入不稳定,不能通过排除更多 freshness 字段、重复执行直到绿或改变生产时钟来处理。
改动思路
只在既有 fixture 的两次调用期间固定 collection 的观察时钟;仍执行真实 wrapper、read model、源读取及 TypeScript envelope reducer。原完整 payload 比较、generated_at 的已有处理以及 orchestration、attention、Todo 断言全部保留。固定的是对比输入,没有修改生产时钟、age/freshness 规则、状态、权限、协议、默认行为或超时。测试范围退出后恢复原时钟,不引入新的验证框架。
具体改动
一个现有 smoke、10 行增加和5行删除。完整原生 smoke 通过,scope 中真实 wrapper/direct read 相等;另在真实 wrapper 输出上分别篡改 fresh 和 coverage.complete,原比较均拒绝,而且函数 identity 在退出后恢复。Ruff、完整 diff hygiene、精确差异质量回执与 6 项 native premerge 全部通过。改变的只是测试时钟;App、Lark、CLI 设置和首屏没有改变,也不存在缺少 companion 的产品交付。原来的失败 fleet 不作为通过的发布资格。
对主干的风险
最强风险是用字段归一化掩盖真正的状态或 freshness 退化。本 diff 没有新增任何 scrub 字段,数值 staleness、age、fresh、alert、coverage 和 complete 均留在原比较中;两次语义字段故障注入明确失败。只 mock 已有观察时间,实际状态和 native reducer 没有被替身提供。完整一文件差异及当前 owning collection/envelope 边界已经读过;没有新的 prose 分类、域专属义务、激活方式或 authority。固定时钟与其他状态逻辑不共享持久状态,也不向生产泄漏。最终发布全量资格仍需在集成后的同一干净提交执行。
我的整体评价
这是一个完整、独立可审阅且可撤回的测试维护修复,解决已重现的发布假失败,保持持久有效的 native status parity 价值。future-facing pass 用已有时钟 seam 收紧对比输入,避免 volatile exclusions 和 timing retry 继续积累;无需新 helper 或扩大生产重构。按低风险测试规则,该 exact head 可在已发布审阅和原生 readiness 通过后合入。当前授权发布操作仍需完成最终源码的八项资格以及真实分发读回,不能用本 PR 通过代替发布完成。
The status collection parity smoke compares two separate reads of the same fixture. Source read timestamps and their derived staleness can differ as wall time advances, producing false release failures.
Fix the observation clock only inside the paired fixture calls. Keep the real wrapper/read-model calls, TypeScript envelope calculation and complete payload comparison; do not scrub freshness, staleness, alerts or coverage fields. No product behavior, state, protocol or timeout change.
Validation: the complete native smoke passes. Separate mutations to fresh and coverage.complete still fail the comparison, and the original clock is restored afterward. Ruff and diff hygiene pass. The original failure was reproduced through the real boundary; full release qualification remains separate.