Skip to content

fix: correct AssetDB cost guidance on current months and AI providers - #74

Merged
wgrant merged 4 commits into
mainfrom
docs/assetdb-cost-guidance
Oct 29, 2026
Merged

wgrant merged 4 commits into
mainfrom
docs/assetdb-cost-guidance

Conversation

@wgrant

@wgrant wgrant commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • current on the monthly cost tables. The agent filtered current = 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.
  • Provider filtering. The agent matched service names against 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 how current works 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 have user_-prefixed keys) and how it was priced (sku). For Anthropic, it explains which principal a cost belongs to, the tags that identify them, the sku_id format (e.g. to spot 1M-context use), and that unattributed cost is only at account level. cloud_service and cloud_region are 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 current rows 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 passed
  • just lint: clean

🤖 Generated with Claude Code

wgrant and others added 2 commits October 29, 2026 17:44
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
wgrant marked this pull request as ready for review October 29, 2026 06:49
@wgrant
wgrant requested a review from a team as a code owner October 29, 2026 06:49

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

…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.
@wgrant
wgrant merged commit 2607d33 into main Oct 29, 2026
10 checks passed
@wgrant
wgrant deleted the docs/assetdb-cost-guidance branch October 29, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants