Repository navigation
Conversation
Explicit, default-off comparison of an Archera commitment plan using pkg/insurance. Key from ARCHERA_API_KEY only (no flag); org and plan IDs from env or flags. Table or JSON output via cmd.OutOrStdout, exact decimal money, unknown never rendered as 0, vendor strings sanitized, disclosures verbatim. Never purchases and makes no request unless run. Closes #2156 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Gate review (independent, Opus) at 722808a: CHANGES REQUESTED, not mergedLocal evidence (
Security properties: hold. Mutations killed by the PR's tests: unknown-as-supported (JSON and table), disclosures replaced, 2-decimal money, JSON written to os.Stdout, key fallback, missing-setting message echoing the key, Retry-After hidden, one automatic retry, Findings (blocking):
CI: Integration Tests fail on |
|
Line-number correction for the gate comment above (same findings, head 722808a): archera_render.go financials L160-165, totals upfront L170, offer fields L188-205 (deltas L201-204), hypothetical fields L230-235, line item fields L240-244; test case "403 echoing key" is archera_comparison_test.go:296. |
Every money field in the fixture now carries a unique value (hundreds digit is the block, units digit the field) and table and JSON output are compared against golden files, so a swapped field mapping changes the output. One value is a long decimal that float64 cannot hold exactly. The vendor error cases use the real "message" body shape and assert the key is redacted. The credential-flag check matches any flag containing key, token, secret or password. Refs #2156 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Gate re-review (independent, Opus) at 7082bb8: CHANGES REQUESTED, not mergedThe diff since 722808a touches only test files and testdata; the renderer is unchanged. Local run ( I reran my mutation set against the PR's Archera tests: 48 of 50 mutants were killed. These include every money/offer/row/hypothetical/line-item field mapping, money via float64 (both goldens fail), deleting the caveat, an
|
|
Correction to the re-gate comment above: the offer-name mapping is archera_render.go:196, not :194. |
…omparison The fixture now injects ESC and C1 characters (and an over-256-byte name) into the vendor string fields, the goldens pin the sanitized values, and a direct DTO test covers the fields the decoder would reject. The printed fetch time is asserted to be the current instant in UTC with the process zone shifted. Pkg-supplied product support text is no longer sanitized. Refs #2156 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Gate finding 1 (blocker) at 222ef76: data race from mutating
Suggested fix: set the shifted zone once before any goroutine starts (in |
|
Gate re-review at 222ef76: REQUEST CHANGES (blocker is finding 1 above: the Since 66b752d the PR's own files are unchanged except CHANGELOG lines from main. Other evidence at this SHA (git archive, GOTOOLCHAIN=go1.26.9): full Independent mutation sweep, 73 mutants over every DTO field mapping, sanitizer call sites, money formatting, disclosures/caveat/premium note, Retry-After, format check, output writer, settings/key handling, loops: 65 killed, 8 survived. The Survivors (finding 2, should fix alongside the race):
Non-blocking: dropping Product-support Source/Evidence left unsanitized: accepted, they come from pkg constants in |
Summary
Adds
ri-helper archera-comparison: an explicit, read-only, default-off comparison of one Archera commitment plan usingpkg/insurance(pkg pin 73d3366, already on main). It never purchases, is independent of--purchase, and makes no Archera request unless run.ARCHERA_API_KEYfrom the environment only (no key flag);ARCHERA_ORG_ID/ARCHERA_PLAN_IDfrom env or--org-id/--plan-id(read inside RunE only, so--helpnever shows them). Missing setting: exit 1 naming the setting, no value echoed.insurance.Configand*insurance.Clientare RunE locals; nothing holds them in a package var or struct. Production passeshc=nil(hardened client, pinned origin, no redirects, no retries).cmd.OutOrStdout()only (AppLogger not used), so--format jsonis exactly one document. Exact decimal money (smallest round-tripping precision, no float, no division), unknown =unknown/null, 730-hour monthly vs one-time upfront, discount rate verbatim, vendor strings stripped of control chars and capped at 256 bytes, product support supported/unknown only, caveat and plan-wide note, disclosures verbatim from pkg/common (non_gating_disclosure,sponsorship_disclosure).Evidence (synthetic, offline)
All tests use httptest behind a RoundTripper that asserts
https://api.archera.aibefore rewriting; synthetic key and UUIDs; no live Archera calls. Covered: default-off (no request on --help), each missing setting, documented GET path/header/no query, table and JSON output (premium-inclusive, unknown, fallback reason, lease attached, supported vs unknown product), control-char stripping, 401/403 (body echoing the key)/429 (Retry-After 30)/invalid UUID/redirect (second URL never hit), no key-like flag,%v %+v %#v %sof CLI structs before and after a call, key grep on stdout/stderr/errors.make lint0 issues;go test ./cmdok (457s).No filter flags (defaults only), so no ContractTerms seam is needed yet.
Closes #2156
🤖 Generated with Claude Code
Summary by CodeRabbit
archera-comparisoncommand to compare an Archera commitment plan. Results are available in table or JSON format; the command makes no request unless run.