# HCGM 多论文 Unit Selection 实验语义审计

> 状态：2026-07-17 active audit。审计覆盖 Learning DiscoSCM、Unit
> Mechanism Learning、Causal Regression、binary treatment、continuous
> treatment、Token Causation 与 response-function review。
>
> Machine guard：`HCGM-UNIT-SEMANTICS-CONTRACT-V1`

## 结论先行

这轮审计没有发现“所有旧实验都因为写成 $U_i$ 而失效”。真正的结果分三类：

1. **Learning DiscoSCM selected-token 存在实质性的 architecture / experiment
   setting 问题。** 旧 evaluator 已在 query grid 上固定 $Q_i$；错误不是重复
   abduction，而是 randomized factual action 作为 mechanism query 也进入了
   abductor，污染了形成 $Q_i$ 的 evidence contract。修正为只从 factual identity
   cue 构造 $Q_i$、随后继续固定 $Q_i$ 改变 action 后，fixed-$u_i$ response-curve
   error 大幅下降。
2. **Binary treatment 原计算正确，continuous treatment 的旧 marginal 结果也仍
   有效；但二者的 coupling API / 证据边界不够明确。** 现在 unit coupling 与
   event-noise coupling 已拆开，并为 continuous dose 新增“先 abduce 一次、整条
   grid 复用”的显式接口与 analytic diagnostic。
3. **UML、legacy Y-shuffle 与 Causal Regression 主要是 target / claim boundary
   问题。** 前两者学习 composed predictive law，并不恢复某个 evaluator-hidden
   $u_i$；Causal Regression 只有 factual prediction channel。它们不需要因本次
   语义澄清重跑，但必须停止承担 fixed-unit recovery 或 same-unit counterfactual
   证据角色。

最重要的负面结论也必须保留：selected-token 修复证明了 **query / abduction
interface 更合理且更好用**，但 control interaction、stress degradation 与 belief
calibration 都不支持把收益升级为“已经恢复 $P(U\mid X=x_i)$”或“已经证明 unit
factorization 更 robust”。

## 一句话语义合同

- 模型层只有一个 unit-selection variable $U$；样本 $i$ 的实际 truth 写作
  $U=u_i$，不是另造随机变量 $U_i$。
- 对样本 $i$ 的 learner belief 写作
  $Q_i(B)\approx P(U\in B\mid X=x_i)$。下标属于 belief、evidence 与 realization，
  不属于模型层的 Unit Selection Variable。
- same-token alternative query 必须先从 factual evidence 构造一次 $Q_i$，随后固定
  $Q_i$，只改变 mechanism query。
- unit coupling 与 event-noise coupling 是两条不同的轴；“independent events”不能写成
  “redraw $U$”。
- `selection` 只表示 $U$ 选择 token identity/code；它不是 treatment/action $A/T$、
  sample inclusion $S^{\mathrm{obs}}$ 或 propensity。
- $P_U$ 描述 declared target population 的 token composition；$Q_i$ 是 focal-token
  belief，不是 population composition 或 propensity score。
- latent-code $q$ / Cauchy full support 不等于 causal positivity。Unit abduction 不会自动
  修复 sample-selection bias 或 treatment confounding。
- identity/code 与 response-equivalence class 必须分开；恢复相同 response law 不等于
  恢复 physical token identity。

## 审计判据

