← ERP rendszer építők adatlapja
Nézd meg, miben segít
Használatmérés ellenőrzése
Összegmegmaradást, pontos felhalmozást, duplikációkezelést és történeti árakat tesztel a használatelszámolásban.
metering-verification
Ezt a skillt használó csapattagok
Mikor hasznos?
Akkor használd, ha mért költség vagy kvóta határozza meg az ügyfél egyenlegét.
Miben segít neked?
- Ellenőrzi, hogy a részletezések összege egyezzen a naplóval.
- Vizsgálja, hogy ismételt és pontosított esemény ne számolódjon kétszer.
- Teszteli az árhatárokat és szolgáltatóspecifikus mennyiségeket.
Például ezt kérheted
Ellenőrizd az apró tokendíjakat, dupla streameseményeket és becsléspontosítást történeti újraárazás nélkül. Az új árat csak későbbi használatra alkalmazd, majd egyeztesd a jelentést. A régi elszámolás maradjon változatlan, az ismételt bizonyíték ne jelentsen új díjat.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
Metering Verification
A metering bug silently corrupts financial visibility, unit economics, or customer quota enforcement. Every metering pipeline, price calculator, and attribution query must be verified with deterministic tests covering edge cases and failure modes.
Workflow
- Verify accounting invariants and conservation laws:
- Assert that the sum of drill-down slices across any dimension (
SUM(cost) GROUP BY tenant_id,GROUP BY agent_role,GROUP BY model) equals the grand total ledger cost (100%conservation, zero dropped or duplicated rows from join fan-out). - Assert sub-cent precision: verify that 100,000 micro-events of
10cached tokens each accumulate to the exact expected microdollar total with zero floating-point drift.
- Assert that the sum of drill-down slices across any dimension (
- Test deduplication and out-of-order ingestion:
- Replay the exact same usage event payload 5 times (and under concurrent workers) and assert that ledger count and total quantity increase only once.
- Test upgrade transitions: ingesting an
'estimated'event followed by a'provider_reported'event with the sameidempotencyKeymust supersede or adjust the estimate without double-counting.
- Test rate card boundaries and version transitions:
- Test events with
occurredAt1 ms beforeeffectiveFrom, ateffectiveFrom, and 1 ms aftereffectiveTo. - Verify that inserting a new price version does not alter the computed cost of historical events unless an explicit repricing command is run.
- Test events with
- Test provider-specific LLM usage normalization:
- Include fixtures for OpenAI (
cached_tokensinsideprompt_tokens,reasoning_tokensinsidecompletion_tokens), Anthropic (input_tokensdisjoint fromcache_creation_input_tokensandcache_read_input_tokens), and Gemini (cachedContentTokenCountinsidepromptTokenCount,thoughtsTokenCount). - Verify that normalized billable buckets never double-charge cached or reasoning tokens.
- Include fixtures for OpenAI (
- Test failure, timeout, and reservation lifecycle:
- Verify that failed upstream calls that consumed tokens still emit usage events.
- Verify that pre-execution budget reservations (
reserve -> settle -> releaseorexpire) never leak locked quota under concurrency.
Verification Checklist
- Idempotent replay of identical events produces zero duplicate ledger entries.
- Sub-cent microdollar / nanodollar arithmetic matches exact reference calculations.
- Provider token fixtures (OpenAI, Anthropic, Gemini) normalize without double-counting.
- Historical queries use
occurredAtrate versions and remain invariant when today's prices change. - Sum of tenant + system buckets equals total ingested cost with no join fan-out.
Csomagban lévő fájlok 1
SKILL.md
