Repository navigation
fix: close observation source reason code contract (#1259) - #1293
Conversation
Preview URLPreview removed (PR #1293 closed). |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=
MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: issue #1259 の AC1-AC11 に対応する closed allowlist、regex/maxItems/maxLength invariant、semantic required code、reason-code 専用 blocked reason、negative fixture/test が current head に実装されています。
- Allowed Paths:
allowed_paths_review_gate.pyで contract snapshot#issuecomment-4865832429と照合しstatus: okでした。 - CI Verification:
ci_verdict_summary.pyは expected headb49e7bb7bd67cc1dd9df9108eee71564b096ab1cに対してstatus: all_passを返しました。 - 検証コマンド結果: current head の CI で
pnpm typecheck/pnpm lint/pnpm test/pnpm buildが成功しています。
Blockers
- なし
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "b49e7bb7bd67cc1dd9df9108eee71564b096ab1c"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
判定REQUEST_CHANGES。 確認対象は PR #1293、関連 Issue #1259 / #1153 / #1222 / #1223 / #1245 / #1261、関連 PR #1243 / #1247 / #1254、PR コメント、変更ファイル、repo 内 validator/checker/docs/tests/fixtures です。PR #1293 は open / mergeable、12 files、+519/-23 の schema change を含む変更です。 良い点この PR は、#1259 の anchor comment が要求した「regex だけではなく closed registry + regex invariant」に実装を寄せています。Issue #1259 は、 実装上も、adapter に schema 側も final validator と retro index 側で reason-code violation を digest mismatch から分離した点も正しいです。 Blocker 1: schema と runtime の semantic contract が一致していないruntime は次の semantic を強制しています。 このうち後半 2 つ、特に 「available で source_unavailable 禁止」 と 「non-partial で partial_projection 禁止」 は runtime にしかありません。adapter の 一方、schema は positive constraint だけです。 したがって、例えば次のような payload は schema 上は拒否されない可能性があります。 {
"capability_verdict": "supported",
"availability": "available",
"safety": {
"reason_codes": ["source_unavailable"]
}
}または: {
"capability_verdict": "unsupported",
"availability": "unavailable",
"safety": {
"reason_codes": ["source_unavailable", "partial_projection"]
}
}
これは #1259 が求める「adapter / schema / final validator / retro index の各層で fail-closed」とズレます。 要求修正: schema に runtime と同等の negative semantic を追加してください。JSON Schema では 例: {
"if": {
"properties": {
"availability": { "const": "available" }
},
"required": ["availability"]
},
"then": {
"properties": {
"safety": {
"properties": {
"reason_codes": {
"not": {
"contains": { "const": "source_unavailable" }
}
}
}
}
}
}
}さらに、 これらは Blocker 2: schema consumer inventory が不完全PR 本文の consumer inventory は、schema、adapter、final validator、retro index、tests を列挙していますが、公開 checker 経路である 実際には、 #1259 は 要求修正: PR 本文の Schema Consumer Inventory に次を追加してください。 そのうえで、 Major 3: AC9 の adversarial fixture coverage がまだ薄い追加テストは有効です。adapter test は ただし #1259 / anchor comment の敵対的リストに対して、まだ抜けがあります。Issue は natural language、HTML/Markdown breakout、path-looking、secret-looking、too many、too long、uppercase / punctuation drift を negative fixture に含めることを明示しています。 現状の adapter test には、少なくとも次が見当たりません。 特に最後の 2 つは Blocker 1 の schema/runtime drift を固定するために必要です。 要求修正: adapter unit test だけでなく、schema/checker fixture と final validator fixture の両方で AC9 を代表させてください。最低限、schema-level fixture で「runtime だけが知っている禁止 semantic」をなくす必要があります。 Major 4: PR preview / 配布物は merge evidence として扱えないPR コメントには GitHub Actions bot の preview URL が出ていますが、コメント自身が “asset-level live check 未検証 / Pages source 設定後に有効化” と明記しています。また、Pages source 設定が必要な場合があり、base path 修正だけでは hosted runtime 復旧を保証しないとも書かれています。 この PR の主対象は schema / validator / fixture なので、preview が未検証であること自体は blocker ではありません。ただし、PR 本文やレビューで preview を品質証跡として扱うべきではありません。 関連する #1261 は、Latitude telemetry distribution / real pilot activation について exact semver、dist integrity、tarball digest、entrypoint/preload/hook digest、argv exposure、remote cleanup gate を fail-closed にする別 issue です。 npm provenance も、package がどこで build/publish されたかの verifiable link を与えるものであって、悪意あるコードがないこと自体を保証するものではありません。([npmドキュメント]6) GitHub Actions で npm provenance を出す場合も 要求修正: この PR では、preview を evidence から明示的に外すか、次を PR comment / checklist に残してください。 preview_evidence:
status: not_used_for_merge_decision
reason: asset-level live check is not verified by PR preview botPR #1293 の合否は 推奨パッチ方針優先順位は次です。
最終評価実装の中核はかなり良いです。closed enum + anchored regex + max length/items + adapter fail-closed + final/retro taxonomy 分離は #1259 の主目的に合っています。 |
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=
MERGEABLE, merge_state_status=CLEAN
Evidence Check
- owner comment
#issuecomment-4866306195の blocker だった schema-only checker 経路の inverse semantic drift は、current head95f0578049896a182b018aa49caf46aa1ed346e8で schemanot contains制約と fixture 追加により解消されています。 - CI Verification:
ci_verdict_summary.pyは expected head95f0578049896a182b018aa49caf46aa1ed346e8に対してstatus: all_passを返しました。 - PR body には current-head の Schema Consumer Inventory と
preview_evidence.status: not_used_for_merge_decisionが記載されています。 - Allowed Paths:
allowed_paths_review_gate.pyを issue snapshot#issuecomment-4865832429で再計算した結果、tests/agent-run-report-schema.test.tsが issue #1259 の Allowed Paths 外でstatus: fail_closedでした。
Blockers
- issue #1259 の Allowed Paths に
tests/agent-run-report-schema.test.tsは含まれていません。current head は semantic blocker を直していますが、この scope 逸脱が残るため current-head APPROVE にはできません。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "95f0578049896a182b018aa49caf46aa1ed346e8"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers:
- "allowed_paths_gate failed: tests/agent-run-report-schema.test.ts is outside issue #1259 Allowed Paths"
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: fail_closed
allowed_paths_gate_source: review_subagent
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=
MERGEABLE, merge_state_status=CLEAN
Evidence Check
- owner comment
#issuecomment-4866306195の blocker だった schema-only checker 経路の inverse semantic drift は、current head95f0578049896a182b018aa49caf46aa1ed346e8で schema のnot contains制約と追加 fixture により解消されています。 - Allowed Paths: current contract snapshot
#issuecomment-4866920444と issue bodysha256:fdf436d7bcf13edd2d5f60b4e008294590af1d14c24878cb06240fdb78597597を使ってallowed_paths_review_gate.pyを再計算し、status: okでした。 - CI Verification: live
rtk gh pr checks 1293を current head で再確認し、Passed: 14 / Failed: 0でした。先ほどのci_verdict_summary.pyのPR Body Japanese Check集計より live check state を正本として採用します。 - 検証コマンド結果: PR body に
pnpm typecheck/pnpm lint/pnpm test/pnpm buildの実行結果と Schema Consumer Inventory / Safety Claim Matrix / preview exclusion が記載されています。
Blockers
- なし
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "95f0578049896a182b018aa49caf46aa1ed346e8"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
Summary
この PR は observation source reason code の公開面 contract を閉じた形に揃える変更です。
public_safety.observation_sources[].safety.reason_codesを閉じた許可コード契約に固定し、自由記述や unknown、重複、件数超過、長さ超過を adapter と schema の両方で fail-closed にしました。validate-final-reportとretro-index-builderで reason code violation を digest mismatch とは別の理由で拒否するようにしました。Checks
主要な検証コマンドはすべてこの worktree 上で実行して成功しました。
pnpm typecheckを実行済みです。pnpm lintを実行済みです。pnpm testを実行済みです。pnpm buildを実行済みです。受け入れ条件の達成状況
source_unavailable/partial_projectionの semantic requirement を強制しました。entirecli_safety.reason_codesと shared validator 本体は scope 外のまま維持しました。検証コマンド結果
pnpm typecheck: PASS。型エラーはありません。pnpm lint: PASS。lint エラーはありません。pnpm test: PASS。88 files / 1314 tests が通過しました。pnpm build: PASS。production build が成功しました。Allowed Paths 遵守
scripts/lib/agent-run-report-validation.mjsとentirecli_safety.reason_codesには変更を入れていません。Schema Change Applicability
docs/schemas/agent-run-report.schema.jsonの observation source reason code contract にpattern/maxLength/maxItemsと semantic contains / not-contains 制約を追加したためです。Schema Consumer Inventory
変更対象 schema:
agent_run_report/v1($defs.observationSourceSafety,$defs.observationSourceReasonCode)before/after 差分:
Consumer 列挙(rg コマンド例と結果):
rg -l "observationSourceReasonCode|report_observation_sources_reason_codes_invalid|observation_source\\.reason_code|validateAgentRunReport|agent-run-report:check|agent-run:check|agent-retro-index:check" docs scripts tests package.json docs/schemas/agent-run-report.schema.json package.json scripts/check-agent-run-reports.mjs scripts/lib/agent-run-report-validation.mjs scripts/agent-logs/lib/observation-source-adapter.mjs scripts/agent-logs/lib/validate-final-report.mjs scripts/agent-logs/lib/retro-index-builder.mjs tests/agent-logs/retro-index-builder.test.tsConsumer 更新状況:
scripts/check-agent-run-reports.mjsscripts/lib/agent-run-report-validation.mjspackage.json(agent-run-report:check/agent-run:check/agent-retro-index:check)scripts/agent-logs/lib/observation-source-adapter.mjsscripts/agent-logs/lib/validate-final-report.mjsreport.observation_sources_reason_codes_invalidに分類scripts/agent-logs/lib/retro-index-builder.mjstests/agent-logs/observation-source-adapter.test.tstests/agent-logs/generated-report-validation.test.tstests/agent-logs/retro-index-builder.test.tstests/fixtures/agent-run-report/*reason-code*docs/dev/agent-run-report.mdCompatibility Decision / 互換性判断
semantic_change。意味契約の強化です。breaking。旧来の自由記述寄り payload は reject されます。yes。producer は closed allowlist に合わせる必要があります。N/A。この PR で consumer 側の整合まで含めています。Safety Claim Matrix
pnpm test,tests/agent-logs/observation-source-adapter.test.ts,tests/agent-logs/generated-report-validation.test.tspnpm test,tests/agent-logs/retro-index-builder.test.tsscripts/lib/agent-run-report-validation.mjsとentirecli_safety.reason_codesは scope 外プレビュー証跡
Notes