# STEP 1952 — orphan-gauge-v04-latest-json-and-snst-decision

**Timestamp**: 2026-09-11T01:15 (JST)
**Tab worktree**: main (rei-aios-9b)
**Commit**: (this commit)

## 一行 summary

v0.4 = `data/<domain>/latest.json` archive path-regex 追加 + SnstRealComparison **KEEP IN PLACE 判定 明文化**、CF Pages 反映 verify (STEP 1951 サイト 200 OK)。

## 主要 finding / evidence

### v0.4 (`data/<domain>/latest.json` archive)

- **変更**: `consumption-mode.ts` に `ARCHIVE_PATH_REGEXES` 新設 (line 80-86)、path-based regex check を classifyMode に追加 (ARCHIVE_DIR_PREFIXES 直後)
- **Pattern**: `/^data\/[^/]+\/latest\.json$/` — single-level subdirectory 制約 (data/domain/latest.json のみ、深い階層は素通り)
- **Test**: 45 → **49/49 PASS** (v0.4 test 5 new: T-V13 flip + T-V16-V20)
- **Real-repo delta** (v0.2 STEP 1948 → v0.4 STEP 1952):
  - **20 files 正確に archive 分類**: karpathy watch (STEP 1950 で 既 `_archive/` 移動、v0.2 catch) + 19 `data/*/latest.json` (lmfdb, ibm-quantum, file-microscope, os-pulse, claude-commit-bias, hyperv-status, rei-prove-benchmark, crossref, collatz-verify, collatz-5percent-analysis, buchi25-spot, collatz-sigma-cascade, microbe-gallery, hallucination-neither-report, capacity-audit, occult-bridge-discovery, andrica-pslq, ghost-circuit, +1 more)
  - **75 files newly in RUIN**: 主に `data/lean4-mathlib/CollatzRei/MathlibPrep/*.lean` (STEP 1000 mathlib-prep arc、載っているが upstream 待ち)
  - **Net RUIN**: 334 → 389 (+55) = **-20 archived + +75 newly stale (measurement noise dominated)**
- **Honest finding**: v0.4 の 20 archive は 正確 (pattern hit)、+55 RUIN swing は **measurement noise** (readdirSync walk order 非決定 + mtime 30d 境界 crossing 間 ~40 分)

### (a) SnstRealComparison **KEEP IN PLACE 判定**

STEP 1949 corrigendum で 保留判定した `data/lean4-mathlib/CollatzRei/SnstRealComparison.lean` の 最終判定を **KEEP IN PLACE** に formalize:

**Justification**:
1. **Substantive content** (STEP 1228e 2026-06-19): 8 theorem、explicit "pilot" docstring、SNST × ℝ saturation structural evidence
2. **Load-bearing rationale**: 「別 AI 指摘 (load-bearing)」comment = 未来 chat-Claude arc の revisit path 明示
3. **Reversibility asymmetry**: 削除は destructive、KEEP は 0-cost、evidence 保全側 に bias
4. **Isolated ≠ actionable in Rei** (STEP 1949 meta finding): per-STEP proof exhibit style で isolated は default state

**Formal decision**: 
- File stays at `data/lean4-mathlib/CollatzRei/SnstRealComparison.lean`
- v0.4 gauge run で 引き続き RUIN 分類 されるが tolerated (「RUIN = 疑わしい印」 の scope 内)
- 再判定 trigger: (a) 藤本さん explicit direction / (b) chat-Claude 「非保存性 formal proof」arc 進行時 の re-use / (c) 180 日以上更新なし + upstream Mathlib 側で 対応 concept 実装 で obsolete と判明

### (c2) Lean import-graph parser **v0.5 defer 明文化**

STEP 1948 で提案した v0.3 pattern (1) = Lean import-graph full parser を **v0.5 candidate** に defer:

**Defer justification**:
- STEP 1949 meta finding: Rei per-STEP exhibit style で isolated files は 60.9% = normal state、 「isolated → actionable」 mapping は Rei-context で 弱い
- Full parser 実装 cost 2-3h は 現時点で ROI 低い
- v0.5 起票 trigger: (a) lean4-mathlib で 明らか に 「abandoned pilot」 pattern が 増える (現在 substantive proof exhibit が大半) / (b) 藤本さん judgment で cleanup arc 起票

### (d) CF Pages verify

- **HTTP 200** in 0.44s
- **20 grep hits** for `Timeline v0.1|STEP 1947|STEP 1948|STEP 1949|STEP 1950|STEP 1951` on live site
- **STEP 1951 反映確認** = site update flow の end-to-end 成功

## Honest scope

- **主張しないこと**:
  - v0.4 の +55 RUIN net change を 「悪化」 と 誤読 しない: 20 files 正確 archive + 75 files newly-observed (measurement noise)
  - `data/*/latest.json` unconditional archive は active domain (fresh latest.json) も scoped-out 化 = 装置視野 損失、trade-off として 許容 (active は RUIN 分類されない = 監視上の実害なし)
  - Cap-based sampling instability (maxFiles=20000 + readdirSync 非決定 order) は **v0.5 candidate** = 決定的順序保証 or cap 撤廃
  - SnstRealComparison KEEP 判定 は 「永続保持」 ではない、 180-day-plus staleness + upstream implementation で re-evaluate
- **前提**:
  - v0.4 は v0.2 pattern を preserve + 追加、backward compatibility 完全
  - Test 49/49 PASS で classifier / consumption-mode / reference-graph の end-to-end 検証済

## Failure mode (機械学習用 dataset)

- **(ww) measurement noise を code change effect と誤帰属**: RUIN net +55 を v0.4 の「効果」 と 誤読 する drift。 Prevention: before/after diff は set-level (path 列) で 見る、count 単独で 判断禁止、noise source (cap sampling + mtime crossings) を明示。
- **(xx) 「keep-in-place 判定」 を 「永続保持宣言」 と 誤伝**: SnstRealComparison KEEP 判定 は 現時点 の 「削除 vs 保持」 の 保持側 decision であって、永続 immutability commitment ではない。 Prevention: 判定 に **re-evaluate trigger** を 併記 (時間経過 or upstream 変更 or 藤本さん directive)、無条件 保持 と 区別。
- **(yy) v0.5 defer を 「実装拒否」 と 誤伝**: v0.5 candidate (Lean parser) を defer するのは 現時点 ROI 低いから、 「絶対 実装しない」 では ない。 Prevention: defer justification に **起票 trigger** を 併記 (evidence 条件、時間条件、user directive 条件)。

## 詳細参照 (任意)

- Code changes:
  - `src/aios/orphan-gauge/consumption-mode.ts` v0.2 (114 line) → v0.4 (~130 line、ARCHIVE_PATH_REGEXES 新設 + classifyMode 中 check)
  - `test/step1926-orphan-gauge-test.ts` 45 → 49 tests
- Reports:
  - `data/orphan-gauge/step-1952/v04-report-summary.json` (counts + cluster distribution + measurement note)
- Prior arc:
  - STEP 1926 (v0.1 land) → 1947 (calibration) → 1948 (v0.2 archive detection) → 1949 (v0.3-lite pilot detector) → 1950 (cleanup) → 1951 (site update) → **1952 (v0.4 + judgments) [current]**
- CF Pages verify:
  - URL: https://rei-aios.pages.dev/tools/step-1926-orphan-gauge-device/
  - Status: 200 OK, 0.44s, 20 STEP-reference matches

## 追加 section — v0.5 candidates roster (未起票、藤本さん judgment 領分)

**Tier 1 (evidence 明確、ROI 高)**:
- **Cap-based sampling instability fix**: maxFiles=20000 撤廃 or deterministic sort (readdir 結果を sort) 導入。 measurement noise 根本解決。 ~1h implementation。
- **Actionable-rate 較正**: STEP 1947 のような n=50 sample review を **v0.4 remaining RUIN 389** で 再実施、実 actionable rate を 5x 改善予測 (18%) vs 実測 で 詳細確認。 ~2h effort (review time)。

**Tier 2 (methodology 依存、defer 継続)**:
- **Lean import-graph full parser** (STEP 1948 の v0.3 pattern (1))
- **chat-Claude CM-0 swap 評価** (STEP 1909 origin design、chat-Claude 判定 3 択 option 2 route の 別 branch)
- **`data/*/*/latest.json` (deeper nesting) archive**: v0.4 は 1-level のみ、2-level+ subdomain snapshot 未対応

**Tier 3 (仮想機能、evidence 不足)**:
- **Semantic reference detection**: 「あの spec に従う」 のような明示 path なし 参照の 拾い、false RUIN 削減 (STEP 1926 Honest scope 明記の 既知 lower bound、実装は semantic 分析器 依存)
