aps-agent/docs/round-78-sobol-sensitivity-...

33 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Round 78 Sobol 全局敏感性记录
## 已完成
- 新增独立 `run_sobol_sensitivity`,保持既有 CRITICAL `run_sensitivity` 签名和返回契约不变。
- 使用 `scipy.stats.qmc.Sobol` 的 2d scrambled 采样和 Jansen 一阶/总效应估计;5 个因子、8/16/32/64 基础样本,对应 56/112/224/448 次沙盒评估。
- `startDate` 必须显式提供或来自 `world.businessDate`,结果保留日期和来源;同 world/seed/date 可复现,不依赖墙钟日期。
- 每次求解前调用 `JobRecord.raise_if_cancelled`;`sobol.recompute` 在创建线程前严格校验样本数、seed、metric、strategy 和 ISO 日期,非法输入返回 422。
- JobQueue 继续按认证 actor、tenant、project 隔离;Web 异步任务页提供日期、样本数、指标控件和 Sobol 结果表。
- 零方差不再伪装为指数 0:一阶/总效应/交互和排名返回 `null`,Web 显示“指标无方差,Sobol 指数不可识别”。
## 依赖与冻结产物
- `pyproject.toml`、`requirements.txt` 与 `packaging/requirements-sidecar.lock` 同步 SciPy;锁文件由固定 `uv pip compile` 命令重建并通过 require-hashes dry-run。
- Sidecar 原生探针导入 SciPy/qmc,并校验确定性 4 点 Sobol 序列。
- 首次真实冻结构建发现 `_sobol_direction_numbers.npz` 未进入 PyInstaller 产物;probe stderr 出现 `FileNotFoundError`,该构建不作为通过证据。
- `aps-sidecar.spec` 精确收集该 npz 后第二次构建通过;冻结 EXE 输出 `APS_NATIVE_PROBE_OK ... scipy=1.18.0`,无缺文件异常,冻结健康冒烟通过。
## 验收
- Sobol + Sidecar focused:61 passed;Sobol 相邻回归:62 passed;Node:60 passed;Web build:PASS。
- 浏览器真实路径:设置 -> 算法 Skill -> 异步任务,提交 8 基础样本/延期指标,任务完成并显示 56 次评估、因子表和退化告警;新标签 console warning/error 为 0。
- 独立复审初次发现 1 P1/3 P2,全部修复后 `AUDIT PASS`;冻结打包修复另行复审。
- 全量黄金:1381 passed / 2 warnings(479.71 秒);Node 60 passed;Web build 通过。
- 四个受保护业务文件 SHA-256 前后不变;GitNexus 13,553 nodes / 62,789 edges / 601 clusters / 300 flows,`compare main` 累计 CRITICAL(66 files / 535 symbols / 90 flows)。
## 边界
- Sobol 结果是 Explore 沙盒中的有限样本估计;指数可能因有限样本超出 `[0,1]`,不裁剪、不冒充精确因果贡献。
- 真实 LP/CP 对偶影子价仍需线性化模型重解与现场业务校准。
- 干净离线 Windows、签名、Defender 实时策略、真实 CI 与厂商系统联调仍需外部环境或授权。
- 未 commit、push、merge 或 publish。