docs: record deterministic reasoning contract validation

This commit is contained in:
2026-09-09 01:39:13 -04:00
parent c710c3a7ec
commit 16fa0ca474
5 changed files with 88 additions and 8 deletions
@@ -7,7 +7,7 @@ date: 2026-09-09
# 1.3.4 推理契约与测试证据实施计划
> 日期:2026-09-09。状态:**自审及 Codex 独立计划审查通过(复审 run ea38c3a7-12ef-4bf0-bb04-257ce37eb96f),进入执行;尚未编码/执行验收**。
> 日期:2026-09-09。状态:**自审及 Codex 独立计划审查通过(复审 run ea38c3a7-12ef-4bf0-bb04-257ce37eb96f),T0–T4、T7 已实现并通过确定性验证;T5/T6/T8/T9 待执行**。
> 设计:`research-wiki/designs/2026-09-09-134-thinking-contracts-design.md`,用户已正式批准。
> 目标:解决 #21 的受管推理语义漏洞、#25 的测试归因漏洞、#26 的客户端遥测守卫缺口,不扩展生产端口或遥测 schema。
> 方案:在既有推理决策层添加窄校验并接入工厂/默认 transport;测试侧独立保留请求与响应证据,按明确命题判定覆盖。缓存仍由下游显式迁移,生产治理循环不重写。
@@ -184,7 +184,7 @@ T5 按 `(session_id, parent_call_id) → AttemptEvidence.call_id → HttpEvidenc
**验证**`conda run -n PolyGateway pytest tests/unit/test_thinking.py tests/unit/test_providers.py -q`;新拒绝和 wire 回归先红后绿,其余保留行为通过。若旧下游形态测试依赖 M3 True,需要在 T3 明确改为已批准迁移样本,不能暗改能力表让它绿。
- [ ] 提交点:`fix: enforce registered auto reasoning capabilities`
- [x] 提交点:`fix: enforce registered auto reasoning capabilities`
### T2:纯 wireraw 所有权校验
@@ -202,7 +202,7 @@ T5 按 `(session_id, parent_call_id) → AttemptEvidence.call_id → HttpEvidenc
**验证**`conda run -n PolyGateway pytest tests/unit/test_thinking.py -q`,每类目标反例有有效红绿,保留行为绿。
- [ ] 提交点:`fix: validate ownership of managed reasoning parameters`
- [x] 提交点:`fix: validate ownership of managed reasoning parameters`
### T3:接入工厂、请求入口和默认 transport
@@ -225,7 +225,7 @@ T5 按 `(session_id, parent_call_id) → AttemptEvidence.call_id → HttpEvidenc
**验证**`conda run -n PolyGateway pytest tests/unit/test_client.py tests/unit/test_config.py tests/unit/test_openai_compat.py tests/unit/test_retry.py -q`,加 T1/T2 的测试一起跑;工厂/请求/全量注入拒绝均有旧实现红、新实现绿。
- [ ] 提交点:`fix: reject conflicting raw reasoning overrides before sending`
- [x] 提交点:`fix: reject conflicting raw reasoning overrides before sending`
### T4:显式缓存迁移和四种遥测口径回归
@@ -247,7 +247,7 @@ T5 按 `(session_id, parent_call_id) → AttemptEvidence.call_id → HttpEvidenc
**验证**`conda run -n PolyGateway pytest tests/unit/test_cache.py tests/unit/test_client.py tests/unit/test_telemetry.py -q`。两项新增能力/wire 迁移节点均置于 `tests/unit/test_cache.py::TestExplicitCacheMigration`,单跑 `conda run -n PolyGateway pytest tests/unit/test_cache.py::TestExplicitCacheMigration -q`;分别在隔离副本去掉其 namespace/salt 隔离输入,必须因没有新拒绝/新 wire 而红,恢复后绿,不能只以 nearest→error 的测试代替这两类。两客户端的源指纹必须断言相等,生产指纹算法一字不改。
- [ ] 提交点:`test: pin explicit cache migration and reasoning row semantics`
- [x] 提交点:`test: pin explicit cache migration and reasoning row semantics`
### T5:有限测试归因和独立取证
@@ -307,7 +307,7 @@ chat 阳性走真实 RetryMWemitterTrue 糖失败 auto、显式请求失
**验证**`conda run -n PolyGateway pytest tests/unit/test_embedding.py tests/unit/test_ocr_client.py tests/unit/test_telemetry.py tests/unit/test_monkey_ocr.py tests/unit/test_retry.py -q`,再执行上表隔离变异;原实现绿、四类有效红、还原绿。
- [ ] 提交点:`test: guard reasoning-free telemetry through real client paths`
- [x] 提交点:`test: guard reasoning-free telemetry through real client paths`
### T8:文档、日志登记与独立验证
@@ -375,3 +375,7 @@ chat 阳性走真实 RetryMWemitterTrue 糖失败 auto、显式请求失
自审已核对:生产守卫所有消费者在 §3 定义;新增测试文件有确定路径;conftest 当前不存在故明确新建;默认工厂不支持 transport 注入故使用已批准全量注入而非偷扩 API;缓存不改指纹;无从公共 model_reported 倒推上游身份;所有命令均在 conda 环境;未执行的测试不写为已通过。
计划审查由父会话组织,完成后直接实施,不新增人类计划审批门。执行中本文件任务勾选与 finding 保持实际状态一致;本次计划编写未运行 pytest、变异或真实模型调用。
## 本轮实施证据
T0–T4/T7 的命令、实际失败与修复、11 个隔离变异及 1241 项单测通过,见 `findings/2026-09-09-134-thinking-contracts-validation.md`。未执行 live、集成和发布,T5/T6 的测试支持文件未创建。