The Bedrock client boundary. Isolate and test it hard. See DESIGN.md §8 (invocation).
Scope
backend/claude/runner.py: wrap the anthropic[bedrock] AnthropicBedrock client (region + AWS credential chain). One call = one Messages request with the doc-bundle prefix (cached), the examine/dedup/categorize prompt, and a forced output tool whose schema is the Finding list (tool_choice forces it).
- Structured output comes back as the tool-call input (schema-valid JSON); Pydantic re-validates as a backstop with a small capped retry on mismatch.
- Per-request timeout; parse and accumulate exact token usage (input / output / cache-read / cache-write) from each response.
Depends on
#2
Test approach
TDD at the mocked client boundary. Stub the Bedrock client; feed canned tool-call responses: valid, schema-violating (retry then fail), timeout. Assert forced-tool wiring, retry cap, and usage accumulation. No real Bedrock calls in CI.
Acceptance
The Bedrock client boundary. Isolate and test it hard. See
DESIGN.md§8 (invocation).Scope
backend/claude/runner.py: wrap theanthropic[bedrock]AnthropicBedrockclient (region + AWS credential chain). One call = one Messages request with the doc-bundle prefix (cached), the examine/dedup/categorize prompt, and a forced output tool whose schema is theFindinglist (tool_choiceforces it).Depends on
#2
Test approach
TDD at the mocked client boundary. Stub the Bedrock client; feed canned tool-call responses: valid, schema-violating (retry then fail), timeout. Assert forced-tool wiring, retry cap, and usage accumulation. No real Bedrock calls in CI.
Acceptance
anthropic.claude-*IDs).