Skip to content

claude protocol denial shape fix - #178

Merged
nikolasd merged 2 commits into
mainfrom
claude-protocol-denial-shape-fix
Sep 11, 2026
Merged

nikolasd merged 2 commits into
mainfrom
claude-protocol-denial-shape-fix

Conversation

@nikolasd

@nikolasd nikolasd commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #177, found in review after that PR had already landed (783b141).

Behavior fix: drive_turn's ledger-reconciliation check was treating a permission_denials entry with no tool_use_id the same as a genuinely unexplained one, and reporting both with "the host was never consulted for it." The two are different problems -- a missing tool_use_id is a shape/parse issue (nothing to correlate against either the bridged-request set or the observed-notice set), not evidence the sentinel failed. Split into two branches; both still fail closed, only the message differs now. Test added asserting the new message's presence and the old claim's absence, so a regression that reintroduces the wrong wording under the right conditions gets caught.

Fixture correction: ask-rule-no-control-frame.jsonl's messaging_socket_path still named /tmp/cc-socks/, this agent harness's own cross-session socket directory -- incidental to what the fixture proves, not a real leaked value (the port itself was already placeholder-scrubbed). Replaced with a neutral placeholder.

This lands before the maintainer-observed proof run so a live, billed run never hits the mis-diagnosing message.

cargo fmt, cargo clippy --all-targets --all-features -- -D warnings, cargo test --workspace, and bun run check all clean.

…reconciliation check

A permission_denials entry with no tool_use_id at all was falling into
the same "no corresponding entry ... the host was never consulted"
branch as a genuinely unexplained denial. The two are different
problems: the first is a shape/parse issue (nothing to correlate
against either set), the second is the actual sentinel-failure signal.
Conflating them names a cause with no evidence behind it, and would
make a future CLI release that drops tool_use_id fail every denial in
every repo with an ordinary deny rule while pointing debugging at the
wrong flag -- the same blast radius as the two-way check this rework
replaced.

Both branches still fail closed; only the message differs now. Added
the missing-tool_use_id case to the classify_line parse test, plus a
dedicated end-to-end test asserting the shape message appears and the
"host was never consulted" claim does not.
…ol-frame fixture

messaging_socket_path's port was already placeholder-scrubbed
(/tmp/cc-socks/0.sock, consistent with session_id/uuid/cwd on the same
line) -- no real socket path was ever committed, and the original
scrub pass did not miss it. What remained was the directory itself,
/tmp/cc-socks/, which is our own agent harness's cross-session socket
location, not a value the capture produced. Incidental to what this
fixture proves (the calibration call's own permissionMode/
permission_denials shape), worth removing so a later reader doesn't
wonder whether our own tooling's socket layout mattered to that null
result. Replaced with a neutral, self-documenting placeholder in the
style already used for the other scrubbed fields on that line.
@nikolasd
nikolasd merged commit e5be731 into main Sep 11, 2026
17 checks passed
@nikolasd
nikolasd deleted the claude-protocol-denial-shape-fix branch September 11, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant