Repository navigation
feat(archera): select the matching plan line item and type match statuses - #1056
Conversation
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 15 minutes for your next included review. View limit details
Comment |
Independent review at f27a848Verdict: no blocking or major findings. Two minor findings; the first has a one-test fix. Scope is the #1056 diff against the #1054 head (aeb2e93). Findings
Notes, not defects:
Checked against the published types (pkg 3def3f89,
|
|
Finding 1 resolved: added a current_type case ("ri") to the contradictory-evidence table. The hardcoded CurrentType mutant is now killed (verified in a scratch overlay, reverted). Finding 2: the ContractSpec cross-checks are deliberately out of scope. Per the plan, the offer-level fields are the identity proof. |
|
Nit on the unselected twin: no test pinned it before (the existing case only covered an unselected item alone). Added TestProjectContractUnselectedTwinDoesNotCreateAmbiguity: a selected item associates (SelectOne) even with an identical unselected twin, and the twin alone selects nothing. Dropping the IsSelected check in contractLineItem makes it fail. Unselected items are plan alternatives, not current commitments, so excluding them before the ambiguity check is intended. |
Independent review at 80ee82cFinal verdict: no remaining findings from me. Delta since f27a848 is two test-only commits.
This is a review verdict only, not an approval or merge. |
Independent review verdict: CLEAN at 80ee82cReviewer: a fresh Claude agent (Sonnet 5.5, high effort), not the author, with a cold brief. It reviewed Blocking findings: none. What was verified
Local verification (fixture-based,
Non-blocking notes (for PR3)
Gate:
|
…uses SelectLineItem exports the line-item selection MatchRecommendation already did, so the handler can pick the item before a scoped comparison call. ProjectContract now projects the published insurance line items and comparison into the match identities, and vendorAlternatives drops the candidate the vendor flags as current. Match, candidate, amount and economic statuses become typed constants (CandidateStatus, Reason), and validPayment uses the insurance.Payment constants. Refs #799 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kills the mutant that hardcodes CurrentType in ProjectContract. Refs #799 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #799 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80ee82c to
7a9721e
Compare
|
Pure rebase onto main after #1054 squash-merged (d47d516). Done with |
What and why
PR1b of the #799 R2 route plan (typed constants, line-item selection). Stacked on #1054 (PR1a, recommendation projection); the go pin bump (#1053) is already on main and in #1054's history, so no extra base is needed.
SelectLineItem(rec, items) (id, SelectStatus)is exported. It reusessameResourceand the ambiguity logic thatMatchRecommendationhad inline, andMatchRecommendationnow calls it. The handler (PR3) selects the item first, then makes a scoped comparison call.ProjectContractprojects the publishedinsurance.LineItemandComparisoninto the R1 identity types (adapted from the read-only WIP).vendorAlternatives(entries)skipsIsCurrentcandidates, so the current offer is never an alternative.CandidateStatusandReason*constants replace the string literals in match and alternatives.validPaymentusesinsurance.Payment*.Size: 367 added lines, every file under 500.
Tests
SelectLineItem: none, one, ambiguous, unsupported recommendation, nil.MatchRecommendationwith nil or zero amounts (recommendation, line item, current row, all-zero) givesMatchUnavailable. This pins existing behaviour.IsCurrentcandidate excluded, throughProjectContractandMatchRecommendation. It fails without the filter (mutant below).GOWORK=off:go test -race ./internal/archera/,go vet ./...,go build ./..., gofmt, gocyclo at most 10 all pass. Local lint is broken, so CI is authoritative.Mutations
18 synthetic mutants, run against synthetic fixtures with
go test -overlayon scratch copies: every contract field mapping (swap, drop, constant), theIsCurrentfilter, the selector's ambiguity check, validity check and returned ID, a dropped payment constant, and the candidate status. 16 killed. 2 survived (item payment, current payment: the fixture used the same value as the mutant), soTestProjectContractCarriesPaymentOptionswas added and both are now killed. One constant-value mutant did not apply and was not run. No real vendor responses were used.Refs #799
🤖 Generated with Claude Code