Expand description
FOCUS 1.3 Cost and Usage export primitives for Costroid.
As of Milestone 6a, FocusRecord carries the full FOCUS 1.3 Cost and Usage
column set so the official validator’s conditional dependency checks resolve.
Columns Costroid cannot derive from local data are emitted null where the spec
permits; the few that a not-null cascade forces are populated with the
spec-correct categorical value or, for billing-source identifiers with no local
value, a clearly-non-billing placeholder (documented as a deviation).
Numeric columns serialize as genuine numbers in JSON and as decimal-pointed values in CSV (so the validator’s DECIMAL/DOUBLE/FLOAT type checks pass even when every value in a column is whole).
As of Milestone 6b, pricing is represented per token: PricingUnit = "tokens",
PricingQuantity is the token count, and the unit-price columns are per-token
rates (the per-1M catalog rate ÷ 1_000_000). Cost is unchanged — cost = tokens × rate is invariant — only the representation changed. On rows with no priced
SKU (SkuPriceId null), FOCUS 1.3 requires ConsumedQuantity / PricingQuantity
/ PricingUnit / PricingCategory to be null, so they are; the raw token count
still travels on the always-populated x_ConsumedTokens custom column for the
aggregation engine. One genuine validator-ruleset defect remains documented (the
ListCost/ContractedCost = unit-price × quantity check, which the validator
evaluates in zero-tolerance float64 even though Costroid’s decimal arithmetic is
exact); see scripts/focus_known_failures.txt.
Structs§
- Focus
Export Envelope - Focus
Record - A FOCUS 1.3 Cost and Usage charge row.
- Unpriced
Usage
Enums§
Constants§
- BILLING_
ACCOUNT_ ID_ LOCAL - Placeholder
BillingAccountId. FOCUS requiresBillingAccountIdto be non-null, but Costroid is a local estimator with no billing-account identity. This obviously-non-billing sentinel is a documented deviation; Costroid never fabricates realistic-looking account identifiers. - BILLING_
ACCOUNT_ NAME_ LOCAL - Placeholder
BillingAccountName, paired withBILLING_ACCOUNT_ID_LOCAL. - BILLING_
ACCOUNT_ TYPE_ LOCAL - Placeholder
BillingAccountType. FOCUS forces this non-null wheneverBillingAccountIdis non-null; since our account id is itself a placeholder, the type is too (documented deviation). - CHARGE_
CATEGORY_ USAGE - CHARGE_
FREQUENCY_ USAGE_ BASED - DEFAULT_
BILLING_ CURRENCY - FOCUS_
VERSION - PRICING_
CATEGORY_ STANDARD - PRICING_
STATUS_ MISSING_ PRICE - PRICING_
UNIT_ TOKENS - FOCUS
PricingUnit/ConsumedUnitfor per-token AI usage. Singular count unit (no numeric multiplier) so it conforms to the FOCUS UnitFormat. - SERVICE_
CATEGORY_ AI - SERVICE_
SUBCATEGORY_ GENERATIVE_ AI - Valid FOCUS
ServiceSubcategorypaired withServiceCategory = "AI and Machine Learning". Costroid’s three providers are LLM coding tools, so this is the correct classification — not a deviation.