test(performance): enforce semantic artifact authority boundary (#19)
CI / lite (push) Successful in 9s

This commit was merged in pull request #19.
This commit is contained in:
2026-09-01 23:12:10 +08:00
parent a724e1e57a
commit 68dd68392a
7 changed files with 3025 additions and 4 deletions
+29
View File
@@ -260,6 +260,35 @@ digest 等价,也不会把旧 run 静默升级为新合同。
`LEGACY_EXPLORATORY`;不能隐式提升为 `CONTRACT_QUALIFIED`。所有资格均只描述离线证据闭合,
不表示投资有效、组合获批、Paper、生产或实盘就绪。
## 绩效证据与方法论合同 v1
`quant_engine.artifact.PerformanceEvidenceV1` 在现有计算和事实表之外增加一层只读、内容寻址的
owner 证据。`build_performance_evidence()` 只接受同一运行的完整 `ResearchRunArtifact`、
`BacktestRunRef` 与 `CONTRACT_QUALIFIED BacktestEvidenceManifest`;它核对全部 artifact 表、
performance 表和唯一行摘要,并绑定 artifact、row 与严格对齐 benchmark series 的独立摘要。
生产 builder 不重算、填补、重命名或覆盖任何绩效值。
方法论固定为日简单收益、252 期年化、绝对指标年化无风险利率 `0.0`、benchmark 日无风险利率
`0.0`,以及 benchmark 存在时的 `exact_session_index`。相对指标使用封闭 availability:无基准为
`benchmark_absent`;active variance、benchmark variance 或 alpha 几何年化域不足时分别使用
对应 `not_estimable_*` 原因。benchmark 存在时 tracking error 始终必须是有限非负值;null 不会
被转成零。
```python
from quant_engine.artifact import build_performance_evidence
performance_evidence = build_performance_evidence(
artifact,
backtest_run_ref,
backtest_evidence_manifest,
)
canonical_bytes = performance_evidence.canonical_bytes()
```
该合同范围固定为 `offline_research_only`。它不授予排名、推荐、决策、发布、论文、Paper、生产、
实盘、交易或投资建议权限,也不包含原始参数、returns、NAV、benchmark series、表字节、存储
locator、URI 或凭证。
## 组合决策与风险评估合同 v1
`quant_engine.portfolio_risk_contracts` 是现有计算 owner 外围的薄合同层。创建