Summary
The multi-service CSV writer blanks the per-row NormalizedUnits cell for non-RDS services, but buildTotalRow calls RDSInstanceNUFromType unconditionally. That helper only requires three dot-separated parts before looking up the size suffix, so an ElastiCache type like cache.r7g.large resolves to the large NU value. The TOTAL cell therefore exceeds the sum of the visible cells above it, and an operator reconciling family-NU bundling by hand cannot make the column add up.
Location
cmd/multi_service_csv.go:314 at 3c0f8ac (buildTotalRow)
cmd/multi_service_csv.go:370-373 (formatNormalizedUnitsOrBlank)
providers/aws/recommendations/family_nu.go:61-68 (RDSInstanceNUFromType, map at :23-38)
Failure scenario
A mixed --all-services run includes ElastiCache recs with ResourceType=cache.r7g.large, count 3. Each row's NU cell is blank; the TOTAL row adds 3 x 4 = 12 for them. The TOTAL NU is larger than the sum of the column.
Evidence
for i := range results {
r := results[i]
totalCount += r.Recommendation.Count
totalNU += float64(r.Recommendation.Count) * recommendations.RDSInstanceNUFromType(r.Recommendation.ResourceType)
Suggested fix
Gate the totalNU accumulation on the same Service != ServiceRDS && != ServiceRelationalDB test formatNormalizedUnitsOrBlank uses, ideally by summing the per-row helper's own value.
Found by the 2026-09-02 codebase audit, finding A10-011, reported by one reviewer and independently confirmed by a second. Full report: docs/audits/codebase-audit-2026-09-02.md.
Summary
The multi-service CSV writer blanks the per-row NormalizedUnits cell for non-RDS services, but
buildTotalRowcallsRDSInstanceNUFromTypeunconditionally. That helper only requires three dot-separated parts before looking up the size suffix, so an ElastiCache type likecache.r7g.largeresolves to thelargeNU value. The TOTAL cell therefore exceeds the sum of the visible cells above it, and an operator reconciling family-NU bundling by hand cannot make the column add up.Location
cmd/multi_service_csv.go:314at 3c0f8ac (buildTotalRow)cmd/multi_service_csv.go:370-373(formatNormalizedUnitsOrBlank)providers/aws/recommendations/family_nu.go:61-68(RDSInstanceNUFromType, map at:23-38)Failure scenario
A mixed
--all-servicesrun includes ElastiCache recs withResourceType=cache.r7g.large, count 3. Each row's NU cell is blank; the TOTAL row adds 3 x 4 = 12 for them. The TOTAL NU is larger than the sum of the column.Evidence
Suggested fix
Gate the
totalNUaccumulation on the sameService != ServiceRDS && != ServiceRelationalDBtestformatNormalizedUnitsOrBlankuses, ideally by summing the per-row helper's own value.Found by the 2026-09-02 codebase audit, finding
A10-011, reported by one reviewer and independently confirmed by a second. Full report:docs/audits/codebase-audit-2026-09-02.md.