chore(scripts): add cross-layer frontmatter parity check to check_agents#741
Merged
Merged
Conversation
check_agents.sh and its PowerShell twin previously stripped frontmatter and compared only the agent bodies, so the permissionMode layer drift fixed in #729 shipped silently. Add a parity check on the behavioral frontmatter fields tools and permissionMode across the plugin and project copies (fail with exit 2 on mismatch); color stays exempt as an intended project-only field. Adds regression cases (tools drift, permissionMode drift, color-only diff) and updates the CUSTOM_EXTENSIONS.md CI-enforcement note.
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.
변경 내용
scripts/check_agents.sh와 PowerShell twinscripts/check_agents.ps1에 레이어 간 frontmatter parity 검사를 추가했다. 두 레이어(plugin/agents/↔project/.claude/agents/)의 동작 관련 frontmatter 필드tools/permissionMode가 다르면 실패(exit 2)한다.배경
기존
check_agents는 frontmatter를 strip하고 에이전트 본문만 비교했다. 그래서 #729에서 고친permissionMode레이어 drift(plugin 사본 누락)가 CI에서 잡히지 않고 조용히 출하되었다. 동작 필드의 정합성 게이트를 추가해 같은 유형의 silent capability drift 재발을 차단한다.구현
---frontmatter 블록에서 지정 키의 값을 추출하는 헬퍼(frontmatter_field/Get-FrontmatterField)를 추가.tools와permissionMode값을 두 레이어에서 비교, 불일치(한쪽에만 존재 포함) 시FAIL: frontmatter '<field>' drift for <agent>출력 + exit 2.tools/permissionMode만 비교한다.color(project 전용, 의도된 차이)와 그 외 필드는 비교하지 않아 향후 의도된 per-layer diff를 막지 않는다.set -euo pipefail·exit 코드(0/2)는 그대로 유지.tests/scripts/test-check-agents.sh에 회귀 케이스 3건 추가:toolsdrift → exit 2,permissionModedrift → exit 2,color만 다름 → exit 0(의도된 제외 검증). macOS BSD / Linux GNU 호환을 위해 portablereplace_in_file헬퍼 사용.docs/CUSTOM_EXTENSIONS.md의 CI enforcement 단락에 frontmatter parity 검사 추가 사실을 명문화.검증
bash scripts/check_agents.sh→OK (8 agent pairs: bodies + behavioral frontmatter in sync), exit 0 (현재 상태 — fix(agents): permissionMode acceptEdits missing from plugin copies of write agents #729 정렬 후 통과)qa-reviewer의tools를 한 레이어에서만 바꾸면 exit 2 + drift FAIL, 복구 후 다시 OKbash tests/scripts/test-check-agents.sh→7 passed, 0 failedpwsh미설치 환경이라.ps1은 로직 미러링만(로컬 실행 검증 생략)비고
적대적 검토 반영: 전체 frontmatter blanket 비교가 아니라
tools/permissionMode두 동작 필드로 한정하고color는 allowlist로 제외하여, false positive와 향후 의도된 차이 차단을 모두 피했다.Closes #738
Part of #726