Repository navigation
Feat/wire robustness - #5
Merged
Merged
Conversation
…ted), forward max_tokens ShapeStage (after auth) denies requests whose wire carried content the classifier cannot see: image/file content parts and tool definitions, calls or results, on both dialects. DenialKind.Unsupported → 400 (OpenAI 'unsupported', Anthropic 'invalid_request_error'); the refusal is audited against the resolved caller and never contains the payload. Silently stripping (the previous behaviour) let unclassified bytes reach a provider and lied to tool-using clients. max_tokens / max_completion_tokens now reach ChatOptions.MaxOutputTokens; non-positive values are refused. Coverage gate raised to 0.80 (measured 0.886). Tests +14: wire mapping tables for both dialects, stage guarantees, max_tokens forwarding, and Host round-trips (400 shapes, audited, payload absent from evidence, streamed request stays JSON).
- Denial reasons never echo client bytes: part/block type labels are allow-listed (WireLabels.Safe), unknown → 'unknown'. The reason lands in the append-only audit chain, so an unbounded client string there was a leak path. Test fails if the allow-list is removed (unit + Host). - Detectors are total: non-string 'type'/'text', object content, non- object parts are refused, never thrown (a throw = un-audited 500). - tools: [] / functions: [] are not tool requests (clients send them). - Also refused: n>1, modalities/audio/web_search_options/prediction (OpenAI), mcp_servers/thinking/container (Anthropic) — provider-side egress or response shapes the wire cannot carry. - Cache key includes max_tokens (a 400-token answer never serves a 5-token ask) + test. - Audit assertions poll the sink instead of sleeping. - Unsupported → 400 pinned in the Anthropic taxonomy table; diagrams and dashboard explain() updated.
…ll role/messages Policy denial reasons carried the client's model id verbatim into the audit chain (same class as the shape-label leak): Evidence.Bounded strips control chars and truncates at 64 chars with a marker. Null role, null messages, null message elements and non-integer n are refused or defaulted instead of throwing (a throw is an un-audited 500).
…xOf treats them as ignorable)
…ed against the scoped measurement)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.