# Unit Mechanism Learning

> 状态：research-program cockpit，2026-07-16
> Legacy repository / route label: `HCGM` / `hcgm`
> Canonical doctrine: [`UNIT_MECHANISM_LEARNING.md`](UNIT_MECHANISM_LEARNING.md)

这个项目当前聚焦 **Unit Mechanism Learning**：底层 primitive 是一个 unit-selection
variable \\(U\\)，一次 realization \\(U=u\\) 代表一个 token/unit 及其 embedding；共享生成
机制写成 \\(Y(x)=f_\\theta(x,E;U)\\)，token-level response function 是固定 \\(U=u\\) 后的
机制 slice。`HCGM` 暂时保留为 repository、public route、历史论文与
provenance label，不再作为当前底层 ontology 的定义。

> **Agent notation preflight：**
> 修改 Learning DiscoSCM 前先读
> [只有一个 \\(U\\)：Unit Selection Variable、样本真值与 belief](entrances/DISCOSCM_UNIT_SELECTION_NOTATION.md)。
> 唯一 selector 是 \\(U\\)，样本 \\(i\\) 的真值写成 \\(U=u_i\\)，
> evidence-indexed belief 写成 \\(Q_i\\)。
> 这里的 `selection` 只选择 token identity/code，不表示 treatment `A/T`、
> sample inclusion `S^obs` 或 propensity。

## 当前共同建模语法

```text
factual predictors x^F as evidence
  -> call the learned unit-abduction operator A_phi(x^F)
  -> obtain a point, Gaussian, or Cauchy result about the same actual token
  -> set candidate u and event noise E in f_theta(x^Q,E;u)
  -> obtain the predictive outcome distribution p_{phi,theta}(y|x^F,x^Q)
```

- `U` 是模型级 unit-selection variable；一次 realization `U=u` 代表一个 token/unit 及其
  embedding。共享模型写成 `Y(x)=f_\theta(x,E;U)`，固定 realization 后才得到
  `Y_u(x)=f_\theta(x,E;u)`。
- observation index 只是 dataset bookkeeping；不要把每条数据行写成 ontology 中的 `U_i`，
  也不要把它误读成一族彼此独立的 response functions。
- 最简单的 ML 场景直接把 `X=x` 当作 factual evidence；同一个 `x` 经过 abduction 后，
  还作为 factual mechanism query。为避免混淆，临时写成 `x^F=x^Q=x`。
- `A_\phi(x^F)` 可以直接估计 `u_hat`，也可以输出 Gaussian 或 Cauchy candidate-unit
  distribution。三者都是 learner 对同一个 actual token 的认识结果，不是 physical unit
  每次预测时重新抽 identity。
- Cauchy 使用 location / scale 而非 mean / variance；它保留远端 candidate mechanisms，
  但不保证任意 unit 能产生任意 outcome。
- counterfactual prediction 固定由 factual `x^F=x` 得到的 abduction result，只把 query
  改为 `x^Q=x'`；不能用 `x'` 重新识别 token。