| 类别 | 判断问题 | 处理 |
|---|---|---|
| notation drift | 是否只是把 sample index 错挂到 $U$，但代码仍复用同一 factual abduction？ | 修正文稿并运行 guard；不追溯篡改 frozen evidence |
| interface / DGP error | alternative query 是否重新进入 encoder，或 simulator 是否为同一 token 重抽 unit truth？ | 修复接口与测试；受影响实验进入独立 namespace 重跑 |
| target mismatch | 实验评分 composed predictive law，还是 evaluator-hidden fixed-$u_i$ response？ | 显式命名 estimand；只有计算 target 改变时才重跑 |
| coupling ambiguity | “independent”改变的是 unit 还是 event noise？ | 拆成 `unit_coupling` 与 `event_coupling`；旧 label 只作 deprecated provenance |
| selection namespace | `selection` 是否被误写成 treatment、sample inclusion 或 propensity？$P_U$ 与 $Q_i$ 是否被混用？ | 分开 token identity、target-population composition、focal belief 与 assignment/sampling process |
| positivity confusion | latent-code full support 是否被当作 treatment overlap，或 unit abduction 是否被当作 bias/confounding adjustment？ | 明确 non-claim；另给 target-population、sampling/assignment 与 identification assumptions |
| claim inflation | predictive fit 是否被写成 $Q_i$ calibration、mechanism identification 或 Layer 3 validity？ | 降级 claim，并加 machine-readable false-capability guard |

## 逐篇结果

| Paper / line | 审计结论 | 必要修改 | rerun / evidence |
|---|---|---|---|
| **Learning DiscoSCM · selected-token** | **真正受影响。** 旧 evaluator 已经在 alternative grid 上复用同一个 factual $Q_i$，没有 re-abduction bug；实质问题是 abductor 读取 $x=[z,a]$，而该 DGP 的 factual $a$ 是 randomized mechanism query，满足 $P(U\mid z,a)=P(U\mid z)$。让 $a$ 进入 $Q_i$ 污染了 evidence contract，并令 both-learned decomposition 在 off-diagonal fixed-$u_i$ grid 上失效。 | 新增 matched-capacity paired arm：`full_x` 与 `z_only` 都保留同一 2-input encoder 和参数量；`z_only` 只把 action column 确定性 mask 为 0。两臂共享 model initialization 与 exact minibatch order；每条 grid 只 abduce 一次。另加 frozen-true-mechanism belief diagnostic、start/end full-source seal 与 clean-to-stress provenance chain。 | clean 36 formal + 36 diagnostic fits；interface gate 通过。matched curve MAE `0.223607 -> 0.030654`（$86.29\%$）；action sensitivity `0`。stress 另跑同规模矩阵，绝对优势仍为正，但不支持 robustness attribution。最终 sealed evidence 见 `implementation/evidence/selected-token-semantic-repair-v3-sealed/`。 |
| **Learning DiscoSCM · P0 perception conditional** | fixed-evidence mechanics 原本正确：先 abduce / cache 一次，再扫 query grid；没有为同一 token 重抽 unit。当前 semantic verdict 本来就是 `not_ready`，不能因本次修复自动升级。 | 把 stale config status 改为 `semantic_run_complete_not_ready`；保持 flow / bilinear 等 P0 结果的原 verdict。 | 不需要因 unit-index 语义重跑。 |
| **Learning DiscoSCM · legacy Y-shuffle** | 合法的 composed posterior-predictive task；它积分 $Q_i$，不评分一个隐藏 actual $u_i$。旧结果 `not_confirmed` 仍成立。 | 文稿把 composed-law target 与 fixed-realization selected-token target 分开。 | 不重跑；原 confirmatory mean delta `-0.00715`，95% interval `[-0.0496, 0.0353]`。 |
| **Unit Mechanism Learning** | 主实验同样是 one-shot composed predictive learning，不是 point-select actual-unit mechanism。模型的 alternative-query API 已能固定 factual cache。 | discussion / workbench 显式写出 $U=u_i$、$\varepsilon_{it}=(u_i,E_{it})$ 与 composed target；移除把 $U_i$ 当 active ontology 的写法。 | 不重跑；旧 prediction evidence 不再被引用为 $Q_i$ recovery。 |
| **Causal Regression** | CausalEngine 只有一个 `x` channel：`x -> z -> q(U|x) -> Action -> Y`。它没有 independent target query，因此现有实验只能支持 factual prediction / robustness / architecture behavior。 | 新增 `CAUSAL-REGRESSION-EXPERIMENT-SCOPE-GUARD-V1`，把 unit-belief recovery、posterior equality、mechanism identification 与 same-unit counterfactual validity 六项能力锁为 false。 | 不重跑；计算对象没改变。冻结 submission / history 不修改。 |
| **Binary treatment / causal-effect** | DGP、model 与 oracle 原本就为两臂复用同一个 unit realization；数值没有 redraw-$U$ bug。问题是旧名 `independent_resampling` 容易被误读成重抽 unit，其实只表示 independent events。 | API 改成 `unit_coupling="shared"` 与 `event_coupling="independent"|"shared"`；旧名称仅保留 `DeprecationWarning` 兼容。 | 数值无需重跑；117 tests、Ruff 与 LaTeX build 通过。 |
| **Continuous treatment** | encoder 原本只读 $X$，旧 surface / ADRF 数值仍是合法 marginals；但逐 dose 重算 deterministic encoder，且 marginal 指标无法检验 cross-dose 是否共享 unit。 | 新增 `UnitBelief`、`abduce(X)`、`response_parameters_from_unit(Q_i,A)` 与 shared-unit contrast；evaluator 先 abduce 一次并复用整条 dose grid。 | 旧 100-fit matrix 不覆盖。analytic diagnostic 中 shared-$U$ scale 恒为 `0.353362`；错误 independent-$U$ counterworld 在 prognostic loading 4 时为 `1.659721`，膨胀 `4.691x`，而各 dose marginal error 仍为 `0`。9 tests、Ruff 与 LaTeX build 通过。 |
| **Token Causation** | 当前是 theory-only paper，没有可继承的 sibling 内部实验。predictive training 不能单独证明 $Q_i=P(U\mid X=x_i)$ 或 singular attribution。 | README / assumption ledger 加入 $Q_i$ contract 与 same-token no-reabduction boundary。 | N/A。 |
| **Response-function review** | 文献综述中的 indexed $U_i$ 属于外部 longitudinal grammar，不是 HCGM active ontology。 | 由 guard 对每条 provenance / teaching occurrence 精确 allowlist，并与内部实验语义隔离。 | N/A。 |

