refactor(ai-loop): #896 検証ロジックを c3_contract.py へ共通契約層化(TASK-0896 exec)#902
Open
s977043 wants to merge 6 commits into
Open
refactor(ai-loop): #896 検証ロジックを c3_contract.py へ共通契約層化(TASK-0896 exec)#902s977043 wants to merge 6 commits into
s977043 wants to merge 6 commits into
Conversation
ARTIFACTS / VALID_DECISIONS / VALID_VERDICTS / SNAPSHOT_KEYS + REQUIRED_KEYS 系(record 用 / 入力ブロック用)を単一モジュール定義にし、 arbiter / plan_package / c3prime_verify は import 参照(is 同一を test_c3_contract.py で固定)。値は移行前と byte 同一・挙動変更なし。 arbiter への sys.path 操作は追加しない(R-008)。 Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…K-0896 コミット b) plan_package._sha256_of / c3prime_verify._sha256 と両者の canonical JSON hash 式を c3_contract.sha256_of_file / canonical_hash の単一実装に 置換(AC-2)。1 byte 改変検出・キー順序非依存の境界値テストを追加。 挙動変更なし(4 系テスト green・hashlib ローカル実装 0 件)。 Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… コミット c) 契約 AC-5 の核心規則(5 キー整合 + 三つ組一致)を c3_contract の I/O なし 純関数に集約し、arbiter(strict_keys=False = 余剰キー許容)と c3prime_verify(strict_keys=True = ちょうど 5 キー)の両経路が同一実装を 使う(AC-3)。#889 R2 由来の強度非対称は strict_keys 引数で保存(R-005)。 理由リストは検査順で順序契約固定 + 代表文言回帰テスト(R-004)+ I/O 封じ純粋性テスト(R-003)+ AC-6 の AST 回帰検査。 残置: verdict 語彙 / 独立性 / AUTO_APPROVED / reviewers 2 者(c3prime)、 構造検査 / source_sha vs target_sha(arbiter)。 判定結果不変(4 系テスト green・偽造 14 パターン reject 不変)。 Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ミット d) - sync-plugin-plangate.sh の copy 列挙 + delete 保護 case へ c3_contract.py / test_c3_contract.py を追加(R-008 教訓の対列挙) - ta-55 に test_c3_contract.py 実行を追記(新設テストの CI 実行経路 / R-010) - plugin bundled scripts を sync 再生成(8→10 本・byte 同一検証済み) - sync 2 回目 no-op / ta-30 bundled 自立 PASS / run-tests 412 passed 0 failed Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dence) Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
… River Review F-1) strict 経路でキー集合検査通過後の falsy 値が「キー欠落」と報告され オペレータ誤読を招くため 1 語修正(判定結果・exit code 不変・旧文言の 被参照 0 件実測)。順序契約テストの assert を同時更新(契約改版として 明示コミット / R-004 Fallback 準拠)。plugin sync 再生成込み。 Refs: #896 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
River Review(ローカル)実施結果
総合判定: マージ可(APPROVE 推奨)— critical/major 0
security / performance は指摘なし(検証強度の非対称保存・受理器全検査項目の残存・fail-closed 構造を実コード照合で確認)。詳細: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
c3-prime 契約の検証規則(契約定数 / sha256・canonical JSON hash / reviewer snapshot 三つ組照合)を
scripts/ai-loop/c3_contract.py単一モジュールへ集約し、arbiter / plan_package / c3prime_verify の 3 消費者が import 参照する構造にする振る舞い不変リファクタ。#873 delivery.py / #874 run_evidence.py が最初から共通層を import できる基盤整理(EPIC #870・実装順は #873 と並行、c3_contract 先行 merge → #873 rebase)。Closes #896
コミット構成(1 コミット 1 種類・各コミットで 4 系テスト green・単独 revert 可)
check_snapshot_trioへ共通化 — strict_keys 引数で #889 R2 由来の強度非対称を保存(arbiter=余剰キー許容 / c3prime=ちょうど 5 キー)。理由リスト順序契約 + 代表文言回帰 + I/O 封じ純粋性テスト + AC-6 AST 回帰検査検証(AC-1〜8 全 PASS・詳細 = handoff.md)
既知の注記(handoff KI-1)
複合異常入力での先頭 stderr 診断の優先順のみ変化(例: verdict 不正 + trio 改竄の同時入力で trio 不一致が先に報告される)。exit code・判定結果は全一致で、stderr を機械 parse する消費者は 0 件(rg 全数確認)。R-004 順序契約(キー集合 → 空値 → 三つ組)の設計帰結。
Refs: R-001, R-003, R-004, R-005, R-006, R-008, R-009, R-010
🤖 Generated with Claude Code