---
name: project-step1211-1212-batch-uniqueness-source-strict-2026-06-11
description: STEP 1211 (m) requireWithinBatchTargetUniqueness + STEP 1212 (n) requireSourceVsHistoryStrict 統合実装 — 06-09
metadata: 
  node_type: memory
  type: project
  originSessionId: fc6723ce-88ad-401e-b6ce-fe0050f4190a
---

# STEP 1211 + 1212 — Invention pipeline 8th iteration hardening (m)+(n) 統合

## Why this matters

- **(m) STEP 1211**: 06-09 #3 incident で batch 内 #2 と #3 の target literal が完全同一 collision (STEP 1209/1210 は 過去 file を見るが同 invent() call 内の collision は範囲外)
- **(n) STEP 1212**: STEP 1190 (j+k) は `normalizeAxiomLiteral` (60-char prefix) で decorative quote wrap + annotation suffix 起因の prefix 差を見逃す可能性 → STEP 1209 (o) + 1210 (p) target 側 strict 層 と対称化

## Design

### STEP 1211 (m) `requireWithinBatchTargetUniqueness`
- `withinBatchTargets: Set<string>` instance field (strict-normalized literal Set)
- `_resetWithinBatchTargets()` invent() 開始時 reset
- `_isTargetInBatch(target)` strict normalize 後 Set 含有 check
- `_recordWithinBatchTarget(target)` strict normalize 後 add
- transplantStructure 内で STEP 1210 (p) check の後、 batch 内 collision check + rotation + record

### STEP 1212 (n) `requireSourceVsHistoryStrict`
- `loadHistoryAxiomBanStrict(days, today?)`: approved+rejected 全 file の source+target literal 4 directions を `normalizeAxiomLiteralStrict` で正規化 + Set 化 + legacy hypothesis parse 含む
- `isAxiomInHistoryStrictBan(axiom)`: strict normalize + full literal exact match
- `requireSourceVsHistoryStrict` option (default ON) で transplantStructure source rotation 追加 strict 層

## Implementation files

- `src/aios/invention/invention-engine.ts`:
  - option 宣言 (×2) + field 宣言 (×2)
  - method 追加 (×6): `_resetWithinBatchTargets` / `_isTargetInBatch` / `_recordWithinBatchTarget` + `loadHistoryAxiomBanStrict` / `isAxiomInHistoryStrictBan` / `_resetHistoryAxiomStrictCache`
  - transplantStructure 内 check (×2)
  - invent() 開始時 reset 1 行
- `src/aios/daily/daily-invention-reporter.ts`: 既定明示 ON (×2)
- `test/step1211-1212-batch-uniqueness-source-strict-test.ts` (+311 行): 22 tests
- `test/step1089c-source-cooldown-test.ts` (+1 行): legacy intent 保持 `requireSourceVsHistoryStrict: false`
- `test/step1190-pattern6-jk-hardening-test.ts` (+1 行): 同上
- `package.json` (+1 script): `test:step1211-1212`
- `CLAUDE.md` (+1 STEP entry): STEP 1211+1212 行

## Test coverage (22/22 PASS)

1. withinBatchTargets reset/record/check 基本動作
2. ★ batch 5 invention 重複防止 (06-09 #3 reproduction)
3. STEP 1211 explicit OFF legacy 動作
4. graceful fallback (全 candidates ban)
5. loadHistoryAxiomBanStrict 4 directions (approved+rejected × source+target)
6. ★ STEP 1212 decorative wrap leak prevention
7. STEP 1212 explicit OFF legacy 動作
8. STEP 1212 cache reset
9. STEP 1211+1212+1209+1210+1190 共存 regression

## Regression (254/254 PASS / 0 breaking)

- step1019: 9/9
- step1040: 11/11
- step1047: 9/9
- step1087: 10/10
- step1088: 12/12
- step1089: 20/20
- step1089b: 11/11
- step1089c: 15/15 (★ `requireSourceVsHistoryStrict: false` 追加)
- step1089cd: 60/60
- step1190: 24/24 (★ `requireSourceVsHistoryStrict: false` 追加)
- step1209: 26/26
- step1210: 25/25
- step1211-1212: 22/22
- **TOTAL: 254 passed, 0 failed**

## 8 iteration hardening 累積

STEP 1019 + 1040 + 1047 + 1087 + 1088 + 1089/b/c/cd + 1190 + 1209 + 1210 + **1211 + 1212**

## 残 8th iteration candidate

- **(l) `requirePriorArtAudit`**: 内部 prior-art registry 拡張 + WebSearch hook 設計が必要。 STEP 1089d (h) `enableLoadBearingFormulaCheck` の 拡張 として load-bearing-formulas registry を expand する path がもっと現実的。 別 STEP 候補。

## 関連

- [[project-invention-2026-06-09-approve-1-reject-4-step1209-validity-demonstrated]] — #3 (m) candidate direct hit
- [[project-step1210-approved-target-literal-full-ban-2026-06-11]] — symmetric pair (p) target 側
- STEP 1209 (o) requireRejectedTargetLiteralFullBan — STEP 1209 (o) と (m)+(p) で target 側 3 段 strict 層
- STEP 1190 (j+k) requireFreshSourceVsHistory — (n) で source 側 strict 層追加
