Skip to content

[eval] 反復している欠陥クラス: gate / prose が実際に検証しているものについて虚偽の陈述をする(4 リポジトリで独立に検出) #97

Closed

Description

@rebuildup

概要

4 つの別リポジトリで独立に「gate / prose / comment が実際に検証している
ものについて虚偽の陈述をする」欠陥被发现した。偶然ではなく、
同じ欠陥クラスが反復している。組織的な問題として扱う。

確認済みの 4 例

1. rebuildup/ty-plus #175 / PR #176

Windows-only check が SKIP して exit 0 する,导致 release gate が緑に
なるが Windows 側は何も検証されていない。
さらに PR #176(当該 issue の修正)は** 자신의 thesis に反する** —
新規追加した windows-release-gate owner が Playwright Chromium を install せず
browserType.launch で失敗する。PR 自身の ADR が
「an owner that cannot discharge its responsibility is not an owner」と明記し、
その exact failure を予測しながら未解決のまま出荷している。
関連: vitest が numTotalTests: 0 でも "success": true を返す(latent)。

2. rebuildup/my-web-2026 #260

version:check が pull_request event で不活性。
GITHUB_HEAD_REF は ticket branch、GITHUB_REF_NAME は <pr>/merge のため
release branch 名が導出されず、check が no-op になる。
赤い release trunk を PR 段階で検出できない。
結果として #248–#251 の 4 PR が red trunk に merge された。

3. rebuildup/u-sekai #75

.github/workflows/ci.yml:16-18 が ref: なしで checkout し、
version:check に merge tree の package.json を渡す一方 branch name は
GITHUB_HEAD_REF から取る。比較対象と基準が別 tree 由来。
head が 0.2.0 の release-0-3-0 branch が main が 0.3.0 になると PASS する。
scripts/release-rules.mjs は publish 前の required check に ci.yml を列挙。

4. rebuildup/readmark #72

listBookmarks / listHighlights が存在しない compound index を指定し
[documentId+sourceFingerprint] を叩いている(schema は +pageIndex のみ宣言)。
Dexie は存在しない index に throw せず、結果を正しく返しながら
full table scan に fallback する。そして両ファイルの doc comment は
「indexed read」と主張している。

共通する構造

