Repository navigation
feat(insurance): add an agent for one-off reviews of a repair shop's claims - #32
Merged
Merged
Conversation
…claims agent.py answers an investigator's question about one shop's year of claims. It runs the invoice workflow on every claim as its verifier; code builds the per-claim table from those results, and Claude only reports patterns, each labelled a finding or a question. Code checks the claim list is complete, every quote is a value the workflow read, and every finding rests on a failed check, so a closed claim the workflow refused can't be called a finding. 5 of 5 runs came out as expected. Every run also asked a needless question about the shop's own address, reported in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post isn't published yet, so its links returned 404, and its claims will change in the blog update. The README now links the root README's test and states each point on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An unread field is not a failed check: an invoice whose only flagged
checks say a value wasn't read ("Not read", conflicting_values, "no
claim number read") is now not_checked with "a field wasn't read",
the job is incomplete, and a finding can't rest on it.
- Escape invoice-derived and Claude text in siu-report.md with md_safe;
the request, summary and notes go in fenced blocks.
- Tools reach only the job's records: claims_for_shop takes only the
job's shop and year, get_claim only a claim on that list.
- check_report keeps every invoice per claim, not the last one.
- Claude API errors: 408, 409, timeouts and connection errors end the
job with the reason; any other API error stops the run, printing its
own message first; fallback answers are priced on response.model.
- README: what each rule proves, the scoped tools, a finding may name a
clear claim, numbers from five live reruns after the fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Self-reviewTwo review passes ran on this PR. One read the code: correctness, silent failures, tests and comments. The other covered security and checked the README against the code. Every finding below was fixed in b6afbb2, and each fix has a selfcheck case that fails if the fix is undone. Important (2, both fixed)
Suggestions (all fixed)
Reruns after the fixes (5 live runs, 11 Nov 2026)All 5 runs came out as expected, with the same per-claim table each time. On run 1 the agent filed the closed claim as a finding; the code sent it back, and the revision made it a question. The noise question about the shop's own address now shows up on 3 runs in 5, down from 5 in 5. Claude cost about $0.09 a job. |
rparundekar
force-pushed
the
feat/agent-insurance
branch
from
November 11, 2026 02:46
f031f94 to
b6afbb2
Compare
rparundekar
marked this pull request as ready for review
November 11, 2026 02:46
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.
What this does
Adds
agent.pybeside the invoice check. An investigator asks about one repair shop's year of claims. The agent runs the invoice workflow on every claim as its verifier. Code builds the per-claim table from those results, and Claude only reports patterns, each labelled a finding or a question. Code then checks that:That last check means a closed claim the workflow refused to check can't be turned into a finding.
Live results (5 runs, using SIE Serverless, 10 Nov 2026)
5 of 5 as expected.
recipe.pyanddata/are unchanged. Depends on the docs PR.🤖 Generated with Claude Code