Repository navigation
chore(insurance): track Archera pkg/insurance consumer integration (go, platform, CLI, MCP) #786
Copy link
Copy link
Open
Labels
effort/xlMulti-week / refactorMulti-week / refactorimpact/fewLimited audienceLimited audiencepriority/p2Backlog-worthyBacklog-worthyseverity/mediumModerate harmModerate harmtriagedItem has been triagedItem has been triagedtype/choreMaintenance / non-user-visibleMaintenance / non-user-visibleurgency/this-sprintWithin the current sprintWithin the current sprint
Description
Tracking: Archera integration consumers of pkg/insurance
The Archera insured-commitment comparison contract pkg/insurance is merged in cloud-commitments-go (#285, closes go#284), and nothing consumes it yet. This issue tracks wiring it into each consumer. These issues cover scope only; the implementation PRs come later.
| # | Repo | Issue | Effort |
|---|---|---|---|
| 1 | cloud-commitments-go | LeanerCloud/cloud-commitments-go#311: CHANGELOG entry for pkg/insurance (P3 follow-ups stay in go#286) |
xs |
| 2 | cloud-commitments-platform | #785: backend, API, config/secret, IaC and UI | l |
| 3 | cloud-commitments-cli | LeanerCloud/cloud-commitments-cli#2156: explicit comparison command | m |
| 4 | cloud-commitments-mcp | LeanerCloud/cloud-commitments-mcp#48: read-only comparison tool | m |
Dependency order
- go#311 (CHANGELOG) has no dependencies and should land before the first consumer pins
pkg/insurance. - Platform (feat(insurance): consume pkg/insurance for an explicit Archera comparison (backend, API, config, UI) #785) goes first. It settles the shared config names, the error wording for "not configured" and "incomplete", and the response DTO conventions (unknown means null, premium included, no currency).
- CLI (cli#2156) and MCP (mcp#48) follow and reuse the decisions from feat(insurance): consume pkg/insurance for an explicit Archera comparison (backend, API, config, UI) #785. They can run in parallel with each other.
- Every consumer bumps
github.com/LeanerCloud/cloud-commitments-go/pkgto a commit that contains fix(frontend): post-exchange refresh drops the RI account scope and skips reshape recs #285 (73d3366or later). Today platform pinsa9a426224031, and CLI and MCP pin90e61e668b99; both predatepkg/insurance.
Shared configuration (all default off)
| Name | Meaning | Secret |
|---|---|---|
ARCHERA_API_KEY |
Archera API key (x-api-key). Platform: resolved through the existing secret resolver (proposed ARCHERA_API_KEY_SECRET reference, see Q2). CLI and MCP: process environment only. |
yes |
ARCHERA_ORG_ID |
Archera organization UUID | no |
ARCHERA_PLAN_ID |
Archera commitment plan UUID (an Archera ID, not a local recommendation or plan ID) | no |
Shared rules:
- With no config, the surface is disabled and makes no outbound call.
- With an explicitly requested action and incomplete config, the result is a sanitized error naming the missing setting, never a silent success.
- No implicit Archera calls on startup, or on the recommendation or purchase paths.
- The key is never in flags, tool arguments, browser state, response JSON, audit records or logs.
Cross-cutting acceptance (each consumer)
- Offline tests traverse the real production composition (config,
insurance.NewClient, documented GET, decode, consumer output) through an injected transport tohttptest, using recorded or synthetic official-schema responses and a synthetic key and IDs. - No live calls to api.archera.ai, and no purchases, binding or customer submissions.
- Unknown money is rendered as unknown, never
0. Premium-inclusive totals are kept, and the missing currency field is stated. AssessProductSupportis shown per product, withunknownas the default and never shown as supported.- The existing mandatory Archera disclosures stay visible. No "insured" or "guaranteed" claim beyond the contract.
- The key does not appear in captured output. Each test greps for the synthetic key.
- Process: each plan gets 2 review passes, and each PR gets a fresh independent reviewer.
Contract questions to settle before planning
- Env prefix: shared unprefixed
ARCHERA_*in CLI and MCP, or the CLI conventionCUDLY_ARCHERA_*? The proposal is unprefixed for all three, so documentation matches across repos. - Platform key:
ARCHERA_API_KEY_SECRET(a secret reference resolved throughinternal/secrets/SECRET_PROVIDER, matching the*_SECRETconvention), plus a plainARCHERA_API_KEYfor local dev only, or not? - MCP default-off: register the tool only when config is complete, or always register it and return "not configured"?
- Platform tenancy: one global Archera org and plan per deployment (MVP), or a per-cloud-account mapping?
- Filters: do consumers pass
ContractTerms,PaymentOptionsandLineItemIDsthrough, or use the documented defaults only? - Permission: is the platform endpoint gated by the existing recommendations read permission, or a new
view:insurance? - Unknown products: is a product outside the documented eligibility rows hidden, or shown as "unknown"? The proposal is to show it as unknown and never hide it.
- Vendor errors: surface 429 Retry-After to the user as is. The client never retries; confirm that consumers also must not add automatic retries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort/xlMulti-week / refactorMulti-week / refactorimpact/fewLimited audienceLimited audiencepriority/p2Backlog-worthyBacklog-worthyseverity/mediumModerate harmModerate harmtriagedItem has been triagedItem has been triagedtype/choreMaintenance / non-user-visibleMaintenance / non-user-visibleurgency/this-sprintWithin the current sprintWithin the current sprint
Activity
cristim commentedon Oct 9, 2026
Follow-up: LeanerCloud/cloud-commitments-go#316 (export the supported contract-terms list).
cristim commentedon Oct 9, 2026
Related: the Archera API key can be printed via fmt %s from an unexported *insurance.Client field: LeanerCloud/cloud-commitments-go#325
chore(deps): bump cloud-commitments-go/pkg to 73d3366 (pkg/insurance) (…
fix(iac): take the short GCP secret ID for Archera, quote required di…
fix(insurance): annotate the setting-name constant for gosec G101
feat(insurance): add default-off Archera settings, lazy client and st…
feat(iac): wire optional Archera comparison settings with single-secr…
cristim commentedon Oct 10, 2026
Gap-review additions (owner: implement all once current tasks are done):
test(insurance): pin every DTO field mapping with a distinct-value go…
test(insurance): add a distinct-value composition test for the compar…
fix(insurance): do not imply a currency in the DTO basis note
feat(insurance): add the Archera comparison DTO with exact decimals (#…
test(insurance): cover Retry-After through the real request path and …
feat(insurance): add the Archera comparison route and error mapping (#…
feat(frontend): explicit Archera comparison section (#801)
cristim commentedon Oct 12, 2026
Status after platform #801 merged (988e545): go#311 closed, platform #785 closed, mcp#48 closed. Remaining: LeanerCloud/cloud-commitments-cli#2156 (CLI comparison command) is still open, so this tracking issue stays open.