## Selected-token 修复：before / after 与不能得出的结论

### 实验合同

- worlds：`matched_identifiable`、`uninformative_token_cue`、
  `no_token_heterogeneity`；
- two DGP seeds x three initialization seeds x two arms；
- formal lane 与 frozen-mechanism diagnostic lane 各 36 fits；
- 两臂参数量、initialization seed、DataLoader seed、train/validation/test split、
  oracle 与 corruption design 完全配对；
- formal training 不读取 `selected_code`；它只在 evaluator 中表示 $U=u_i$；
- 每个样本的 query grid 只调用一次 encoder，随后复用同一 $Q_i$；
- 这是 development semantic repair，不是 confirmatory study。

### Clean response-curve 结果

| World | `full_x` MAE | `z_only` MAE | evidence-conditioned reference | 判断 |
|---|---:|---:|---:|---|
| matched identifiable | 0.223607 | **0.030654** | 0.028055 | 接近 finite-test evidence-conditioned reference；interface utility gate 通过 |
| no token heterogeneity | 0.241718 | **0.006744** | 0 | action 不再污染 abduction / decomposition |
| uninformative token cue | 0.374516 | **0.290777** | 0.289464 | 接近 evidence-conditioned Bayes reference；不能恢复 individual $u_i$ |

matched world 的相对改善是 $86.29\%$，`z_only` 的 excess / oracle MAD 是
`0.007014`；no-heterogeneity 的 error / oracle MAD 是 `0.018278`；所有 `z_only`
belief location / scale 对 action 的 sensitivity 恰为 `0`。

### 为什么这仍不是 $Q_i$ recovery 证据

