Skip to content

feat(review): 投稿失敗時の finding 永続化・重複防止・再発検出台帳を追加 (#123) - #199

Merged
rebuildup merged 3 commits into
release-0-13-0from
123
Nov 23, 2026
Merged

rebuildup merged 3 commits into
release-0-13-0from
123

Conversation

@rebuildup

Copy link
Copy Markdown
Owner

Linked Issue: #123
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)

概要

  • 共通 Skill 本文へ実装詳細を詰め込まず、専用の scripts/review-findings/ に永続台帳と状態遷移(ledger.mts)を配置。
  • findingId / repository / file / line / sourceSha / severity / category / evidence / firstObservedAt / lastObservedAt / issueOrReviewUrl / postingState / failureReason / recurrenceClass / verificationStatus / actionClass / resolvedEvidence を保持。
  • 客観的欠陥の起票(objective-finding)と人間承認が必要な scope/target 変更(scope-change-requires-owner-approval)を分離。
  • .github/workflows/eval-controls.yml へ bun run test:review-findings を接続。

検証

  • bun run typecheck: PASS
  • bun run quality:structure: PASS(findings: 0)
  • bun run test:review-findings: PASS(write 拒否 → 翌日 1 件のみ投稿、既存 Issue との重複抑止・URL 紐付け、40 桁 exact-head 解消 → 再観察での再発検知、scope 変更の自動起票抑止を fixture で実証)
  • bun evals/policy-evaluation/controls.mts: PASS(context-budget 変更なし)

Refs #123(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 4bf0029.

Files selected for processing: 8

  • .github/workflows/eval-controls.yml
  • package.json
  • scripts/review-findings/README.md
  • scripts/review-findings/cli.mts
  • scripts/review-findings/ledger.mts
  • scripts/review-findings/ledger.test.mts
  • skills/agent-recovery/SKILL.md
  • skills/quality-gate/SKILL.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 欠陥をすべて修正しました。

主な修正内容

  • ファイル永続化・CLI・Skill 参照の実装:
    • loadLedger(厳格スキーマ検証・不正/破損 JSON の明示拒否)と saveLedger(親ディレクトリ自動作成・一時ファイルからの原子的 rename・ghp_/github_pat_/Bearer トークン秘匿)を追加。
    • 実行可能 CLI scripts/review-findings/cli.mts(record / fail / mark-posted / resolve / approve-scope / plan-retry / summary、終了コード 0/1/2)を追加し、scripts/review-findings/README.md に利用手順を明記。
    • skills/quality-gate/SKILL.md および skills/agent-recovery/SKILL.md から本台帳 CLI への参照を追記(context budget 内維持)。
  • 複合キー (repository, findingId) 化と fail-closed: recordPostFailure / markPosted / resolveFinding / approveScopeChange に { repository, findingId } を必須化し、RetryDecision にも repository を含めるよう統一。未登録キーに対して黙って no-op せず明示的に例外送出するよう修正。
  • recurrenceClass バグ修正: 未解消(open)finding の再観測時に recurring へ誤昇格する不具合を修正し、open / one-off を維持するよう変更(過去に resolved だった finding が再出現した場合のみ recurred / recurring へ遷移)。
  • matchesExisting 重複検出バグ修正: record.findingId が存在して不一致なら即 false を返し fallthrough しないよう修正。また file + category のみで別バグを誤統合しないよう、fingerprint / symbol / line(±5 行)の精密ロケータを必須化。
  • own-pr-request-changes・再発履歴・入力検証・scope 承認:
    • failureReason === "own-pr-request-changes" 時に post-comment-fallback を返却。
    • recurred が既存 OPEN Issue に一致する場合は comment-recurrence を返却し、CLOSED 後に新規起票された場合は旧 URL を priorIssueUrls に保持。
    • recordFinding / resolveFinding の厳格入力検証(40 桁 hex SHA・正整数 line・ISO 時刻・非空文字列、同一 sourceSha 解消は false-positive / waived のみ許可)と approveScopeChange 遷移を追加。

検証

  • bun run typecheck: PASS
  • bun run quality:structure: PASS (0 findings)
  • bun run test:review-findings: 10/10 PASS(永続化・トークン秘匿・CLI 負例終了コード含む)
  • bun evals/policy-evaluation/controls.mts: PASS(context budget regression 含む)

@rebuildup

Copy link
Copy Markdown
Owner Author

Pass-2 検証で指摘された P1 欠陥(plan-retry --existing --write で url 欠損・不正 URL の外部レコードが検証されず ledger を破損させ得る問題)を修正しました(commit 4bf0029)。

  • parseExistingRecordsJson を追加し、repository・url(assertUrl)・state(OPEN|CLOSED)および任意フィールド型を厳密検証(不正時は CLI exit 2 で fail-closed しディスク上の ledger を変更しない)。
  • planRetry 内でも match.url を assertUrl で検証するよう強化。
  • 欠損 URL・不正 URL の負例テスト(CLI + API)を追加し、typecheck / quality:structure / test:review-findings / policy-evaluation/controls.mts 全 PASS を確認済みです。

@rebuildup
rebuildup changed the base branch from release-0-12-0 to release-0-13-0 November 23, 2026 15:29
@rebuildup
rebuildup merged commit 3e0f87c into release-0-13-0 Nov 23, 2026
2 checks passed
@rebuildup
rebuildup deleted the 123 branch November 23, 2026 15:38
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