- candidate `u` 调节 shared generator；不同 units 可以 response-equivalent。
- `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。
- `E` 承载 event-level randomness。
- 更大的 umbrella 是 **Unit/Context-Specific Mechanism Learning**：$Y\leftarrow
  f(X,E;U,C)$。$U$ 回答“谁”，$C$ 回答“处于什么 environment / regime”；
  同一 context 内仍可有 unit-level heterogeneity。
- 当前固定 `C=c0`，将这一 umbrella 收缩为 Unit Mechanism Learning。
  Context Mechanism Learning 是 future extension。

这里最关键的学习对象分界是：普通 supervised learning 从 population data 估计
$P_{\mathrm{obs}}(Y\mid X=x)$，回答“看到这些 predictors 时，结果通常是什么”；Unit
Mechanism Learning 把这项计算打开为 `x^F -> unit abduction -> f_theta(x^Q,E;u)`，并学习
$Y\leftarrow f(X,E;U,C)$。mechanism family、unit mix 与 event noise 可以归约为 predictive
conditional，反方向通常不能唯一恢复。实际预测输出是 candidate-unit predictions 综合后的
outcome distribution，不是一个重新生成的 physical unit。完整解释见
`UNIT_MECHANISM_LEARNING.md`。

这个 grammar 本身不自动获得 causal semantics。只有当 `X` 被声明为 treatment / action /
dose / causal parent，并补足 intervention、support、stability 与必要的 cross-world
assumptions 时，才进入 causal specialization。共同 grammar 也不意味着 sibling projects
共享所有结论。每篇论文必须自己声明
observations、estimand、identification assumptions、support boundary、
cross-world coupling、implementation 和 evidence。历史实验或强 claim 不能在
子项目之间自动迁移。

Point、Gaussian 与 Cauchy 是三种 abduction choices；其中 **Cauchy distribution + affine /
linear mechanism** 是当前多篇论文检验的 tractable family，不是 Unit Mechanism Learning
的定义。

## 科研架构

```text
Unit Mechanism Learning research program (legacy path: hcgm)
├── paper/
│   ├── learning-discoscm/          active flagship: how to learn DiscoSCM
│   ├── unit-mechanism-learning/    independent general ML framework paper
│   ├── token-causation/            independent causal ontology / attribution paper
│   ├── unit-abducted-cate/         independent HTE localization theory draft
│   ├── causal-regression/          corrected precursor + historical provenance/code
│   ├── causal-effect/              binary-treatment sibling paper
│   └── continuous-treatment/       continuous-dose sibling paper
├── toy/                             reusable mechanism checks and examples
├── entry-site/                      program-level public projection
└── entrances/                       positioning and propagation ledgers
```

当前默认 flagship 是 **Learning DiscoSCM**，总问题是 “How to learn DiscoSCM?”。
`unit-mechanism-learning/`、`token-causation/` 与 `unit-abducted-cate/` 仍是独立 active
paper identities，分别承担一般方法、causal ontology / singular attribution 与 HTE
localization 视角；四篇可以互相引用，但各自维护 theorem、experiment、failure 与
submission truth。应用论文同样不静默继承彼此结果。

## 10 Paper Portfolio packaging bridge

HCGM 继续拥有 scientific source、claim、code 与 evidence；10 Paper Portfolio 只拥有
selection、RQ/P allocation、package status、venue pressure 与 public package routing。
当前 typed bridge 在：

```text
/Users/cms/.openclaw/workspace/projects/two-month-ten-conference-papers/state/hcgm-paper-bridge-v0.yaml
```

- `causal-effect/` -> `RQ23/P23` package preflight；
- `learning-discoscm/` -> `RQ16/P16` active flagship science source；Portfolio 仍保持 seed、
  不是 active submission package；
- `continuous-treatment/` -> independent second-wave incoming candidate；
- `causal-regression/` -> `RQ25` historical provenance case with a corrected-submission workspace; this does not by itself promote it to a new Portfolio candidate.

Portfolio 不复制 HCGM manuscript 或实验真值。公开组合入口：
<https://wehub.us/gong/10-paper-portfolio/>。

## 先读什么

理解顶层架构：

```text
README.md
hello_agent.md
paper/README.md
```

重启 agent session：

```text
RESTART_HERE.md
```

论文任务应直接进入对应的 local README，不要先加载整个项目。
`F1_READER_REQUEST_2026-06-26.md`、`FOUR_ENTRANCES_READER_FEEDBACK.md` 和
`NEXT_GROW_DECISION.md` 记录较早四入口阶段的 review gate。它们是 provenance，
不是当前 research program 的全局 gate。

## 按任务进入

| 需要 | 先读 | 边界 |
|---|---|---|
| Unit Mechanism Learning 整体架构 | `UNIT_MECHANISM_LEARNING.md`、`README.md`、`hello_agent.md` | 只定义共同 grammar 与 routing |
| Learning DiscoSCM flagship | `entrances/LEARNING_DISCOSCM.md`，再读 `paper/learning-discoscm/README.md` | reader-first logic contract 与 manuscript source 分开；不把文章当完成论文 |
| Unit Mechanism Learning 方法论文 | `paper/unit-mechanism-learning/README.md` | 独立 general ML framework paper |
| Token Causation 理论论文 | `paper/token-causation/README.md` | 独立 causal ontology / singular attribution paper |
| Causal Regression corrected paper、历史投稿或复现代码 | `paper/causal-regression/README.md` | 修复版结果与历史证据严格分线 |
| Binary-treatment causal effects | `paper/causal-effect/README.md` | 独立 estimand、identification、coupling 与 evidence |
| Continuous-treatment response | `paper/continuous-treatment/README.md` | 独立 support、smoothness、derivative 与 coupling 边界 |
| 可复用例子与 mechanism checks | `toy/README.md` | evidence aid，不替代 paper claim |
| 公共入口（legacy HCGM route） | `entry-site/seed.md` | projection 跟随 source，不反向定义 source |
| Positioning 或 teaching propagation | `entrances/` | 支撑性 ledger，不是 active manuscript truth |
| 进入 10 Paper 投稿组合 | Portfolio `state/hcgm-paper-bridge-v0.yaml` | HCGM owns science；Portfolio owns package/venue，不复制 source |

Paper-local reader site 属于对应 paper 目录。先修改 source 或 generator，不要把
generated public projection 当成 canonical research content 直接编辑。

## Source Boundary

Canonical project body:

```text
/Users/cms/.openclaw-causaclaw/workspace/projects/hcgm/
```

Owner-facing shared entry:

```text
/Users/cms/wehub-system-msp/causal-superintelligence/hcgm
```

Additional OpenClaw shared entry:

```text
/Users/cms/.openclaw/workspace/projects/causal-superintelligence/hcgm
```

`causal-mind/hcgm/` 是 provenance 与 agent-cognition incubation material。其中的想法只能经过
明确 promotion 进入 `paper/`、`toy/`、`entry-site/` 或这个 cockpit。

Causality Primer / book line 有自己的 receiving surface：

```text
/Users/cms/.openclaw/workspace/projects/causal-superintelligence/causality-primer/
```

不要因为 guide/book material 提到 HCGM 就把它整批 promote 到本项目。只有成为
paper claim、toy evidence、proof boundary、reproducibility hook 或 source-first entry-site
content 的部分才进入 HCGM；book reader-path 工作属于 `causality-primer/`。

## Prune Rule

保持 root 安静。只有在改变共同架构、routing 或持久的 cross-paper boundary 时，
才新增 root document。Paper-specific claim、assumption、experiment 与 public-page source
应进入最近的 paper 目录。不要把旧阶段 gate 重新说成项目级 blocker；只有在追溯时
才读取 phase evidence。
