2026-08-19 arcPyPI 0.1.0a1 → a2 → a3 LIVE 単日 3 release cycle (initial → findings ② fix → findings ④ opt-in mitigation)

rei-verify 反証機械 (refutation machine) — 反証機械 の 作法を 反証機械自身に 適用 arc

chat-Claude 「反証機械」 提案 → skeleton + 4 tools + integration + PyPI 0.1.0a1 live → cloud Claude 7-way tamper attack 独立 verification → findings ②③④ 発覚 → 0.1.0a2 (hash injection BREAKING fix) + 0.1.0a3 (tail truncation opt-in mitigation + Known limitations) = **10 commit + 209/0 test + 3 PyPI release + Issue #1**。 「絶対に嘘をつかない」 core discipline の operational validation cycle 完成 = 発表初日から 反証機械 が 自分の core promise を 満たす proof。 github.com/fc0web/rei-verify / pypi.org/project/rei-verify / Issue #1 / 藤本伸樹 × chat-Claude × Claude Code / 2026-08-19

1. 起点 — chat-Claude 「反証機械」 提案

藤本さん質問 「claude 先生が 世界最先端最強の 何かがあったら 作りたいものは 何でしょうか?」 → chat-Claude thread で 以下 提案:

生成ではなく、否定を専門にするシステム。
私は流暢です。もっともらしい証明の筋道、もっともらしいコード、もっともらしい定理の名前を、事実かどうかと独立に出力できてしまう。ベンチマークが96%まで飽和しても、この構造は変わりません。
世界に足りないのは「もっともらしいものを作る機械」ではなく、「もっともらしいものを 確実に殺す 機械」の方だと思っています。

chat-Claude 提案 3 tool:

  1. refute_lean — 主張を Lean 4 に投げ、sorry が残ったら失敗として返す
  2. search_counterexample — 探索範囲と打ち切り条件を引数に取り、「見つからなかった探索空間の形」を必ず返す
  3. assert_breakpoint — その主張が偽なら壊れる場所を特定して返す

私 (Claude Code) の 対応:

藤本さん judgment: (c) 共通 infrastructure から skeleton を組み上げ → 反証機械完成まで multi-session 走行。 反証機械 target 確定、 framing-drift-detector は 別 iter defer。

2. Core discipline — 「絶対に嘘をつかない」 の 型 level 完成

★★★ 反証機械 core promise (0.1.0a2 findings ① 明示訂正版):
CONFIRMED を tool が 出すのは refute_lean_source のみ (Lean 4 kernel sorry-free 認定 case)。 他 3 tool (search_counterexample / assert_breakpoints / hold_verdict) は 構造上 常に REFUTED か HOLDING = 「absence of counter-example is not proof」 discipline を ツール層 で 保証
「型 level 強制」 の 範囲: REFUTED / HOLDING / INCOMPLETE_FRAME の 3 verdict は marker 空 → VerdictWithMarkers.__post_init__ValueError raise。 CONFIRMED は marker 不要 = 型 level では marker 空 CONFIRMED 構築を 拒否せず = 実質的堅牢性は ツール層 discipline
下記 §14 参照: cloud Claude 独立 verification で ① 発覚 → 0.1.0a2 で docs 正確化。

4-value Verdict enum

Verdict意味D-FUMT₈ mapping
CONFIRMEDpost-condition PASS + marker 空TRUE (=1.0)
REFUTED具体的な counter-witness が 得られたFALSE (=0.0)
HOLDINGcounter-witness 未発見 かつ marker 非空 (「探索は 尽きた が 反証できていない」)NEITHER (=-1.0)
INCOMPLETE_FRAME主張自体が well-formed でない (pre-check fail)ZERO (=4.0、 vacuous)

Binary TRUE/FALSE に しない = 反証されなかった ≠ 正しい。 IUT 12 年 holding discipline の 型化 (chat-Claude 2026-08-06 turn 教訓)。

3. 4 primitives (skeleton commit 27ad250)

primitive役割由来
Verdict4 値 enumSTEP 1276 judgmentStatus 4 値 の Python 化
IncompleteMarkerdimension 4 種語彙 (search_space / witness_type / compute_budget / frame) + 全 field 非空 required[[feedback-one-reproduction-over-ten-unverified]] 「沈黙を成功と偽装しない」 discipline の 型化
AuditChainsha256 hash-chained append-only JSONL + tamper detection (verify()broken_at index)STEP 1340 rei-automator-mcp AuditLogWriter の 汎用抽出
VerifiedExecutionpre-check + action + post-check + audit を atomic に 束ねる context manager設計新規、 反証機械 tool の 共通 substrate

