# Codex Prompt: T1a Fix v2 — Round 1 补遗（按已定真源扩展 plan）

> 上一轮 Round 1 plan-only prompt 跑完后，主 session 复审发现 plan 缺 4 件事。
> **本轮所有任务都是"按已定真源 / 已定 schema 执行"**——不要做抽象设计任务（meta-rules 触发器 G）。

---

## 必读前置

1. **`docs/meta-rules.md`** — 元规则真源（特别看触发器 G：plan owner / executor 分工边界）
2. **`src/design-system/translation/axis-implementation-map.md`** — **plan owner 刚写好的真源**（含 schema 定义 + 实现层级 enum + 2 个示范实例 + audit 消费契约）。**本轮所有补遗任务围绕这份真源**
3. `docs/internal/_plans/t1a-fix-v2-plan.md` — 上一轮 plan（保留所有已写内容，**只补，不重写**）
4. `docs/internal/_prompts/t1a-fix-v2-round1-plan-only.prompt.md` — 上一轮 prompt（参考）

---

## 上轮 plan 缺的 4 件事

| # | 缺 | 需要按什么补 |
|---|---|---|
| **A** | plan 章节 0（真源机制设计）完全跳过 | 按 plan owner 已写好的 `axis-implementation-map.md` 扩展实例 |
| **B** | plan 章节 2 受影响组件清单只覆盖 vue-computed-palette，没扫 prop-axis / 拓扑 | grep + Read 扫候选 |
| **C** | plan 章节 3 新 verdict 缺 2 个（`token-match-via-prop` / `token-match-via-topology`） | 按 axis-implementation-map.md 第 5 段已定 evidenceLevel 映射填 |
| **D** | 缺 audit 读真源算法的具体伪代码 | 按 axis-implementation-map.md 第 5 段已定消费契约写 |

---

## 任务 1：扩展 axis-implementation-map.md 实例（plan 章节 0 补）

**输入**（plan owner 已写好）：`src/design-system/translation/axis-implementation-map.md` 已含 schema 定义 + 5 层 enum + Instance 1 (Button) + Instance 2 (SelectBoxLine.feature)。

**你要做**：按已定 schema **追加实例**，覆盖该文件第 4 段 `<!-- TODO(executor) -->` 段列出的 4 类候选。

每条实例必须含 schema 9 个字段中的全部必填项（`figmaComponent` / `figmaComponentSetIds` / `figmaAxis` / `figmaValue` / `codeImplementationLayer` / `codeFile` / `codeAnchor`，`verifyHint` 推荐填）。

**最少补充实例数**：

| 类别 | 至少补 |
|---|---|
| vue-computed-palette | 4 个（PromptMessage / Badge canonical / Progress / FormItem） |
| vue-prop | ≥ 3 个（含 SelectBoxLine.feature=time / SelectBoxFilled.feature=date,time，再 grep 任何其它 axis-as-prop） |
| css-custom-property-chain | ≥ 2 个（Tooltip + Input，参考 plan v1 章节 1 盲区 3 已识别） |
| cross-component-topology | ≥ 2 个（DateTime topology 必须含；Steps/StepItem / Tabs/TabItem / Breadcrumb/BreadcrumbItem 至少 1 个） |

**实例直接追加到 `axis-implementation-map.md` 第 4 段下方**，按 markdown list 格式（参考 Instance 1 / 2 现有写法）。**不要新建段、不要改 schema 定义段、不要改 enum 段、不要改第 5 段消费契约**——这些是 plan owner 的真源，executor 只追加实例。

**严禁**：
- ❌ 不要修改 schema 字段定义（第 3 段）——不要加新字段
- ❌ 不要修改实现层级 enum（第 2 段）——不要加新 layer
- ❌ 不要修改 audit 消费契约（第 5 段）

如果发现 schema / enum / 消费契约确实需要扩展（如新 layer），**只在补遗 prompt 报告里提议，不要直接改文件**——这是 plan owner 工作。

---

## 任务 2：扩展 plan 章节 2 候选清单

在 `docs/internal/_plans/t1a-fix-v2-plan.md` 章节 2 现有内容**下方追加**两个新表：

### 2.X prop-axis 候选（vue-prop 实现层级）

```bash
grep -rln 'defineProps' src/canonical/ src/components/ | xargs grep -lE "type\s+\w+\s*=\s*'[^']+'\s*\|\s*'"
```

输出每个候选组件：

| 组件 | 文件 | prop 名 | 枚举值 | figma 对应 axis（推测） |
|---|---|---|---|---|

至少包含 SelectBoxLine / SelectBoxFilled / 其它 grep 命中的。

### 2.Y 拓扑映射候选（cross-component-topology 实现层级）

| code 端实体组合 | figma 端推测组件集 | 证据 |
|---|---|---|

至少包含：
- SelectBoxLine + SelectBoxFilled + DateTimePage（DateTime topology）
- Steps + StepItem
- Tabs + TabList + TabItem + Tab
- Breadcrumb + BreadcrumbItem

证据列写"在 figma normalized JSON 找到的对应 component set ID（如有）" 或 "推测、待 plan owner 复审确认"。

---

## 任务 3：补 plan 章节 3 缺的 2 个 verdict

在 `docs/internal/_plans/t1a-fix-v2-plan.md` 章节 3 现有 5 verdict 表**追加 2 行**（不要重写表）：

按 `axis-implementation-map.md` 第 5 段已定的 evidenceLevel 映射填：

| New verdict | Purpose | evidenceLevel | evidenceSource |
|---|---|---|---|
| `✅ token-match-via-prop` | prop-axis 实现验证通过 | `direct` | `[figma-tokenized-json, vue-static-css, vue-defineProps]` |
| `✅ token-match-via-topology` | 跨组件拓扑映射验证通过 | `direct` | `[figma-tokenized-json, axis-implementation-map.md, multi-file-resolution]` |