第一，**control interaction 不支持 semantic-specific attribution**。clean absolute
gain 在 matched world 是 `0.192953`，在 no-heterogeneity control 是 `0.234974`；
matched-minus-control 为 `-0.042021`。修复显然改善了 query / abduction interface 与
decomposition，但数据不支持把改善专门归因于 unit posterior recovery。

第二，frozen-true-mechanism lane 直接暴露了 posterior mismatch。在 matched world：

- 真 truncated-Uniform posterior 的 empirical 80% coverage 约 `0.792`；
- learned Cauchy $Q_i$ 的 coverage 只有 `0.3822`（`z_only`）；
- predicted half-IQR 约 `0.01216`，truth 约 `0.04832`；
- selected-$u_i$ empirical log-score gap 约 `1.0871`。

也就是说，location response curve 可以接近有限测试集上的 evidence-conditioned
Bayes-median reference，而完整 belief 仍明显 under-dispersed。
`no_token_heterogeneity` 中 true loading 为 0，response loss 对 encoder
没有识别信息，因此该 world 的 coordinate-level belief metrics 必须标为 N/A；随机初始
encoder 不能被包装成 posterior diagnostic。

第三，$\rho=0.4$ stress 中 `z_only` 在 matched world 仍有约 `+0.07122` 的 absolute
advantage（MAE `0.234197` vs `0.162978`），但从 clean 到 stress 的 degradation
advantage 约为 `-0.12173`。所以可报告
“压力下绝对误差仍较低”，不能报告“更 robust”。

最终结论应写成：

> 将 action 从 abduction channel 移到 mechanism-query-only channel，是必要且高价值的
> interface 修复；它让 fixed-$u_i$ response curve 接近有限测试集上的
> evidence-conditioned Bayes-median reference。但本实验没有
> 验证 $Q_i=P(U\mid X=x_i)$、latent-coordinate identification 或 robustness advantage。

## Continuous-dose analytic guard

旧 dose-wise marginals 无法区分下面两种 joint coupling：

\[
Y(a)=m(a)+w(a)^\top U+E_a,
\qquad
Y(a')=m(a')+w(a')^\top U+E_{a'}
\]

与错误的“每个 dose 各抽一个独立 unit”。两者可以拥有相同单-dose marginals，却给出
完全不同的 contrast distribution。正确 same-unit contrast 使用
$w(a)-w(a')$，所以 common prognostic loading 会抵消；错误 independent-unit
counterworld 则把两侧 unit scale 相加。

| Common prognostic loading | shared-$U$ scale | independent-$U$ scale | ratio |
|---:|---:|---:|---:|
| 0 | 0.353362 | 0.353362 | 1.000 |
| 1 | 0.353362 | 0.544523 | 1.540 |
| 2 | 0.353362 | 0.913180 | 2.582 |
| 4 | 0.353362 | 1.659721 | 4.691 |

这也是为什么“旧 marginal 结果没错”和“旧实验没有验证 same-unit coupling”可以同时
成立。

## 可执行 guards

从 HCGM root 运行：

```bash
python paper/scripts/check_unit_semantics_contracts.py --self-test
python paper/learning-discoscm/scripts/check_unit_selection_notation.py
python paper/causal-regression/code/current/check_experiment_scope_guard.py
```

cross-paper guard 扫描 active paper sources，并检查：

- 只有一个 model-level $U$，样本 truth 为 $U=u_i$，belief 为 $Q_i$；
- `U_i` 只出现在逐行许可的显式否定、provenance 或外部综述 notation 中；
- selected-token / P0 alternative query 固定 factual abduction；
- selection namespace、target-population composition 与 focal-token belief 不混用；
- latent-code full support 不冒充 positivity，unit abduction 不冒充 selection-bias / confounding adjustment；
- UML composed target 不冒充 fixed-unit oracle；
- treatment papers 分离 unit 与 event coupling；
- Causal Regression 的六项越界能力保持 false。

generated、evidence、outputs、frozen、history 与 prior submissions 被有意排除。它们是
provenance，不应被一次 active-source lint 追溯改写。