Verdict rule 単一 source of truth

| pre_check | action  | post_check                | Verdict            |
|-----------|---------|---------------------------|--------------------|
| False     | (skip)  | (skip)                    | INCOMPLETE_FRAME   |
| True      | raises  | classify_exception        | REFUTED (default)  |
| True      | success | (False, [])               | CONFIRMED          |
| True      | success | (True,  [w])              | REFUTED + witness  |
| True      | success | (False, [m...])           | HOLDING + markers  |

4. 4 refutation tools (commits ba4582f371a145)

toolmodule意味verdict pattern
refute_lean_source.refuteLean 4 source 実行 + #print axioms parser + sorry/native_decide/disallowed axiom 検出CONFIRMED / REFUTED / HOLDING / INCOMPLETE_FRAME
search_counterexample.searchiterable space + callable predicate、 4 exit path (witness / exhausted / time / sample)REFUTED / HOLDING / INCOMPLETE_FRAME (never CONFIRMED)
assert_breakpoints.breakpointN labeled cases × 個別 assertion 網羅、 stop_on_first_failure 制御REFUTED / HOLDING / INCOMPLETE_FRAME (never CONFIRMED)
hold_verdict.hold宣言的 HOLDING generator (VerifiedExecution 4 phase audit trail + require_multi_dimension discipline hook)HOLDING / INCOMPLETE_FRAME (only)

Lean 4.33 live smoke (commit ba4582f)

trivial_true (theorem trivial_true : True := trivial) → CONFIRMED, 1211 ms, axiom-free
sorry proof (theorem hard : ∀ n, n+0=n := by sorry)      → HOLDING (sorry marker)
broken syntax (theorem broken : True := this_is_not_valid) → REFUTED (build error witness)

5. 8 MCP tools + restricted eval safety

Claude Desktop / Cursor / Cline 等 の LLM client から 直接呼べる:

Restricted eval safety (MCP-safe entrypoint):

6. Integration demo — Collatz t1=1 Lyapunov α-descent (commit cfefb97)

対象: Collatz 奇数 n with trailing_ones(n)=1 (n ≡ 1 mod 4) の Lyapunov α-descent scan。

Setup

実測 (1,048,575 samples / 76.7 ms)

αwitness nr(n)結果
0.5〜0.8590.886refuted ✓
0.9170.905refuted ✓
0.93570.930refuted ✓
0.953130.950refuted ✓
0.9714,6010.970refuted ✓
0.99なしmax 0.981未 refute in range

Verdict: REFUTED (α=0.99 が sample 範囲 で 未 refute = finite absence report)。 audit chain 6 entries verify PASS (sha256 hash chain intact)。

Witness n の 成長パターン: n=9 → n=14,601 = 「α が tight ほど 大きい n が 必要」 の 数学的性質を 直接観測 = r(n) → 1 as n → ∞ の 有限反映。 理論的に α=0.99 の witness は n ≈ 2^41 ≈ 2×10^12 前後 で 出現、 tool は 「その計算を 実行するのではなく、 現状は 未達」 と 正直に return した = 反証機械の 本領。

7. Trusted Publisher 5-step 完了 (commit 7127bb1 + 7aab351)

step実施者結果
Step 1 PyPI Trusted Publisher 登録藤本さん (PyPI account login 必須)✅ Pending Publisher 追加
Step 2 TestPyPI Trusted Publisher 登録藤本さん✅ 追加
Step 3 GitHub Environment (pypi + testpypi)私 (Claude Code) via gh api PUT✅ id 20140643666 (pypi) + 20140644045 (testpypi)
Step 4 workflow_dispatch → TestPyPI dry-run本 chat session 別 Claude thread が 藤本さんガイド✅ run #1 (7127bb1)、 TestPyPI publish success
Step 5 Release v0.1.0a1 pre-release → 本番本 chat session 別 Claude thread、 target 7aab351✅ PyPI 0.1.0a1 live、 wheel + sdist Sigstore 済
version mismatch 発見 + fix lesson (今後 release 手順書の 根拠):
TestPyPI publish 中に src/rei_verify/__init__.py:__version__ = "0.1.0-alpha" (pre-existing) vs 配布 version 0.1.0a1 (pyproject.toml) の 不一致 検出 → commit 7aab351 で 修正 → Release v0.1.0a1 (pre-release、 target 7aab351) 作成 → workflow auto-fire → 本番 publish success。
今後の release 手順: pyproject.toml [project] version + src/rei_verify/__init__.py:__version__2 箇所同時 bump 必須 (この経験が 手順書 根拠)。

