Skip to content

feat(hooks): check ADR file names and metadata after each ADR edit - #209

Closed
furedea-agent[bot] wants to merge 15 commits into
mainfrom
feat/check-adr-metadata
Closed

furedea-agent[bot] wants to merge 15 commits into
mainfrom
feat/check-adr-metadata

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

概要

docs/adr/ を持つ任意のリポジトリで ADR を編集すると,ファイル名・ID・タイトル・Status・メタデータ語彙・ADR 参照・supersession の整合を静的に検査し,編集後のフィードバックとして報告します(ブロックはしません,ADR-0021).adr スキルから,このチェックが担う機械的な規則を削除し,Partly superseded by と Amended を公式語彙として追加しました.ユーザーが決めるのは,既存 ADR の語彙(Originally など)を正式な語彙として残す点と,ADR-0004 のメタデータ修正です.

flowchart LR
  E[ADR を Write/Edit] --> L[lint_format.py]
  L --> A[lib/adr_metadata.py]
  A -->|違反| C[additionalContext で報告]
  A -->|なし| S[無言]
Loading

規則とチェックの対応(ADR-0021 の prose-to-check mapping)

元の prose(agents/skills/adr/SKILL.md) 場所 チェック テスト
Use sequential four-digit IDs / use underscores between the ID and decision words File Layout ファイル名は 4 桁 ID で始まること(ID 以降の命名はリポジトリの規約に委ね,検査しない) test_file_name_must_start..., test_any_naming_style...
Never reuse an ID File Layout ID の重複(両ファイルを報告) test_duplicate_id_...
(ID の欠番) — 報告しない: 並行ブランチが番号を先取りするため,main は ADR-0022(#198 未マージ)が欠けたまま ADR-0023 を含む.重複検査が再利用を防ぐ test_gaps_in_ids_are_not_reported...
# ADR-NNNN: <Decision title> Template タイトル形式と,ファイル名 ID との一致 test_title_...
Allowed status values Status Rules - Status: の存在と 4 値 test_status_...
Add - Supersedes: ADR-NNNN / change the old ADR status to Superseded Status Rules Supersedes の相手が Status: Superseded test_supersedes_...
(新規)メタデータ語彙 — 未知キーの報告,Amended は <YYYY-MM-DD> (<what>) test_unknown_metadata_key..., test_amended_...
(新規)参照先の存在 — 関係キー内の ADR-NNNN が存在すること test_reference_...

スキルに残したのは,Decision Test,リポジトリ調査,supersede の判断,Writing Rules,テンプレート,Non-Goals と,チェックを指す 1 行のポインタです.Partly superseded by と Amended は 1 文ずつ使いどころを足しました.チェックの設定(語彙と形式)は agents/hooks/lib/adr_metadata.py が唯一の正本です.

既存 ADR の結果

  • 既存 ADR を検査し,違反は ADR-0004 の 1 件(Status 行に Superseded by [ADR-0007](...) が混在し,ADR-0007 の Supersedes: ADR-0004 との整合も崩れていた).
  • 曖昧さがないため,本文は触らずメタデータ行だけを ADR-0002 と同じ形(- Status: Superseded と - Superseded by: ...)に直しました.
  • 既存の正当な用法は規則側を合わせました: Superseded by,Refines,Related,Originally,Historical sources を語彙に含め,dotfiles ADR-0016 のように他リポジトリを指す参照や複数行の値は検査対象外としています.README.md も対象外です.
  • ADR-0022(docs(adr): judge agent commands by their effect #198)と ADR-0023(docs(adr): place skill responsibilities at the earliest sufficient tier #208)の本文を取得して検査しました.ADR-0023 は通ります.ADR-0022 は - Amended with: ADR-0021 (...) が未知キーとして報告されます(Amended: <日付> (<内容>) への書き換えが必要で,docs(adr): judge agent commands by their effect #198 側の修正事項です).
範囲と設計メモ
  • 統合点は lint_format.py の diagnostics の 1 行(adr_metadata.diagnostics(paths))で,feat(hooks): block edits on static rule errors and guard ast-grep-ignore #203 とのリベース時の衝突を小さくしています.
  • 範囲外(refactor(skills): move deterministic responsibilities out of Skills #169 の後続): 承認済み ADR 本文の不変性,source-of-truth の CLAUDE.md 不在規則.
  • ADR ディレクトリ全体を読みますが,報告は編集した ADR が関わる違反(重複 ID や supersession は相手側の編集でも,ADR の削除時はディレクトリ全体)だけです.他形式の ADR 規約のリポジトリで全 ADR の違反が出ることを避けます.ID 以降のファイル名形式は検査しません(ファイル名はリポジトリごとの規約で,スキルも従うと定めているため.ユーザー判断).Superseded by を持つ ADR は Status: Superseded であることも検査します(既存履歴は適合).
  • CI: このリポジトリの CI は pytest を実行するため,履歴の適合は test_this_repositorys_adr_history_conforms で CI が検査します.

検証

  • uv run pytest: 4930 passed, 1 skipped(新規 42 件)
  • uv run ruff check / ruff format --check / ty check: 通過
  • 既存 21 件の ADR に違反なし(ADR-0004 修正後)

Refs #169

🤖 Generated with Claude Code

Report naming, ID uniqueness, title, status, metadata vocabulary, ADR references and
supersession consistency as edit feedback. Drop the skill prose the check now enforces and
add Partly superseded by and Amended to the skill. Move the status reference of ADR-0004 to
a Superseded by line.

Refs #169

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T14:20:24.874960Z c1c23ef Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

Review summary

Two findings, one of them blocking:

  • P1: skipped_identifiers flags ADR-0023. Current main has 0001–0021 and then 0023, because docs(adr): judge agent commands by their effect #198's ADR-0022 hasn't been merged yet. So test_this_repositorys_adr_history_conforms will fail on the merge commit, and every ADR edit here will report the gap. ADRs merged out of order are routine, so the rule needs to be rethought or limited.
  • P2: The hook runs in every repo that has docs/adr/, and it re-checks the whole directory on each edit. In adr-tools or MADR repos it reports every ADR. That conflicts with the skill's remaining instruction to keep existing naming conventions.

The rest looks correct to me: the lint_format integration (.md is already in EXTENSIONS), metadata parsing, reference and supersession checks, and the ADR-0004 metadata fix. Note: I couldn't run the test suite in this environment. The P1 comes from reading the code against the ADR files on main.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e39994bdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lint_format.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
Parallel branches reserve ADR numbers, so main legitimately holds a gap until the
earlier PR merges (ADR-0023 landed before ADR-0022). Uniqueness still catches reuse.

Refs #169

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

レビュー結果

  • P1 agents/hooks/lib/adr_metadata.py:91: このフックはグローバルに配置され,docs/adr/ を持つ任意のリポジトリで動きます.しかし規則はこのリポジトリ固有の形式です.そのため adr-tools や MADR 形式のリポジトリでは,ADR を編集するたびに全 ADR の違反が大量に報告され,他の診断が押し出されます.また SKILL.md の「fix what they report」は,同じスキルの「既存の命名規則に従い,正規化のためだけにリネームしない」と矛盾します.
  • P2 agents/hooks/lib/adr_metadata.py:19: LOCAL_REFERENCE の否定後読みが ADR-0001 and ADR-0004 の 2 つ目の参照も除外します.このため,存在確認と Supersedes の整合チェックが黙ってスキップされます.

フックへの統合(.md は EXTENSIONS に含まれ,lib ディレクトリはまとめて配置される)と ADR-0004 のメタデータ修正には問題を見つけませんでした.

ブロッキング: 1 件(P1)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76a1115c72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
Read the whole directory but filter findings to the edited ADRs so repositories with another
ADR convention are not flooded, and keep references after a joining word such as "and".

Refs #169

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary (read-only)

I found no blocking issues and posted no inline comments.

What I checked:

  • Hook integration: .md is in hook_input.EXTENSIONS and target_paths returns resolved paths, so is_adr_file and the edited-set filtering in adr_metadata.diagnostics work on the real lint_format.py path. ADR findings are only added to additionalContext, which keeps the non-blocking behaviour ADR-0021 requires.
  • Reference parsing: REFERENCE and JOINERS handle link form, comma-separated lists, joining words, and references qualified by another repository such as dotfiles ADR-0016.
  • Supersession and duplicate IDs: both are reported when either file is edited, because also_involves carries the other file.
  • ADR-0004 fix: only the metadata changed, and it now matches the ADR-0002 form, so Supersedes: ADR-0004 in ADR-0007 is consistent.
  • Tests: they cover each rule and the hook's end-to-end output.

Merge-order note (already mentioned in the PR body): test_this_repositorys_adr_history_conforms will fail CI once #198 lands unless its - Amended with: line is changed to - Amended: <date> (<what>). Coordinate the two merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7ccdf3698

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

レビュー概要

ブロッキングな指摘はありません(P0/P1: 0 件).

  • P2(agents/hooks/lib/adr_metadata.py): このフックはグローバルにインストールされます.そのため,adr-tools や Nygard 形式(ハイフン区切りのファイル名,# 1. ... のタイトル,## Status セクション)を使う他のリポジトリでは,ADR を編集するたびにファイル名・タイトル・Status の違反が報告されます.スキルの「既存の命名規約に従う」という規則と食い違います.他の規約のディレクトリを自動で検出してスキップするなど,構造的な対処とテストを検討してください.

確認した点: パスの解決(target_paths は resolve 済みで,finding.path との比較は正しく一致します),他リポジトリ参照の除外(REFERENCE / JOINERS),supersession の双方向の報告,削除時の報告範囲,kind によるゲート.すべて問題ありません.ADR-0022(#198)がマージされると test_this_repositorys_adr_history_conforms が失敗する点は,PR 本文に記載されています.

このレビューでは pytest を実行していません(コマンドの実行が許可されなかったため).

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cc8a6a104

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary (read-only)

No blocking findings.

What I checked:

  • agents/hooks/lib/adr_metadata.py: how file names, titles, and metadata are parsed (including indented continuation lines); the vocabulary and Status checks; reference extraction, including cross-repo qualifiers like [dotfiles ADR-0016](...) and joiner words; duplicate-ID, dangling-reference and two-way supersession checks; scoping reports to the edited ADRs and the files they involve; deletion handling; and leaving directories that use another naming scheme alone.
  • lint_format.py wiring: ADR checks run only when kind is unset or md. They get the raw target paths, so the extension filter does not drop deleted files. Errors fall through to the existing OSError handling.
  • The current docs/adr/ history against the checks. ADR-0002, 0003, 0012, 0020 and 0021 use Superseded by, Supersedes, Partly superseded by and Amended. All of them parse as intended, and the ADR-0004 metadata fix makes 0004 and 0007 consistent with each other.
  • Tests: every rule in the prose-to-check table has a test, plus a test that this repo's ADRs conform and an end-to-end hook test.

I found no correctness, security or test-coverage problems serious enough to report.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2922b1f112

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

レビュー結果

マージを止める指摘(P0/P1)はありません.

  • P3(agents/skills/adr/SKILL.md:82): Amended の説明(本文をその場で修正・追記する)が,同じ節にある「accepted ADR の本文は書き換えない」という規則と矛盾しています.

adr_metadata.py で確認した点:

  • 編集した ADR に関わる違反だけを報告する絞り込み(重複 ID と supersession は相手側の also_involves で拾い,削除時はディレクトリ全体を報告する)
  • 関係キーの参照解析(リンク形式,結合語,他リポジトリ参照の除外)
  • lint_format.diagnostics への組み込み(kind が None か md のときだけ動く)

テストは,変更した動作をおおむね網羅しています.ADR-0004 のメタデータ修正も,ADR-0007 の Supersedes と整合しています.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6caec0d18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
…ed with immutability

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

Review summary

No blocking issues (P0/P1: 0).

  • P2 (agents/hooks/lib/adr_metadata.py:131): the hook is global, but the title, - Status: and key-vocabulary checks assume this repository's ADR template. In repos that use adr-tools or MADR, every ADR edit gets false-positive reports, which contradicts the skill's rule to follow the existing convention.

I also checked:

  • Cross-file logic (duplicate IDs, supersession in both directions, the deletion path): matches between paths compare correctly because every path is resolve()d.
  • lint_format.diagnostics integration: the ADR check runs after formatting, so its line numbers match the file the agent sees.
  • The ADR-0004 metadata fix and the history-conformance test.

Tests were not run locally (read-only review).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d79612eeaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

Review summary (read-only)

  • P2: The global hook flags every edited ADR in repositories that use a different ADR format (adr-tools, MADR) for its title and Status. Because the skill tells the agent to fix whatever the hook reports, the agent may rewrite existing ADRs into this repo's format. Details are in the inline comment.

No P0 or P1 findings. I read through the reference parsing, supersession and duplicate-ID checks, how deletions are handled, the lint_format.py integration (including the kind filter), and the ADR-0004 metadata fix, and found no blocking problems. The new tests cover the changed behavior well. I couldn't run the tests in this environment (command approval wasn't available).

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 539ef6c74c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@github-actions

Copy link
Copy Markdown

Review summary (read-only)

Findings: 0 × P0, 0 × P1, 1 × P2.

  • P2 agents/hooks/lib/adr_metadata.py:139: The title and Status checks run in every repository that has a docs/adr/ folder. That includes adr-tools and MADR repos, where ADRs use a different title and status format. Every edit to one of those ADRs will produce false reports. The updated skill tells the agent to fix whatever is reported, so it would rewrite those ADRs into this repository's format.

The rest looks correct to me:

  • Reporting is limited to the edited files, and a deletion reports the whole directory.
  • References to other repositories and link targets are excluded, and the joining-word handling works.
  • Supersession checks apply in both directions.
  • The lint_format integration only runs for kind in (None, "md").
  • Tests cover each rule and check the repository's own ADR history.

Merge-order note: once #198 lands, its ADR-0022 (Amended with:) will fail test_this_repositorys_adr_history_conforms. The PR body already mentions this, so make sure #198 is updated before or together with this PR.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e51699b7a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

レビュー結果(読み取りのみ)

ブロッカーなし(P0/P1: 0 件).インラインで指摘する事項もありません.

確認した点:

  • agents/hooks/lib/adr_metadata.py: ファイル名 ID,タイトル,Status,語彙,参照(リンク先除去・他リポジトリ修飾の除外・トークン境界),自己参照,Supersedes/Superseded by の双方向整合,重複 ID を確認.報告は編集したファイル(または also_involves で関係するファイル)に限られ,削除時のみディレクトリ全体を報告する設計も意図どおり動く.
  • lint_format.py の統合: kind が None か md のときだけ実行され,target_paths は解決済みの絶対パスを返すため,is_adr_file の docs/adr 判定と resolve() の比較は一致する.
  • ADR-0004 のメタデータ修正は ADR-0007 の Supersedes: ADR-0004 と整合し,リンク形式の Superseded by も参照として解決される.
  • テストは追加した規則それぞれに加え,削除時の挙動,フックの end-to-end(exit 0 と additionalContext),このリポジトリの ADR 全体の適合までカバーしている.

注意(指摘に至らない程度): スキルから Status 値の一覧を削除したため,Deprecated は SKILL.md のどこにも書かれていない.フックが動かない環境では,エージェントがこの値を知る手段がない.なお,この環境ではテストを実行できなかったため,結果はコードを読んで確認したものです.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 251c07c0c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/hooks/lib/adr_metadata.py Resolved
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking or non-blocking findings.

Checked:

  • adr_metadata.diagnostics integration in lint_format.py: it runs only for kind in (None, "md") and receives the resolved, deduplicated target_paths. Findings are filtered to edited files plus also_involves, so supersession and duplicate-ID violations are still reported when only the other side is edited, and a deletion widens the report to the whole directory.
  • Reference parsing: link targets are stripped, joiner words are handled, references qualified with another repository's name are skipped, and token boundaries are enforced. The metadata block parser and the title/ID checks look right too.
  • The ADR-0004 metadata fix matches the ADR-0002 shape and agrees with ADR-0007's Supersedes.
  • Tests cover each rule, the edited-file filter, deletion, and the hook's exit-0 context output. test_this_repositorys_adr_history_conforms keeps the repository's own ADR history compliant in CI.

Minor note, not a finding: check_directory raises FileNotFoundError if an edited ADR's directory no longer exists. The hook would then exit 1 and drop the other lint diagnostics. That can't happen through the current Write|Edit|NotebookEdit matcher.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1c23ef6da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

(line, match.group(2))
for line, name, value in self.metadata
if name == key
for match in REFERENCE.finditer(LINK_TARGET.sub("", value))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 外部の裸 URL をローカル ADR 参照から除外する

- Related: https://example.test/docs/ADR-0042.md や同じ URL の自動リンク形式では,LINK_TARGET が ](...) 形式しか除去しないため,URL 内の ID がローカル参照として抽出され,存在しない ADR の診断が誤って出ます.既存の Markdown リンク先ケースは修正されていますが,裸 URL と自動リンクが依然として走査されることが新しい根拠です.

Useful? React with 👍 / 👎.

for line, name, value in self.metadata
if name == key
for match in REFERENCE.finditer(LINK_TARGET.sub("", value))
if match.group(1) is None or match.group(1) in JOINERS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 複数語の説明に続くローカル参照も検査する

- Related: See also ADR-0042 のような値では,任意の直前語を外部リポジトリ名として取得するため group(1) が also となり,存在しないローカル参照が無視されます.既存の単独の See ADR-0042 は JOINERS で修正されていますが,複数語の通常文が同じ誤分類を起こすことが新しい根拠なので,外部修飾子はリンクラベルや明示的なリポジトリ表記に限定する必要があります.

Useful? React with 👍 / 👎.

@furedea-agent

furedea-agent Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

この PR は閉じます(#169 の判断).

  • 原因:自由な文章の ADR メタデータを,あらゆる repository の書き方まで受け入れて解釈しようとしたため,review のたびに新しい端のケースが見つかり,12 回の re-review でも収束しなかった.
  • 代わりの方針:ADR の書式を MADR に移し,メタデータを YAML front matter に構造化する.検査は,見出しの構成を markdownlint(MD043),本文のリンクを lychee,front matter の ID と Supersedes の整合を小さな schema 前提の検査で行う.書式に合わないものは解釈せず違反にする.詳細は refactor(skills): move deterministic responsibilities out of Skills #169 の plan コメント.
  • この PR で見つかった既存 ADR の問題(ADR-0004 の Status 行)は,書式移行の中で扱う.

@furedea-agent furedea-agent Bot closed this Nov 15, 2026
furedea added a commit that referenced this pull request Nov 19, 2026
… a brief (#236)

## 概要

`herdr-delegation` の「Prepare a Self-Contained Brief」の既存の項目に,2 点を加えた.あわせて
`Scope and Dependencies` に 1 文を加えた.新しい節や仕組みは作っていない.

- **Scope and focus**: 範囲外の一覧と脅威モデル(入力の出所と,判断を誤ったときの損失)を brief
を書く時点で決める.lane は範囲外の P2・P3 の指摘にこの一覧を引いて答え,P0・P1
は常に直す(`development-cycle` の `delivery.md` と同じ).
- **Input**: 実装では方法を決める前に既存の道具(標準ライブラリ,既に入っている依存,de facto
の外部ツール)を調べ,選んだ理由(または合うものが無い理由)を brief に書く.
- **Scope and Dependencies**: 承認済みの plan の独立した lane は,それぞれ別の Herdr
worktree で順番待ちせず並行して走らせる.同じ行を変える lane
だけは例外で,順番に走らせる.並行にできる機会があるだけでは委任を許可しない,という既存の規則は残している.

#209 では範囲と脅威モデルが無く,指摘が範囲外まで広がった.#212 では既存の道具を調べずに自作して作り直しになった.

## 重複の確認

`development-cycle` には brief を書く手順の重複が無い.`delivery.md` は lane
が範囲外の指摘に答える側の規則で,brief に書く側の規則は `herdr-delegation` の 1
か所にまとまっている.`branches.md` は `herdr-delegation` へのリンクのみ.

## 確認

- `nix flake check --no-build`: 通過

## 範囲外の指摘

- 並行 lane の文を 1 つの PR に含めることへの指摘: ユーザーがこの PR
に加えるよう指示した変更で,本文の概要に記載した.lane が同じ行を変えるかは plan の lane
分割(`issue_plan.md`)で決まり,承認済みの plan の lane
だけが対象なので,「委任を推論しない」という既存の文とは矛盾しない.
- 同じ行を変える lane を 1 つにまとめる,または stacked-branch 手順を要求する指摘:
ユーザーの指示は「順番に走らせる」で,lane 分割の見直しと stacked-branch 手順は本変更の範囲外(P2).

Closes #233
Refs #169

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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