并在表下方加一段 trigger pseudocode：

```js
if axis-implementation-map 找到匹配 instance with codeImplementationLayer === 'vue-prop' {
  // 验证 codeFile 的 defineProps 含 figmaAxis 同名 prop，且枚举值含 figmaValue
  if 验证通过 return token-match-via-prop
  return implementation-mismatch
}

if axis-implementation-map 找到匹配 instance with codeImplementationLayer === 'cross-component-topology' {
  // 递归遍历 codeAnchor 列举的多文件，每个文件按各自 layer 验证
  if 任一文件验证通过 return token-match-via-topology
  return implementation-mismatch
}
```

---

## 任务 4：补 plan 章节 4-6 之间新增 "章节 6.5：audit 读真源算法的实现伪代码"

**输入**（plan owner 已写好）：`axis-implementation-map.md` 第 5 段 audit 消费契约。

**你要做**：把消费契约的 3 步算法转化为可实现的伪代码：

```
function auditAxisValue(figmaComponent, figmaAxis, figmaValue, axisTuple) {
  // Step 1: parse 真源
  instances = parseAxisImplementationMap()
  match = instances.find(i =>
    i.figmaComponent === figmaComponent
    && i.figmaAxis === figmaAxis
    && (i.figmaValue === figmaValue || i.figmaValue === '*')
  )

  // Step 2: 找到匹配 instance
  if (match) {
    switch (match.codeImplementationLayer) {
      case 'css-class': return verifyCssClass(match, axisTuple)
      case 'vue-prop': return verifyVueProp(match, axisTuple)
      case 'vue-computed-palette': return verifyComputedPalette(match, axisTuple)
      case 'css-custom-property-chain': return verifyCssCustomPropertyChain(match, axisTuple)
      case 'cross-component-topology': return verifyCrossComponentTopology(match, axisTuple)
    }
  }

  // Step 3: 兜底
  fallbackResult = verifyCssClass(/* default behavior */)
  if (fallbackResult.success) return fallbackResult
  return { verdict: '⚠️ unmapped-axis-value', evidenceLevel: 'heuristic', ... }
}
```

每个 verify*() 函数写**接口契约**（输入 / 输出 / 失败时返回什么），不要写完整实现——实现是 Round 2 工作。

放在 plan 章节 6（双端 hex 比对算法）和章节 7（边界 case）之间。

---

## 任务 5：自验

```bash
# 1. axis-implementation-map.md 已扩展
wc -l src/design-system/translation/axis-implementation-map.md  # 应远 > 上一版

# 2. plan v1 已扩展，没重写
diff <(git show HEAD:docs/internal/_plans/t1a-fix-v2-plan.md 2>/dev/null) docs/internal/_plans/t1a-fix-v2-plan.md
# 旧 plan 在 git 里没有（HEAD 不动），用文件系统比即可
wc -l docs/internal/_plans/t1a-fix-v2-plan.md  # 应 > 411

# 3. plan 章节 3 verdict 表新增 2 行（不是重写）
grep -c '^| `✅ token-match' docs/internal/_plans/t1a-fix-v2-plan.md  # 应 ≥ 3（v1 有 1 个 token-match-via-indirection）

# 4. 章节 6.5 新增
grep -n '^## 6.5' docs/internal/_plans/t1a-fix-v2-plan.md  # 应有 1 行

# 5. 没动 axis-implementation-map.md 的 schema / enum / 消费契约段
grep -n '^## 2\|^## 3\|^## 5' src/design-system/translation/axis-implementation-map.md
# 这三段保持原样（plan owner 写的）；如果你改了，回滚

# 6. HEAD 不动
git log --oneline -1  # 应仍 c9032ad
```

---

## 任务 6：⚠️ 不要 commit

按 v2 plan 工作纪律 1：

```
❌ git add
❌ git commit
❌ git push
```

本轮改动留 dirty 工作区。

允许新增 / 修改的文件：
- ✅ `src/design-system/translation/axis-implementation-map.md`（追加实例段）
- ✅ `docs/internal/_plans/t1a-fix-v2-plan.md`（追加章节 2 候选 / 章节 3 verdict / 章节 6.5）

**禁止改任何其它文件**（包括 axis-implementation-map.md 的 schema / enum / 消费契约段，包括 audit 脚本，包括 src/ 任何代码）。

---

## 完成后 STOP

输出给主 session：

```
任务 1 (axis-implementation-map.md 实例扩展)：
  vue-computed-palette 新增：N 条
  vue-prop 新增：N 条
  css-custom-property-chain 新增：N 条
  cross-component-topology 新增：N 条
  总实例数：N（含 plan owner 写的 2 条示范）

任务 2 (plan 章节 2 扩展)：
  prop-axis 候选：N 个
  拓扑映射候选：N 个

任务 3 (plan 章节 3 新 verdict)：
  ✅ 已加 token-match-via-prop 行
  ✅ 已加 token-match-via-topology 行
  ✅ trigger pseudocode 已加

任务 4 (plan 章节 6.5 audit 读真源算法)：
  ✅ 已加，含 5 个 verify*() 函数接口契约

工作区状态：
  axis-implementation-map.md 行数：N（vs plan owner 初版的 ~150 行）
  plan v1 行数：N（vs 411）
  HEAD：c9032ad（不变）

发现需 plan owner 处理的（schema / enum / 消费契约扩展提议）：
  [列出来或写"无"]
```

**STOP。不要进 Round 2。不要 commit。**