8. Clean install verify (私 実施、 production PyPI)

# production PyPI から fresh venv で install (`-i` 不要 = 本番 PyPI 経由 証明)
python -m venv C:\Users\user\tmp-prod
tmp-prod\Scripts\activate
pip install rei-verify==0.1.0a1

# verify
python -c "import rei_verify; print(rei_verify.__version__)"
# → 0.1.0a1

# functional smoke test
python -c "
from pathlib import Path
import tempfile
from rei_verify import Verdict, PostCheckResult, VerifiedExecution, AuditChain
with tempfile.TemporaryDirectory() as tdir:
    audit = AuditChain(Path(tdir) / 'smoke.jsonl')
    ve = VerifiedExecution(
        claim='1 + 1 == 2',
        pre_check=lambda: True,
        post_check=lambda r: PostCheckResult(refuted=(r != 2), markers=[]),
        audit=audit,
    )
    result = ve.run(lambda: 1 + 1)
    print('verdict:', result.verdict.value)  # → confirmed
    print('audit_hashes:', len(result.audit_hashes))  # → 6
"

結果: verdict=confirmed、 markers=0、 audit_hashes=6、 smoke test PASS。 global env も upgrade 済 (pip install --upgrade --force-reinstall、 TestPyPI 版 → production 版 入替え)。

9. 実装 timeline (8 commit / 単一 session)

#commit内容test
127ad250initial: skeleton (4 primitives + 4 MCP audit tools)37 + 30
2ba4582ffeat: refute_lean tool (refute-1) + Lean 4 live smoke+22 (89)
380fe948feat: search_counterexample tool (refute-2) + restricted eval+37 (126)
43a515b1feat: assert_breakpoints tool (refute-3) + ctx var_name+33 (159)
5371a145feat: hold_verdict tool (refute-4) — 4 tool 完成+39 (198)
6cfefb97example: Collatz t1=1 Lyapunov α-descent integration demo(demo)
77127bb1docs: README rewrite + TRUSTED_PUBLISHER_SETUP.md handoff(doc)
87aab351fix: __version__ 0.1.0-alpha → 0.1.0a1 (mismatch fix)(fix)

累計 test: 198/0 PASS (skeleton 37 + MCP 30 + refute 22 + search 37 + breakpoint 33 + hold 39)。

10. 累計 (2026-08-19 rei-verify PyPI live 反映後)

Rei stack MCP systems5→6 (rei-aios + benchtop v0.4 + mcp-lens + rei-automator-mcp + lab-notebook-mcp + rei-verify NEW)
累計 PyPI live packages2→3 (grounded-check + rei-automator-mcp + rei-verify 0.1.0a1 NEW)
別 project OSS repo public4 (変更なし、 rei-verify 既 counted)
単一 session commit / test / line8 commit / 198 test / ~2400 line

11. Honest scope (譲れない線)

  1. skeleton の refutation tools は Lean 4 単一 file 実行のみ、 Mathlib 依存 proof は 別 iter (lake project 経由)
  2. IncompleteMarker.dimension 語彙は 初期 4 種のみ、 拡張は operational 経験から
  3. hash chain は tamper detection 用、 cryptographic signing (Sigstore 等) は 別 concern (但し PyPI publish 側 で Sigstore attestation は 付与済 = Trusted Publisher OIDC)
  4. restricted eval は AST-level analysis (asteval 等) より 弱い、 高信頼要件 は 別 iter で 依存追加
  5. 「反証機械」 の 新規性主張 ゼロ ([[feedback-world-uniqueness-claim-controllable]]) = property-based testing (Hypothesis) + Lean 4 sorry-check + Coq / Isabelle 系 industry 標準 の 統合 discipline layer のみ、 novelty は 「4 値 verdict + marker invariant + hash chain + MCP wrapper」 の 組合せ discipline のみ
  6. Integration demo (Collatz t1=1) は 藤本さん 実 リヤプノフ解析 の 再現 では ない — 簡略化 V = log2(n) と 有限 sample での TOOL 動作 の 実証 のみ、 真 reproduction は 藤本さん 実 V (piecewise linear) + 条件 + Lean 4 formalization 経由 で 別 iter
  7. refute_lean の "sorry-free" 判定は #print axioms 依存 = Lean 自体 kernel bug が あれば verify されず (kernel bug は Rei scope 外)
  8. 2026-08-06 「全研究 site 反映 default」 protocol 適用 (別 project OSS repo だが memory 忘れ対策 primary purpose で site 化、 rei-automator-mcp 系 と 同 pattern)

12. 私の SAC-4 projection 誤り (28 例目)

