Repository navigation
Conversation
ECC Tools / Security EvidenceCommit: Security scanner evidence required (action_required) Detected 1 security-sensitive predictive risk signal(s) without scanner evidence. Mode: enforce Findings:
Touched security-sensitive paths:
Expected evidence:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / PR Risk TaxonomyCommit: PR taxonomy review recommended (neutral) Detected 3 PR taxonomy bucket(s): Security Evidence, Harness Drift, CI/CD Recommendation. Scanned 9 changed file(s). Roadmap taxonomy buckets: Security EvidenceSecurity-sensitive changes should carry explicit scanner, code-scanning, or focused regression evidence. Signals:
Paths:
Harness DriftHarness-facing changes can drift across Claude Code, Codex, OpenCode, and shared adapter surfaces. Signals:
Paths:
CI/CD RecommendationCI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work. Signals:
Paths:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
ECC Tools / Reference Set ReadinessCommit: Reference set readiness gaps detected (neutral) Reference evidence present for 0/7 areas (0%) across 9 changed file(s). This check is based on files changed in this PR. Repository-level readiness is still reported by
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Hosted Promotion ReadinessCommit: Hosted promotion readiness passed (success) No hosted promotion evidence gaps detected across 9 changed file(s); 0 corpus scenarios had matching evidence. This check compares PR file changes against the evaluator/RAG promotion corpus in No evaluator corpus scenarios matched this PR. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
A first-touch denial marks its file checked so the retry passes, which also let the other edits to that file in the same parallel batch apply and left the file half-edited (affaan-m#3136 only warned about this). When the denied call's own tool_use_id is found in the transcript, the denial now records the batch (assistant message id) for that file in the same state write. A later Edit/Write/MultiEdit/NotebookEdit of the file from that batch is denied with a message that says to resend every edit with the retry. Calls from any other message pass, including the retry. There is no newest-message fallback, so a guessed batch can never deny the retry; without a located batch the affaan-m#3136 warning still applies. Same-batch denials are recorded as the new `batch-deny` metrics decision and do not count toward fact_force_denials. batch_locks is validated on read, merged by newest `at` and capped at 50 entries. Fixes affaan-m#3936 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3896209 to
b2fa2d9
Compare
ECC Tools / Security EvidenceCommit: Security scanner evidence required (action_required) Detected 1 security-sensitive predictive risk signal(s) without scanner evidence. Mode: enforce Findings:
Touched security-sensitive paths:
Expected evidence:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / PR Risk TaxonomyCommit: PR taxonomy review recommended (neutral) Detected 3 PR taxonomy bucket(s): Security Evidence, Harness Drift, CI/CD Recommendation. Scanned 9 changed file(s). Roadmap taxonomy buckets: Security EvidenceSecurity-sensitive changes should carry explicit scanner, code-scanning, or focused regression evidence. Signals:
Paths:
Harness DriftHarness-facing changes can drift across Claude Code, Codex, OpenCode, and shared adapter surfaces. Signals:
Paths:
CI/CD RecommendationCI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work. Signals:
Paths:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Reference Set ReadinessCommit: Reference set readiness gaps detected (neutral) Reference evidence present for 0/7 areas (0%) across 9 changed file(s). This check is based on files changed in this PR. Repository-level readiness is still reported by
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Hosted Promotion ReadinessCommit: Hosted promotion readiness passed (success) No hosted promotion evidence gaps detected across 9 changed file(s); 0 corpus scenarios had matching evidence. This check compares PR file changes against the evaluator/RAG promotion corpus in No evaluator corpus scenarios matched this PR. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
|
Thank you for denying same-batch siblings after a correlated first-touch denial. We merged your original commit history through #4048 so the related changes could be tested together. The maintainer pass aligns the canonical guidance and metrics with the conditional same-file batch lock, including the missing-transcript limitations. The resulting main commit |
What Changed
scripts/hooks/gateguard-fact-force.js: a first-touch denial now recordsbatch_locks[<file key>] = { batch, at }in the same state write that marks the file checked. It does this only when the denied call's owntool_use_idis in the transcript, andbatchis that call's assistant message id. A later Edit, Write, MultiEdit entry or NotebookEdit of the file is denied when its owntool_use_idis in the same batch. The denial says the earlier edit to the file in this batch was denied and that every edit to the file from the batch should be resent with the retry. When the lock is recorded, the first-touch denial (full and condensed) says the siblings are denied too, instead of "may already have been applied".scripts/lib/gateguard-state.js:getBatchLocks/mergeBatchLocks/capBatchLocks, built like thedir_gateshelpers: validated{ batch, at }entries, null-prototype map, newestatwins on merge, capped at 50.scripts/lib/gateguard-metrics.js,scripts/gateguard-report.js: newbatch-denydecision, counted as a denial but not as a first touch.docs/gateguard/design-notes.md: a new "Same-batch siblings" section, plusbatch_locksunder "State file is untrusted".Why This Change
As #3936 describes, the first-touch denial marks the file checked so the retry passes. That also let the other edits to the same file in that batch apply, which left tables without headers, code without its comment, and so on. Since #3136 the hook only warned. The comment said a batch cannot be locked, but
gateguard-turn-scan.jsalready maps everytool_use_idto its assistant message id, so the lock the issue proposes is possible.The lock needs the pending call to be found by its own
tool_use_id. There is deliberately no fallback to the newest assistant message: a guessed batch could match the retry and deny it every time. With notool_use_id, no transcript, or the call not in the transcript yet, nothing is locked and the #3136 warning still applies. The design notes now document this, as the issue asked. A same-batch denial does not add tofact_force_denials, so the denial cap and the condensed ordinals are unchanged. The transcript is read on a checked file only when a lock exists for its key, so checked edits keep the same lazy loading.Fixes #3936
Testing Done
tests/hooks/gateguard-fact-force.test.jshas 8 new cases. They cover: the sibling is denied, the denial count stays 1, and the retry and resent sibling from the next message pass; one record pertool_usesharing a message id counts as one batch; another file in the batch gets its own first-touch gate; with notool_use_id, or the pending call missing from the transcript, nothing is locked; MultiEdit and NotebookEdit siblings are denied; a Write followed by an Edit in one batch is denied; the condensed denial carries the locked note on one line; malformed or__proto__batch_locksentries are ignored. 5 of them fail on main. The 3 fail-open and validation cases pass on both, by design.tests/lib/gateguard-state.test.jsgets a helper test, and the metrics enum test is updated.node tests/run-all.js: the only failures also fail on main on this machine:audit-closed-references(page-two fixture), the gateguardsupports multiple comma-separated exempt globs (Write + non-match)case,agent-payment-x402-seller-guard(noexpressin local node_modules), and thecodex-hooksreal-scanner cases (need ripgrep with PCRE2). Allscripts/ci/*validators,npm run lintandnpm run command-registry:checkpass.Type of Change
fix:Bug fixSecurity & Quality Checklist
batch_locksholds the canonical file key and a message id, the same kind of datacheckedalready storesDocumentation
skills/gateguard/SKILL.mdnot changed in this PR: its "Parallel Batches and Partial Application" section ("A batch-wide lock is not possible") and the metricsdecisionlist should mention the lock andbatch-deny. Any byte change to a SKILL.md makes the skill-triggers manifest stale (tests/ci/context-profiles.test.js), and the rebind is maintainer-owned. I'm happy to push that doc edit if you want it here.🤖 Opened with Superhuman, an open-source contribution agent.
🤖 Generated with Claude Code