Skip to content

Commit 0680295

Browse files
dkayclaude
andcommitted
sandbox,server: surface per-path L7 escalations as fresh draft chunks
Post-approval L7 (HTTP method/path) denials were vanishing instead of reaching a reviewer. Wire them through to a fresh, reviewable draft chunk while keeping straggler-flush noise suppressed. - sandbox: wire L7 relay denials into the denial aggregator. L7EvalContext gains a denial_tx channel; every L7 deny (request-log and forward paths) emits a DenialEvent carrying the observed method/path, feeding the same observation-driven analysis as connect-stage denials so mechanistic proposals can be path-aware. - server persistence: clear dedup_key when a chunk is decided (sqlite + postgres) and backfill existing decided rows via migration 006. New observations for the same host|port|binary surface as a fresh pending chunk instead of folding their hit_count into a row the reviewer already acted on. Without the backfill, rows decided under a pre-upgrade gateway silently absorb new denials through the status-blind submit upsert. - server: make the post-approval mechanistic self-reject sweep L7-evidence-aware. A resubmit asking for nothing beyond the union of the approved grants for that endpoint still self-rejects (noise suppression); a submission carrying method/path asks OUTSIDE the approved grants stays pending for review. Path coverage uses a conservative glob matcher (* = one segment, ** trailing only, unknown shapes fall back to exact equality) so ambiguity errs toward surfacing a card. - server: gate the self-reject sweep on a live-policy probe (policy_covers_rule). Approved chunk records outlive the clauses they merged (a temporary grant expiring via RemoveBinary, or a manual --remove-rule); trusting the record alone would auto-reject every future denial for that endpoint, leaving it permanently un-reviewable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f1245a3 commit 0680295

10 files changed

Lines changed: 546 additions & 14 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Decided draft chunks must not hold dedup keys. The submit-time upsert
2+
-- matches on (object_type, scope, dedup_key) regardless of row status, so a
3+
-- decided row that still holds its key silently absorbs new observations
4+
-- into a chunk the reviewer already acted on — and, because the index is
5+
-- unique, blocks inserting a fresh pending row for the same endpoint.
6+
-- Decision paths now clear the key, but rows decided before that rule
7+
-- existed still carry theirs: scrub them.
8+
UPDATE objects SET dedup_key = NULL
9+
WHERE object_type = 'draft_policy_chunk'
10+
AND dedup_key IS NOT NULL
11+
AND status != 'pending';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Decided draft chunks must not hold dedup keys. The submit-time upsert
2+
-- matches on (object_type, scope, dedup_key) regardless of row status, so a
3+
-- decided row that still holds its key silently absorbs new observations
4+
-- into a chunk the reviewer already acted on — and, because the index is
5+
-- unique, blocks inserting a fresh pending row for the same endpoint.
6+
-- Decision paths now clear the key, but rows decided before that rule
7+
-- existed still carry theirs: scrub them.
8+
UPDATE objects SET dedup_key = NULL
9+
WHERE object_type = 'draft_policy_chunk'
10+
AND dedup_key IS NOT NULL
11+
AND status != 'pending';

0 commit comments

Comments
 (0)