Repository navigation
fix: correct AssetDB cost guidance on current months and AI providers - #74
Merged
Merged
Conversation
Agents misread `current` on the monthly cost tables as "the valid row for this month" and filtered on it, so past months came back empty. They also searched service names for "anthropic" instead of filtering by provider, finding nothing, because Anthropic services are model names. Explain both in sql_info.md, document the cost table joins, and mention non-cloud providers in the server instructions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wgrant
marked this pull request as ready for review
October 29, 2026 06:49
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
Re-trigger cubic
…guidance Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UowzEucGd9196yo8RmhMMA
albertodonato
approved these changes
Oct 29, 2026
…ags are empty Every cost table has account, but resource_cost_monthly has no service, so cloud_service.provider can't filter it. AWS's legacy CUR reports no tags on cost rows, and CUR 2.0 prefixes user tag keys with user_, so an agent filtering cost rows' tags on the inventory key finds nothing.
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.
Summary
An agent asked "how much did I spend on Anthropic in 2026-03?" got two things wrong, both because the AssetDB guidance said nothing about them:
currenton the monthly cost tables. The agent filteredcurrent = true, reading it as "the valid row for this month". It actually marks each account's (or resource's) own latest month, so March came back empty and the agent reported $0, though March had cost.anthropic, but Anthropic is a provider (in preview) and its services are model names, so nothing matched.Changes
assetdb/sql_info.md: a new Cost Data section explains howcurrentworks and that rows are never superseded, notes that months can be partial (source_date/last_date), says to filter by the account's provider rather than service name (Anthropic, in preview, is a brief example), documents the cost table joins, and explains how to see whose a resource-level cost is (tags→resource_tags, which for AWS can be empty or haveuser_-prefixed keys) and how it was priced (sku). For Anthropic, it explains which principal a cost belongs to, the tags that identify them, thesku_idformat (e.g. to spot 1M-context use), and that unattributed cost is only at account level.cloud_serviceandcloud_regionare added to Key Tables.NEWS.md: one Fixes entry.Anthropic is in preview and not enabled by default, so it's mentioned only as an example, not promoted in the server instructions or NEWS.
I checked the claims against a live AssetDB (column comments, FKs, per-account
currentrows in earlier months, no duplicate keys, table columns, tag joins, SKU formats) and against the Anthropic cost ingest in the platform repo.Testing
just test: 258 passedjust lint: clean🤖 Generated with Claude Code