いずれも以下のいずれかである。

  1. gate が意図せず inactive になる(event / ref / index の取り違え)
  2. gate が active だが-names 対象と基準が異なる(merge tree vs head tree)
  3. gate が結果を返すがFord check していない(結果の正しさ ≠ 検証されたこと)
  4. prose / comment が gate の実挙動を誤記(ty-plus ci.yml:355、B1、
    u-sekai merge-method-contractの空白依存を解消する #76、readmark miseを標準toolchain/bootstrap Practiceとして導入する #72)

3 と 4 が特に危険である。looks green だが何も検証していないため、
レビューは 自発的な green として受け入れる。

提案

各リポジトリに個別修正はすでに行っている/正在进行。
本 Issue で求めたいのは class 全体のAudit と再発防止 mechanism。

  • 上記 4 リポジトリ全てで同じ class の instance を網羅的に列挙する
  • 各 instance の「何を検証すると主張していたか / 実際は何を検証したか」を
    対比表にする
  • event / ref 解決の誤りを防ぐ deterministic check の設計
    (preconditions として「gate が inactive なら fail する」ことを
    自己検証させる)
  • 結果の正しさ ≠ 検証済み を防ぐ assertion の設計
    (0 件 success、index 未使用、skip=success を含む)
  • prose と gate 実装の乖離を検出する mechanism
    (コメントの complexity を gate の実行結果と突き合わせる eval)
  • 上記を evals/ にどの形で実装するか(constitutional-contract / controls.sh 相当)

補足

これは Supervisor が 4 リポジトリを横断運用した過程で独立に検出した。
既存 eval がこの class を捕捉できていないことの証拠でもある。
skills/quality-gate / skills/correctness-assurance との関連を要確認。

Refs: ty-plus#175, my-web-2026#260, u-sekai#75, u-sekai#76, readmark#72

Activity

  1. rebuildup commented on Oct 5, 2026

    @rebuildup
    OwnerAuthor

    第 5 例を追加 — rebuildup/u-sekai #78

    作業中に発見された、本 class で最も直接的な实例。

    "test:unit":        "vitest run --dir test/unit        --reporter=default",
    "test:integration": "vitest run --dir test/integration --reporter=default",
    "test:e2e":         "vitest run --dir test/e2e         --reporter=default"

    上記 3 script が 1 つも test を発見せず exit 0 になる。既存 unit test 21 件を含め
    何も実行されない。

    原因: Vitest の --dir <path> は root を上書きする。vitest.config.ts の
    include は root 相対であり:

    include: ['test/unit/**/*.test.ts', 'test/integration/**/*.test.ts', 'test/e2e/**/*.test.ts']

    --dir test/unit を渡すと root が <repo>/test/unit となり、include は
    <repo>/test/unit/test/unit/**/*.test.ts に解決されて一致しない。

    なぜ最も直接的か: gate が「0 件」を報告し、その.script は日常的な検証手段として
    Issue / PR の acceptance criteria に引用されていた
    。つまり複数の ticket が
    偽の green を受領していた。gate が壊れているのではない。gate が何もしていない。

    重要な補足: npm run ci は npm run test(--dir なし)を使うため
    影響を受けない。ci の green は信頼できる。壊れているのは
    test:unit / test:integration / test:e2e のみ。

    再発防止の要点: script を直すだけでは再発する。「0 file を発見したら failure に
    する」guard
    (passWithNoTests: false 相当)が核心である。

    リポジトリはこの class を認識している

    test/vitest.browser.config.ts のコメント:

    A test that silently skips when the browser is missing would be a
    false green, so nothing here is conditional

    false green への認識は browser profile に存在するが、test:unit 側に
    同種が遺留している。同一リポジトリ内で、意識された class と
    意識されていない instance が同居している。

    本 Issue への示唆

    5 例に共通するのは、**いずれも「gate が意図せず inactive になる」または
    「gate が結果を返すが Ford check していない」**という点である。
    第 5 例は前者の最も純粋な形であり、検出の容易さは高いのに未検出であった。

    したがって prevention は「人力レビュー」ではなく
    deterministic な自己検証が要る。具体的には:

    • test runner が 0 件収集したら必ず非 0 で落ちること
      (passWithNoTests の明示的 false 化)
    • CI が 実行された test 数を検証結果として必須出力にすること
      (0 件 success を success として解釈させない)
    • gate の include / root / event 条件を実行時に自己検証する
      negative test を各リポジトリに 1 本ずつ置くこと
  2. rebuildup commented on Oct 5, 2026

    @rebuildup
    OwnerAuthor

    第 6 例を追加 — rebuildup/readmark #76

    prose が実在しない invariant を主張する事例。 既存 5 例は
    すべて CI/gate の挙動に関するものだったが、本例は コード中の comment である。

    // src/ui/reader-view.tsx:123-125
    /**
     *  Must match the `.rm-reader-scroll` / `.rm-reader-pages` padding in
     *  `styles.css`, or a fitted page will overflow by exactly this much
     *  and the user gets a horizontal scrollbar on first open. */
    export const FIT_WIDTH_PADDING_PX = 48;

    検証した事実:

    .rm-reader-scroll { padding: 20px 0 60vh; }   /* 水平 padding は 0 */
    .rm-reader-pages  { display: flex; ... }        /* padding なし */

    48 を mirror している selector は存在しない。
    48 は stylesheet 由来ではなく意図的な余白であり、挙動は正しい
    (実ブラウザ smoke で確認済み)。

    なぜ最も危険か

    値が正しく(test は green)、現象はブラウザでしか現れない。
    而且 comment は「一致させ 否则壊れる」と書いているので、
    後続作業者は它是 bug ではなく仕様 misunderstand する。
    0 に「修正」した瞬間に横スクロールバーが現れるが、
    その変更は unit test では検出されない。

    既存 5 例と共通する構造は「検証していないのに検証済みのように見える」こと。
    本例ではその担い手が human reader である。

    本 Issue への示唆(更新)

    6 例を整理すると、欠陥の担い手は 3 種類ある:

    1. CI / gate の event・ref 解決の誤り(#260, release: 0.3.0 #75, artifact evidenceをcurrent head provenanceへ拘束する #78)
    2. gate が結果を返すが check していない(miseを標準toolchain/bootstrap Practiceとして導入する #72, ty-plus#175)
    3. prose / comment が実挙動と一致しない(ty-plus B1/B6, u-sekai#76, readmark#76)

    3 番は CI では検出できない。 static check の対象になりにくく、
    かつ「値が正しい」ため test も落ちない。

    したがって prevention に3 番目の型を加える必要がある:

    • constant / config 値に対する stylesheet・定数間の mirror 関係を
      実際に検証する
      mechanism
      (例: 「X は Y の padding と一致するensin Theo」という comment があるなら、
      その一致を check する。ただし本例では一致していないのが正しいので、
      「意図的な非一致」を明示する記法(例: 余白を表す名前の付いた token)の方が
      本質的)
    • comment が主張する invariant と、実装の挙動の乖離検出 eval
      (人手レビューに依存しない形)
    • 价值观: 「 값が正しい comment が誤っている」 場合を明示的に扱う。
      test green は comment の正確性を保証しない。

    Refs: ty-plus#175, my-web-2026#260, u-sekai#75, u-sekai#76, u-sekai#78,
    readmark#72, readmark#76

  3. rebuildup commented on Oct 5, 2026

    @rebuildup
    OwnerAuthor

    第 7 例を追加 — rebuildup/ty-plus #179(本 class で最も危険な实例)

    u-sekai #78 の訂正Prefs(3 worker が独立に exit 1 を観測)を受けて
    同じ class の中で方向が逆の实例が見つかった。比較が本質である。

    #78(u-sekai): fail closed — 検証を不能にする

    npm run test:unit が 0 file を発見し exit 1。
    passWithNoTests 未設定 → Vitest 5 の default が false のため落ちる。
    偽の green は生じていない。

    #179(ty-plus): silently passes — 検証を騙す

    # (1) include が何も一致しない  -> EXIT 1   (落ちるので安全)
    $ bunx vitest run --root .tmp/zt
    EXIT CODE: 1
    
    # (2) file は収集されるが 1 件も実行されない  -> EXIT 0, success: true
    $ bunx vitest run --project=unit -t "zzz_no_such_test_zzz" scripts/verify/x.test.ts
    EXIT CODE: 0
    json.success: true | numTotalTests: 25 | numPassedTests: 0
    
    # (3) suite 全体が describe.skip  -> EXIT 0(中身の throw も走らない)
    $ cat scripts/probe.test.ts
    describe.skip("suite", () => { it("never runs", () => { throw new Error("must not run"); }); });
    $ bunx vitest run --project=unit scripts/probe.test.ts
    EXIT CODE: 0

    passWithNoTests の既定保護は「file が 0 件」の場合しか効かない。
    「file は収集されたが test の実行が 0 件」という状態には効かない。

    なぜこれが最も危険か

    release-gate の aggregate は job の結果だけを読む。
    したがって 何も検証していない partition が「discharged された」と判定される。

    これが #175 の構造と同型である。#175 は
    「Windows check が SKIP して exit 0 し、release gate が緑になる」。
    #179 はその test 単位の版であり、
    partition 全体が緑になるのではなくその partition の中身が空になる。

    gate が「通過した」と言いながら、検証什么都没 was Doing。
    これが本 class の核心であり、#78 とは方向が逆である。

    本 Issue の.dispatch への示唆(改訂)

    class を 2 軸で整理する:

    fail closed silently passes
    例 u-sekai #78 ty-plus #179
    症状 0 file で exit 1 file 収集・test 実行 0 件で exit 0
    被害 検証不能(noise) 検証を騙す(dangerous)

    判別の要点は「file が収集されたか」ではなく「test が実行されたか」である。
    passWithNoTests は前者のみを保護し、後者を保護しない。
    したがって prevention には「実行 test 数の下限」が必要であり、
    「file 数の確認」では不十分である。

    • 各 test partition について 実行test 数 を検証する mechanism
      (numPassedTests / numTotalTests の監視。total > 0 だけでは不十分で、
      passed > 0 が必要)
    • -t filter が何も一致しない場合に fail する
    • describe.skip / it.skip で全体が空になった partition を検出する
    • release gate の aggregate が 「job が緑」ではなく
      「その job が実際に何かを検証したか」
      を見る
    • 上記を evals/ に deterministic check として実装する
      (閾値 policy が必要なため、gate 機構そのものの追加になる。
      既存 job を緩めるのではなく、新しい gate を追加する方向)

    Refs: ty-plus#179, u-sekai#78, ty-plus#175

  4. added a commit that references this issue on Nov 23, 2026
  5. rebuildup commented on Nov 23, 2026

    @rebuildup
    OwnerAuthor

    PR #195 を release-0-13-0 へ統合完了しました(merge commit: 664d391cb06b8410dd203c989f40ff376d163689)。gate-honesty 検証器・workflow honesty チェック・実行件数検証・negative control が release-0-13-0 に到達しているためクローズします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions