Repository navigation
feat: add agent run report safety validators - #955
Conversation
Add Draft 2020-12 schemas for agent_run_report/v1 and agent_retro_index/v1, plus a fail-closed validator/check CLI with path-aware scanning and markdown preflight. Cover authority, token usage, invalid fixture, markdown, and check-command behavior with focused Vitest suites.
Preview URLPreview removed (PR #955 closed). |
|
Step 2 verification result:\n\n- PASS: AC1, AC2, AC3, AC4, AC5, AC9, AC10, AC11, AC12, AC13, AC14, AC15\n- FAIL: AC6, AC7, AC8\n\nNotes:\n- AC6 |
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, merge_state_status=UNSTABLE
Evidence Check
- AC coverage: Issue #935 の contract と差分は整合していますが、PR 本文に
## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守が無く、PR evidence としての hygiene を満たしていません。 - Allowed Paths:
allowed_paths_review_gate.pyの再計算結果はstatus: okで、34 changed files はすべて Issue #935 の Allowed Paths 内です。 - CI Verification:
ci_verdict_summary.pyは reviewed headea20d51e709b2573909e00d0f14dee4c76c446d1に対してstatus: failed、failed check はe2eのみでした。job log ではdocker pull mcr.microsoft.com/playwright@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948がno basic auth credentialsで失敗しています。 - 検証コマンド結果: Issue #935 の実装完了コメントでは
pnpm typecheck/pnpm lint/pnpm test/pnpm build/ focused suites / negative grep が PASS と報告され、PR 上の Step 2 コメントでも AC1-5,9-15 PASS・AC6-8 は既存失敗混入由来とされています。ただし current head の required checks が赤のため、現時点では APPROVE に進めません。
Blockers
- reviewed head
ea20d51e709b2573909e00d0f14dee4c76c446d1で required checke2eが失敗中です。失敗理由は変更差分そのものではなく CI 環境の Docker pull 認証エラーに見えますが、ci_verdict_summary.pyはstatus: failedを返しており、fail-closed で merge blocker と判断します。
Non-blockers
Closes #935は存在します。- Draft PR 自体は blocker 扱いではありません。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "ea20d51e709b2573909e00d0f14dee4c76c446d1"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"
blockers:
- "required check e2e failed on reviewed head; ci_verdict_summary.py returned status=failed and the job log shows docker pull to mcr.microsoft.com/playwright failed with no basic auth credentials"
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, merge_state_status=UNSTABLE
Evidence Check
- AC coverage: PR 本文に
## 受け入れ条件の達成状況、## 検証コマンド結果、## Allowed Paths 遵守が追加され、Issue #935 の AC1-AC15 について根拠付きの自己申告が整理されています。Closes #935も存在します。 - Allowed Paths:
allowed_paths_review_gate.pyの再計算結果はstatus: okで、reviewed headea20d51e709b2573909e00d0f14dee4c76c446d1の changed files 34 件はすべて Issue #935 の Allowed Paths 内です。 - CI Verification:
ci_verdict_summary.py --pr 955 --repo squne121/loop-protocol --expected-head-sha ea20d51e709b2573909e00d0f14dee4c76c446d1はstatus: failedを返し、gh pr checks 955でも required checke2eが failure です。job log にはdocker pull mcr.microsoft.com/playwright@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948に対するno basic auth credentialsが記録されています。 - 検証コマンド結果: PR 本文の自己申告ではローカル quality gates と focused suites は PASS とされていますが、PR_BODY_SELF_REPORT 単独では APPROVE 根拠にならず、current head の required check failure が残るため fail-closed で止めます。
Blockers
- reviewed head
ea20d51e709b2573909e00d0f14dee4c76c446d1で required checke2eが失敗中です。失敗ログは Playwright image のdocker pullがno basic auth credentialsで落ちており、差分起因とは断定できないものの、現時点では required check failure として merge blocker です。
Non-blockers
- PR body hygiene の前回指摘は解消済みです。
- Draft PR 自体は blocker ではありません。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "ea20d51e709b2573909e00d0f14dee4c76c446d1"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"
blockers:
- "required check e2e failed on reviewed head; the job log shows docker pull for mcr.microsoft.com/playwright@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948 failed with no basic auth credentials"
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
判定REQUEST_CHANGES。実装方向は概ね正しいですが、 この PR は #935 の Step 1 として、 良い点Draft 2020-12 を scanner は forbidden key、secret-like pattern、path-like pattern、marker injection を分けて持ち、NFKC normalize、URL decode、backslash normalization を通したうえで key/value を traversal しています。この方向性は #935 の「path-aware scanner」「object key と string value の分離」「structured error code」要求に沿っています。 CLI は Blocker 1:
|
Summary
この PR は #935 の Step 1 として、public-safe report/index の契約面を先に固定する変更です。
agent_run_report/v1とagent_retro_index/v1の Draft 2020-12 schema を追加し、public surface を allowlist 型で固定しました。scripts/lib/agent-run-report-validation.mjsとpnpm agent-run-report:checkを追加し、authority / token usage / path-aware secret scan / markdown preflight を fail-closed に実装しました。受け入れ条件の達成状況
Issue #935 の AC1-AC15 に対する達成状況です。
$defsベースで追加し、public surface 必須項目と fail-closed object 制約を固定しました。pnpm agent-run-report:checkの fail-closed 挙動、schema/semantic/scanner/markdown/check command の分離テストを追加しました。検証コマンド結果
Issue #935 の実装完了時に記録された実測結果です。
pnpm typecheckは PASSpnpm lintは PASSpnpm testは PASS(38 files / 678 tests)pnpm buildは PASSpnpm agent-run-report:check tests/fixtures/agent-run-report/valid-basic.json tests/fixtures/agent-retro-index/valid-basic.json tests/fixtures/agent-run-report/valid-comment.mdは PASSpnpm test -- --run tests/agent-run-report*.test.ts tests/agent-retro-index*.test.tsは PASSrg -n -- "--allow-local-path|--unsafe|--force|--no-secret-scan|--redaction-override" scripts/lib/agent-run-report-validation.mjs scripts/check-agent-run-reports.mjsは no match で PASSAllowed Paths 遵守
Issue #935 の
Allowed Pathsに対する遵守状況です。docs/schemas/,scripts/lib/,scripts/check-agent-run-reports.mjs,package.json,tests/,.github/workflows/に閉じています。Allowed Paths 遵守: yesを実装完了コメントの検証結果と一致させています。Checks
ローカル品質ゲートと issue 固有の検証を完了しています。
pnpm typecheck実行済みpnpm lint実行済みpnpm test実行済みpnpm build実行済みSchema Change Applicability
schema 追加 PR として consumer 影響を明示します。
schema_changeagent_run_report/v1/agent_retro_index/v1という新しい machine-readable contract を追加し、consumer の validator/check surface を同 PR で導入したため。Schema Consumer Inventory
report/index schema の before/after と consumer 反映先をここで固定します。
変更対象 schema: report/index の新規追加です。
agent_run_report/v1,agent_retro_index/v1before/after 差分:
Consumer 列挙(rg コマンド例と結果):
Consumer 更新状況:
docs/schemas/agent-run-report.schema.jsondocs/schemas/agent-retro-index.schema.jsonscripts/lib/agent-run-report-validation.mjsscripts/check-agent-run-reports.mjspnpm agent-run-report:checkentrypointpackage.jsonagent-run-report:checkscript を追加tests/agent-run-report-*.test.tstests/agent-retro-index.test.tstests/fixtures/agent-run-report/*tests/fixtures/agent-retro-index/*docs/schemas/agent-session-manifest.mdCompatibility Decision
互換性は additive として扱います。
additivebackward_compatiblenoN/ASafety Claim Matrix
安全境界の射程と未実装の follow-up を同じ場所に残します。
pnpm test -- --run tests/agent-run-report*.test.ts tests/agent-retro-index*.test.tsPASS;pnpm agent-run-report:check tests/fixtures/agent-run-report/valid-basic.json tests/fixtures/agent-retro-index/valid-basic.json tests/fixtures/agent-run-report/valid-comment.mdPASSpnpm testPASS;pnpm typecheckPASS;pnpm lintPASS;pnpm buildPASSNotes
補足の routing 情報です。
ea20d51e709b2573909e00d0f14dee4c76c446d1