Skip to content

quality: actual execution と reported claim の乖離を検出する gate honesty 検査を追加 (#97) - #195

Merged
rebuildup merged 2 commits into
release-0-13-0from
97
Nov 23, 2026
Merged

rebuildup merged 2 commits into
release-0-13-0from
97

Conversation

@rebuildup

Copy link
Copy Markdown
Owner

Linked Issue: #97
Target Release: 次期 release(v0.13.0 carry-over。v0.12.0 candidate freeze 中のため release-0-12-0 へは自律 landing せず、v0.12.0 公開後に release-0-13-0 へ retarget して統合する / ADR-0032)

概要

  • Issue [eval] 反復している欠陥クラス: gate / prose が実際に検証しているものについて虚偽の陈述をする(4 リポジトリで独立に検出) #97 本文および後続コメント(u-sekai #78 訂正・readmark #76・ty-plus #179)を反映し、fail-closed(u-sekai #78:0 file 収集で exit 1) と silent pass(ty-plus #179:file 収集あり・実行 0 件や全 describe.skip で exit 0) を明確に区別する検査 scripts/quality/check-gate-honesty.mts を追加。
  • 3 種類の欠陥担い手を negative/positive control で検証:
    1. CI event/ref/tree 不一致(u-sekai #75 / my-web-2026 #260 型の merge tree checkout + GITHUB_HEAD_REF 参照、|| true / continue-on-error による失敗隠蔽)
    2. 実行 0 件・全 skip・SKIP partition の成功偽装・fallback 実行(ty-plus #175/#179, readmark #72)
    3. コードコメント/prose が主張する未検証 mirror invariant(readmark #76)
  • skills/quality-gate/references/gate-honesty.md に対比表と契約を分離し、.github/workflows/eval-controls.yml へ workflow honesty チェックを接続。

検証

  • bun run typecheck: PASS
  • bun run quality:structure: PASS(findings: 0)
  • bun run test:gate-honesty: PASS(4 test groups / 全 negative & positive controls)
  • node scripts/quality/check-gate-honesty.mts workflow .github/workflows/eval-controls.yml: PASS
  • bun evals/policy-evaluation/controls.mts: PASS(context-budget PASS)

Refs #97(release-0-13-0 への retarget・統合完了後に close)

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c6e32e5 and 7b988a2.

Files selected for processing: 16

  • .github/workflows/eval-controls.yml
  • evals/policy-evaluation/controls.mts
  • evals/policy-evaluation/gate-honesty-controls.mts
  • package.json
  • scripts/gate-honesty/checker.mts
  • scripts/gate-honesty/cli.mts
  • scripts/gate-honesty/gate-honesty.test.mts
  • scripts/gate-honesty/index.mts
  • scripts/gate-honesty/parsers.mts
  • scripts/gate-honesty/types.mts
  • scripts/gate-honesty/verifiers.mts
  • scripts/quality/check-gate-honesty.mts
  • scripts/quality/check-gate-honesty.test.mts
  • skills/correctness-assurance/SKILL.md
  • skills/quality-gate/SKILL.md
  • skills/quality-gate/references/gate-honesty.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@rebuildup

Copy link
Copy Markdown
Owner Author

独立コールドレビューで指摘された P0 / P1 / P2 欠陥をコミット 7b988a2 で修正しました。

修正内容

  1. [P0] checkTestExecution の判定ロジックおよび不変条件を修正 (scripts/gate-honesty/checker.mts)
    • exitCode === 0 で numFailedTests > 0 または reportedSuccess !== true の場合に誤って VERIFIED を返していた不具合を修正し、FAIL(FAILED_TESTS_WITH_ZERO_EXIT / INCONSISTENT_SUCCESS_EXIT)を返すよう変更。
    • floor < 1 や非整数 floor を INVALID_FLOOR で拒否。負数件数、numCollectedFiles === 0 なのにテスト件数が正、結果合計が numTotalTests 超過、exitCode === 0 で実行件数 0(passed + failed + skipped + cancelled === 0)をすべて fail-closed 化。
  2. [P0] 実ランナー出力パーサーと CI / evals/ への実実行件数検証を接続 (scripts/gate-honesty/parsers.mts, cli.mts, package.json, .github/workflows/eval-controls.yml, evals/policy-evaluation/gate-honesty-controls.mts)
    • parseNodeTestTap(output) および parseVitestJson(output) を追加(空出力・不正形式は fail-closed、テスト出力内の擬似 # pass 行による偽装を防止)。
    • CLI に --verify-tap <file|stdin|-> --floor N、--verify-vitest-json、--run-and-verify --floor N -- <cmd...> を実装。
    • package.json の test:gate-honesty と .github/workflows/eval-controls.yml で、実際の node --test --test-reporter=tap 実行結果に対して通過件数 >= 1 を検証するよう配線。
  3. [P0] checkClaimHonesty のバイパスと CLI JSON スキーマ検証を修正 (scripts/gate-honesty/checker.mts, cli.mts)
    • 空の requiredPartitions: [] を EMPTY_REQUIRED_PARTITIONS で拒否。
    • claimedSha / executedSha / partition.sha に対して 7–40 桁 hex SHA 検証(INVALID_SHA / SHA_MISMATCH)を追加。
    • 重複 partition 名を DUPLICATE_PARTITION_REPORT として検出し、後続レコードによる先行失敗の上書きを防止。
    • CLI claim モードで厳密なスキーマ検証を行い、欠損・型不一致時は終了コード 2 で失敗。
  4. [P1] checkWorkflowHonesty の強化と全 workflow 一括検査 (scripts/gate-honesty/checker.mts, .github/workflows/eval-controls.yml)
    • --workflows-dir .github/workflows モードを追加し、.github/workflows/ 配下の全 .yml / .yaml(3 ファイル)を検査するよう eval-controls.yml を更新(単一ファイル指定も維持)。
    • 空・不正 YAML で fail-closed(INVALID_WORKFLOW_YAML)。
    • workflow / job / step の env: レベルでの GITHUB_HEAD_REF・github.event.pull_request.head.* 参照、pull_request 時の actions/checkout での ref: ${{ github.ref }} / 可変 head.ref 指定、job / step レベルの continue-on-error: true、|| true / || : / || exit 0 / set +e(シェルコメント # ... は除外して誤検知防止)を検出。
    • これに合わせて .github/workflows/eval-controls.yml の Run deterministic controls ステップから set +e を除去。
  5. [P1] boolean 自己申告を実データ検証へ置換 (scripts/gate-honesty/verifiers.mts)
    • verifyCssMirror(readmark #76 クラス):定数/selector 主張と実 CSS の selector / property / value を決定論的に照合。
    • verifySchemaIndexes(readmark #72 クラス):SQL DDL / Dexie schema 宣言と主張 query 列の左端一致インデックス被覆を検証。
    • evals/policy-evaluation/controls.mts に gate-honesty-controls.mts を追加。
  6. [P2] ドキュメントおよび相互参照を補完 (skills/quality-gate/references/gate-honesty.md, skills/correctness-assurance/SKILL.md)
    • 監査対比表に全記録事例(u-sekai #78 fail-closed vs ty-plus #179 silent pass、ty-plus #175 / PR #176、my-web-2026 #260、u-sekai #75 / #76、readmark #72 / #76、ty-plus B1/B6)を網羅。
    • skills/correctness-assurance/SKILL.md から ../quality-gate/references/gate-honesty.md への相互参照を追加(context-budget-baseline.tsv および skills/github-delivery/SKILL.md は未変更)。

検証コマンド・結果(HEAD 7b988a2)

  • bun run typecheck: PASS
  • bun run quality:structure: PASS (findings: 0)
  • bun run quality:workflow-honesty (.github/workflows 全 3 ファイル): PASS (findings: [])
  • bun run test:gate-honesty (実 node --test --test-reporter=tap + run-and-verify --floor 1): PASS (verdict: VERIFIED, 10/10 passed)
  • bun run test:system-quality: PASS (37/37 passed)
  • bun evals/policy-evaluation/controls.mts: PASS(context budget regression・gate honesty controls 含む全件 PASS)
  • node --test --test-reporter=tap scripts/gate-honesty/*.test.mts | node scripts/gate-honesty/cli.mts --verify-tap - --floor 1: PASS (verdict: VERIFIED)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant