STEP 2216 — arxiv-audit-index.ts shared module 抽出

2026-09-23 · rei-aios-2e · Session-day arc STEP 2215 defer #5 応答 · STEP 2208 pattern 継承
Summary: Session-day arc close (STEP 2215) の 帰宅後 defer item #5 (fm-code-duplication-audit-index-build) を STEP 2208 の shared-helper 抽出 pattern に沿って resolve。 scripts/research-radar/score-papers.ts (STEP 2203 Feature 1) + scripts/research-radar/arxiv-fetcher.ts (STEP 2212 Item #4) の 2 箇所 に 重複していた Map<string, AuditRecord> build (step-extract regex + normalize + step_audit_history → notes fallback) を 新 shared module arxiv-audit-index.ts に 抽出。 未来 の step-extract regex / normalization 変更 の silent drift を 構造的排除。 STEP 2212 が本 STEP を 「未来 candidate」 として 明示指名 = 直接応答。

Fm addressed

fm-code-duplication-audit-index-build (STEP 2215 defer #5 marker): STEP 2208 で 4-signature regex を arxiv-withdrawal.ts に 抽出した際、 audit-index build 側 の 「1 箇所 update すれば 両 caller 反映」 の structural fix は 未着手 で 残っていた。 chat-Claude(cloud) STEP 2206 corrigendum で 「shared helper 抽出 は 放置すると 2 箇所 が 静かに ずれる」 明示指摘、 STEP 2212 notepad で 本 STEP を 未来 candidate として 明示指名。

Implementation

新規 shared module

File: scripts/research-radar/arxiv-audit-index.ts (89 line、 3 public export)

Export役割
AuditRecord interfacearxivId / step / alignment / withdrawn + optional verificationState / citationPosture (全 caller の superset)
extractStepFromPaper(p)step_audit_history[0] regex → notes fallback → 空文字 return (未来 の 3rd caller も 同 rule 保証)
loadAuditIndex(watchFile)Map<string, AuditRecord> return。 watchFile absolute path 引数化 (元 score-papers hardcoded から caller 明示化)

Refactor (2 caller)

File変更Net line
score-papers.tsLocal AuditRecord + loadAuditIndex 削除 → shared import。 副産物 extractArxivId → extractCanonicalArxivId (arxiv-withdrawal.ts STEP 2208) rename。-59
arxiv-fetcher.tsInline Map build (20 行) 削除 → loadAuditIndex(WATCH_FILE) 呼出。 auditMarkerFor 内部 logic 不変。-22

合計 +89 (new) -59 -22 = +8 line net。 但し 論理 duplication は 2 → 1、 副産物 extractArxivId = extractCanonicalArxivId の 3-way drift risk も 除去。

Marker format 意図的 non-centralization

Marker 生成 は shared 化 せず、 各 caller 用途 に 合わせて 保持。 arxiv-audit-index.ts docstring で 明示。 未来 用途 分岐 が 3 系統 以上 emerge したら centralize 検討 candidate (現状 over-engineering avoidance)。

Test (behavior equivalence verify)

Type-check

4 module 全 (arxiv-audit-index.ts + arxiv-withdrawal.ts + score-papers.ts + arxiv-fetcher.ts) tsc --noEmit 通過。

Shared module smoke test

audit index size: 14
withdrawn count: 1
  ⚠ 2605.13886 STEP 2202 (Niu、 STEP 2202 emerge 済 withdrawn 判定)
Sample: 2603.11066 → STEP 1269 / ALIGNED / withdrawn=false

score-papers.ts re-run (2026-09-22 date)

arxiv-fetcher.ts live path

本 session 未実行 (arxiv HTTP budget 保持)。 Import 解決 + auditMarkerFor 内部 logic 不変 で 高 confidence、 次回 daily-radar cron 稼働時 に 実効 verify。

Effect

Honest scope

Attribution chain