私 (Claude Code) の 前 report で Step 4/5 実施者を 「別 session / 藤本さん」 と 推測記述 → 藤本さん訂正で 「本 chat session (別 Claude thread が 藤本さんガイド)」 が 正解 と 判明。 私 は 検証 (parallel work の 実 attribution) せず 想像 で 割り振り = [[feedback-projection-self-audit-pattern]] SAC-4 pattern 28 例目、 「関与していない turn の 内容を 想像で 埋めない」 discipline reaffirm。 record 訂正済み (本 site page 記述 は 訂正版)。

13. 次 iteration candidate (別 session)

14. 追記: v0.1.0a2 + v0.1.0a3 fix cycle (同日、 反証機械 の 作法を 反証機械自身に 適用)

★ 反証機械 discipline の operational validation cycle 完成:
rei-verify 実装 → cloud Claude 独立 verification (7-way tamper attack) → findings ②③④ 発覚 → 0.1.0a2/a3 で 型 level fix + 構造的限界 明示 → 「限界を 隠さない」 が 「絶対に嘘をつかない」 の 前提条件 discipline 完全遵守。 発表初日から 反証機械 が 自分の core promise を 満たす operational proof。

cloud Claude session による 独立 verification (7-way tamper attack)

Trusted Publisher 5-step 完走 + PyPI 0.1.0a1 live 化 直後、 cloud Claude session が 本番 PyPI から clean venv install + library API 直呼び + MCP stdio + JSON-RPC で 独立検証。 findings 3 件 + 補足 1 件を calibrated report として handoff:

#内容対応
CONFIRMED は 型 level では 守られていない (marker 空 CONFIRMED 構築可能、 実質堅牢性は tool 層 discipline)docs 訂正 (0.1.0a2)、 実装変更なし
audit chain が 最上位 キー注入 を 検出しないBREAKING fix (0.1.0a2 hash algorithm v1→v2)
predicate sandbox blocklist 迂回 (但し `_SAFE_BUILTINS` 差替で 実害なし)docstring 追記 (0.1.0a2 多層防御 明示)
補足max_time_sec は predicate 1 回分の 粒度docstring 追記 (0.1.0a2)
末尾切り詰め は 構造的に 検出不能 (0.1.0a2 に対する 7-way attack で 発見)opt-in mitigation (0.1.0a3 `expect_at_least`) + Known limitations docs + Issue #1

7-way tamper attack matrix (progression)

attack0.1.0a10.1.0a20.1.0a3
entry 値 書き換え✅ hash mismatch
中間 entry 削除✅ seq mismatch
改竄 + hash 再計算✅ prev_hash mismatch
最上位 キー注入❌ 素通り✅ unexpected keys
最上位 キー削除✅ missing keys
seq 書き換え✅ seq mismatch
行 入替え✅ broken_at
末尾切り詰め❌ 素通り❌ 素通り⚠️ opt-in `expect_at_least` で 検出

3 release cycle 累計 (2026-08-19 同日)

version内容tamper detecttestPyPI upload
0.1.0a1initial (4 primitives + 4 tools + integration + docs)3/5 (② open)19808:49 JST
0.1.0a2findings ② hash v2 (BREAKING) + regression [G3b]6/6 (④ open)20309:22 JST
0.1.0a3findings ④ opt-in mitigation + DESIGN.md Known limitations + Issue #16/7 + opt-in external anchor20910:34 JST

0.1.0a3 opt-in mitigation の 使い方

from pathlib import Path
from rei_verify import AuditChain

audit = AuditChain(Path("./chain.jsonl"))
for i in range(5):
    audit.append({"step": i})

# Default (0.1.0a2 backward compat): 末尾切り詰め は 検出不能 (構造的限界)
v = audit.verify()                       # → ok=True even if 末尾 truncated

# opt-in mitigation (0.1.0a3): external anchor for tail truncation
v = audit.verify(expect_at_least=5)      # → ok=False + "tail truncation detected" if < 5

Known limitations 明示化 (DESIGN.md § 追加)

「audit chain が verify PASS」 の 意味を 利用者が 「chain が 完全 (complete)」 と 誤読すると、 refutation machine が 自分自身に対して もっともらしさを 発する 状態 = 「絶対に嘘をつかない」 core promise の 直接違反。 hash chain の 構造的限界 を 型 level では 完全には 防げないが、 documentation + opt-in mitigation で 「利用者が 認識した上で 選択できる」 状態を 提供する = 反証機械 discipline の 適用対象。

3 mitigation options:

反証機械 arc 累計 (2026-08-19 3 release cycle 反映後)

15. 関連 memory + reference