Skip to content

feat(takt-facet): D-6 — refresh review-diff between fix/review iterations + Bundle k post-merge-feedback#152

Merged
aloekun merged 2 commits into
masterfrom
d-6-review-diff-refresh
May 13, 2026
Merged

feat(takt-facet): D-6 — refresh review-diff between fix/review iterations + Bundle k post-merge-feedback#152
aloekun merged 2 commits into
masterfrom
d-6-review-diff-refresh

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 13, 2026

Summary

本 PR は 2 つの独立タスクを連続 commit で land する:

  1. Bundle k (post-merge-feedback for PR feat(hooks): Phase D D-5 — comment-lint test 拡充 + MAX cap break scope test #151)docs/todo-summary.md / docs/todo8.md に順位 123-127 (Phase D dogfood 観測由来の lint-screen MD 除外 + UTF-8 boundary 横展開 + ADR-038 codify) を登録
  2. D-6 (順位 51: .takt/review-diff.txt の fix→review iteration 間 refresh).takt/facets/instructions/fix.md に「Pre-completion diff refresh (REQUIRED)」section を追加し、fix step の AI に jj diff -r @ > .takt/review-diff.txtconvergence_verdict emit 直前に必須実行させることで、PR feat(takt+hooks): Bundle Z Phase 2 — 制約付き fix instruction (#B-β) + todo follow-ups #103 で観測された 6-iter outlier (~10 分 wasted) の構造的解消を狙う

D-6 設計判断のハイライト (案 A → 案 C へ pivot)

todo7.md 原案の 案 A (takt workflow yaml に before:/pre-step: hook を追加) を試みたが、takt v0.35.3 schema を直接確認した結果 per-step hook field は存在しない と判明:

  • node_modules/.pnpm/takt@0.35.3/.../piece-types.d.ts:74-98PieceMovement interface に hook field なし
  • runtime-environment.js:171-191 — piece レベル runtime.prepare は workflow 開始時 1 回のみ実行 (step 間に挟まらない)

案 B (cli-push-runner で takt step 進行を監視) は stages/takt.rsrun_cmd_inherit で takt を spawn-and-wait する構造のため、filesystem watcher 等で intercept する案は ~100-200 行の Rust + race condition 対応が必要で AI-driven 案で塞げる範囲を超える複雑度。

採用した 案 C (instruction-level refresh) は既存の Bundle Z #B-β Pre-completion deterministic check と同形 precedent: AI が scripts/fix-metrics-check.ps1 を Bash invocation で実行する pattern。失敗 mode (= AI が refresh を skip) は現状と同等で no regression

advisor (Anthropic stronger reviewer) も同案を推奨。

Pre-push review observation

  • simplicity-review: APPROVE (Non-blocking observation: fix.md の .takt/facets/** read-only zone 自己参照 = 「fix-step AI にとっての read-only」を明示推奨。本 PR 内で対応するか follow-up かは要判断)
  • security-review: APPROVE (jj diff -r @ > .takt/review-diff.txt は hardcoded、injection 経路なし)
  • lint-screen (mistral:7b): FP 1 件 (use std::io::Write;docs/local-llm-offload-analysis.md line 1 に hallucinate — Bundle k 順位 123 = MD 除外フィルターが解消する pattern)
  • takt review: 1 iter で APPROVE → fix iteration 未起動のため本改修の direct dogfood は未達成。dogfood 検証は後続 PR (D-7 / Bundle c-1 等) に持ち越し

Test plan

  • pnpm lint 0 errors (3 pre-existing warnings in test fixtures)
  • pnpm test 2/2 passed
  • markdownlint via PostToolUse hook: 0 errors
  • takt pre-push-review pipeline 完走 (1 iter で APPROVE)
  • dogfood (follow-up): 後続 PR で fix step が実際に jj diff -r @ > .takt/review-diff.txt を実行するか観察 (実行率 > 90% が初期目標、達成失敗時は 案 D = PostToolUse 決定論層へ escalate)
  • 6-iter outlier 再発の有無を 1〜2 PR の post-pr-review で観測

Files

Bundle k (commit nunnqonr):

  • docs/todo-summary.md (順位 123-127 を table 末尾に追加 + Bundle k 概要追記)
  • docs/todo8.md (5 件分の詳細 entry: 設計決定 / 作業計画 / 完了基準)

D-6 (commit tloolzow):

  • .takt/facets/instructions/fix.md (+13 行: 「Pre-completion diff refresh (REQUIRED)」 section)
  • docs/todo7.md (順位 51 entry を「案 A 不可と判明 + 案 C 採用」に更新)
  • docs/local-llm-offload-analysis.md (D-6 行 を「着手済 (本 PR、impl 完了 / dogfood pending)」に更新)

Summary by CodeRabbit

  • ドキュメンテーション
    • ワークフロー手順の改善とプロセス確認の明確化
    • タスク追跡とロードマップの拡張

Review Change Stack

aloekun added 2 commits May 13, 2026 19:03
## 採用 5 件 (Tier 1 #1+#2 / Tier 2 #1 / Tier 3 #1+#2)

### Tier 1 (決定論的防止層)
- 順位 123 (Bundle k コア): lint-screen の Markdown ファイル除外フィルター追加 (M, Frequency High)
  - D-3/D-4/D-5 で 3 PR・4 push 一貫観測の mistral:7b による .md → Rust hallucinate FP を構造的に解消
- 順位 124: no-ephemeral-todo-reference rule の TOML positive test 追加 (S, Frequency Medium)

### Tier 2 (横展開)
- 順位 125: UTF-8 マルチバイト boundary test を他の string-processing hooks に横展開 (M, Frequency Medium)
  - PR #151 で発見した byte_offset_to_line char-boundary panic bug の systemic 防御

### Tier 3 (docs/comment 明文化)
- 順位 126 (順位 123 と同 PR 推奨): ADR-038 に mistral:7b 「diff 外 context hallucinate」failure mode を追記 (XS, Frequency High)
- 順位 127 (順位 124 と同 PR 推奨): extensions 拡張時の test 追加 pattern をコード comment で明文化 (XS, Frequency Medium)

## Sub-PR 構成推奨

- k-1: 順位 123 + 126 (実装 + ADR codify、コア層)
- k-2: 順位 124 + 127 (TOML test + extensions code comment、test gap 補強層)
- k-3: 順位 125 (UTF-8 boundary 横展開、独立)

## 却下 (4 件) / 様子見 (3 件)

却下: UTF-8 lint rule (FP リスク + AST 必須) / byte_offset_to_line 強化 (既対応) /
UTF-8 guideline + extensions checklist (feedback_no_unenforced_rules.md 適用)
様子見: lint-screen dogfood CI step (L + takt infra 依存) / test→bug pattern を ADR-007 (1 PR 観測) /
multi-rule fixture pattern を test comment (Low × Low)

## 含意

Phase D dogfood 観測 (docs/local-llm-offload-analysis.md L334-340 の docs-only FP failure mode 記述) が
直接 actionable な決定論的防止層 (順位 123) に結実。Phase E 採否判定前に systemic FP root cause が
解消される構造的進展。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

本 PR は、.takt/review-diff.txt を fix→review iteration 間で強制的に refresh する命令をワークフローに追加し、その設計決定と Phase D future タスク計画を tracking ドキュメント群で整理します。

Changes

diff refresh 命令と Phase D タスク計画

Layer / File(s) Summary
ワークフロー命令:Pre-completion diff refresh
.takt/facets/instructions/fix.md
convergence_verdict 報告直前に jj diff -r @ > .takt/review-diff.txt を無条件実行する required ステップを追加。partial での false-positive 防止と fully_resolved での無害性を明記。
設計決定ドキュメント:却下案と採用案の整理
docs/todo7.md
refresh タイミング確定(convergence_verdict 直前)、precondition hook 挿入不可と Rust 側検出スコープ不適合を明記、fix.md instruction 追加案を採用案として整理、共有・派生プロジェクト影響と作業計画/完了基準/残課題リスクを更新。
ステータス追跡と future タスク計画
docs/local-llm-offload-analysis.md, docs/todo-summary.md, docs/todo8.md
D-6 タスク状態を「着手済(本 PR)」へ更新、新規ランク付きタスク(123–127)で lint_screen Markdown 除外・TOML テスト・UTF-8 境界テスト拡張・ADR-038 更新・extensions パターン文書化を追加、Bundle k narrative で PR #151 post-merge-feedback と mistral:7b false-positive パターンを整理。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • aloekun/claude-code-hook-test#106: 本 PR は convergence_verdict 直前の diff refresh を fix.md に追加し、retrieved PR #106 は同じ convergence_verdict report-emission flow 周辺の Convergence gate/verdict ルール定義を提供。
  • aloekun/claude-code-hook-test#108: 本 PR の convergence_verdict 直前 diff refresh 必須化は、retrieved PR #108 で定義される同じ convergence_verdict Iter-3 short-circuit 動作/routing と整合。
  • aloekun/claude-code-hook-test#45: 本 PR の jj diff -r @ explicit range による refresh は、retrieved PR #45 で文書化される commit-id + explicit diff range による変更検出原則と直結。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRタイトルは、PR #152の2つの主要な独立したタスク(D-6とBundle k)の両方を明確に参照しており、主な変更点を適切に要約しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
docs/todo-summary.md (1)

80-84: ⚡ Quick win

Bundle k マーカーの表記が一貫していません

順位 123(Line 80)のみが「★ Bundle k」マーカーを持っていますが、Line 126 の Bundle k 説明によれば、順位 124-127 も Bundle k に含まれています(Sub-PR k-1/k-2/k-3 として構成)。

他の Bundle(W, X, a, c, d など)では、Bundle に属する全行に ★ マーカーが付与されています。Bundle k でも同様に、順位 124-127 の各行に「★ Bundle k」を追記することで、表の視認性と一貫性が向上します。

提案:

  • Line 81 (順位 124): ... ★ Bundle k を追記
  • Line 82 (順位 125): ... ★ Bundle k を追記
  • Line 83 (順位 126): ... ★ Bundle k を追記
  • Line 84 (順位 127): ... ★ Bundle k を追記

または、Bundle k の Sub-PR 構成を明示したい場合:

  • 順位 123: ★ Bundle k (k-1)
  • 順位 124: ★ Bundle k (k-2)
  • 順位 125: ★ Bundle k (k-3)
  • 順位 126: ★ Bundle k (k-1)
  • 順位 127: ★ Bundle k (k-2)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/todo-summary.md` around lines 80 - 84, The table is inconsistent: only
the rank 123 row shows the "★ Bundle k" marker while ranks 124–127 (the rows for
entries currently labelled with ranks 124, 125, 126, 127 and file todo8.md)
belong to Bundle k per the comment; update each of those rows to append "★
Bundle k" (or use the alternative: annotate each with "★ Bundle k (k-1/k-2/k-3)"
to indicate sub-PR mapping) so all Bundle k entries (rows 124–127) consistently
show the Bundle marker.
docs/local-llm-offload-analysis.md (1)

284-284: 💤 Low value

表のセル内容が長すぎて可読性が低下しています(任意改善)

Line 284 の D-6 行の「構成」セルに、順位番号、タスク説明、設計代替案の経緯、実装アプローチ、更新ファイル一覧がすべて含まれており、1 セル内の情報密度が非常に高くなっています。表を横スクロールせずに読む際に理解しづらい可能性があります。

提案: 表の「構成」列は簡潔な概要のみとし、詳細な設計経緯は別の段落やサブセクションで説明する形式を検討してください。例:

  • 構成セル: 順位 51 単独 = review-diff.txt refresh (fix.md instruction 方式)
  • 表の下に補足: D-6 設計 pivot: 当初案 A (takt hook) 不可 → 案 C (instruction-level refresh) 採用

なお、本 PR の主目的(D-6 実装完了の記録)は達成されているため、この改善は任意です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/local-llm-offload-analysis.md` at line 284, The D-6 table cell ("構成"
cell for D-6) is overloaded with too much detail; replace its content with a
concise summary like "順位 51 = review-diff.txt refresh (fix.md instruction方式)"
and move the detailed history (案A→案C pivot, implementation notes, updated files
list, dogfood status) into a new sub-section or a paragraph immediately below
the table titled "D-6 補足" or "D-6 設計経緯" so readers can scan the table quickly
while still preserving the full context.
docs/todo7.md (1)

95-98: ⚡ Quick win

「案 D」への参照が未定義です(軽微な明確性の問題)

Line 97 で「案 D (PostToolUse hook ベースの決定論層) へ escalate を検討」と記載されていますが、案 D の詳細や設計内容がこのファイル内のどこにも記載されていません。将来、実行率 <90% で escalate が必要になった際に、案 D の設計を再発明するコストが発生します。

提案: Line 97-98 の直後または Line 73 の案 C 採用箇所の近傍に、案 D の概要を 1-2 行追加することを検討してください。例:

- **案 D (将来の escalation 候補、現時点では未実装)**: PostToolUse hook で `jj diff` 実行を検出し、未実行時に error exit する決定論層。Effort M、AI 信頼性に依存しない構造だが PreToolUse と異なり事後検出のため UX 劣化リスクあり
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/todo7.md` around lines 95 - 98, Add a short 1–2 line definition for "案
D" immediately after the sentence that mentions "案 D (PostToolUse hook
ベースの決定論層)" (or alternatively next to the existing "案 C" description) that states
it is a future escalation option: e.g., a concise summary that "案 D" uses a
PostToolUse hook to detect `jj diff`/refresh execution and enforces an error
exit when refresh is skipped, notes effort level (M) and that it trades
AI-independence for potential UX degradation; keep it labeled as not yet
implemented.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/local-llm-offload-analysis.md`:
- Line 284: The D-6 table cell ("構成" cell for D-6) is overloaded with too much
detail; replace its content with a concise summary like "順位 51 = review-diff.txt
refresh (fix.md instruction方式)" and move the detailed history (案A→案C pivot,
implementation notes, updated files list, dogfood status) into a new sub-section
or a paragraph immediately below the table titled "D-6 補足" or "D-6 設計経緯" so
readers can scan the table quickly while still preserving the full context.

In `@docs/todo-summary.md`:
- Around line 80-84: The table is inconsistent: only the rank 123 row shows the
"★ Bundle k" marker while ranks 124–127 (the rows for entries currently labelled
with ranks 124, 125, 126, 127 and file todo8.md) belong to Bundle k per the
comment; update each of those rows to append "★ Bundle k" (or use the
alternative: annotate each with "★ Bundle k (k-1/k-2/k-3)" to indicate sub-PR
mapping) so all Bundle k entries (rows 124–127) consistently show the Bundle
marker.

In `@docs/todo7.md`:
- Around line 95-98: Add a short 1–2 line definition for "案 D" immediately after
the sentence that mentions "案 D (PostToolUse hook ベースの決定論層)" (or alternatively
next to the existing "案 C" description) that states it is a future escalation
option: e.g., a concise summary that "案 D" uses a PostToolUse hook to detect `jj
diff`/refresh execution and enforces an error exit when refresh is skipped,
notes effort level (M) and that it trades AI-independence for potential UX
degradation; keep it labeled as not yet implemented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6a8f1e9-5bc7-41dd-92b2-c188738d8fd0

📥 Commits

Reviewing files that changed from the base of the PR and between 6cfa8b2 and 520ac0b.

📒 Files selected for processing (5)
  • .takt/facets/instructions/fix.md
  • docs/local-llm-offload-analysis.md
  • docs/todo-summary.md
  • docs/todo7.md
  • docs/todo8.md

@aloekun aloekun merged commit 06b4412 into master May 13, 2026
1 check passed
@aloekun aloekun deleted the d-6-review-diff-refresh branch May 13, 2026 11:08
aloekun added a commit that referenced this pull request May 13, 2026
…量化 (49KB→26KB) (#153)

* docs(todo): Bundle k 既存 entry に PR #152 post-merge-feedback 再観測を追記 (順位 123/124/126/127)

* docs(llm-offload): D-6 完了反映 + Phase A〜D 詳細を phase-d-outcomes.md に分離 (analysis.md 49KB → 26KB)
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