feat(audit): add pricing signature guards and reporting
Add snapshot, signature, and drift guard support for Vertex AI, Cloudflare Workers AI, and Perplexity API, backed by a queryable audit table and recent-window view. This commit also wires the audit query layer into daily signal materialization and report generation so structure drift becomes a first-class signal instead of a log-only artifact.
This commit is contained in:
24
scripts/cloudflare_pricing_snapshot_lib.go
Normal file
24
scripts/cloudflare_pricing_snapshot_lib.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build llm_script
|
||||
|
||||
package main
|
||||
|
||||
import "time"
|
||||
|
||||
var cloudflarePricingSignatureContainsNeedles = map[string]string{
|
||||
"llm": "llm",
|
||||
"pricing": "pricing",
|
||||
"cf_model_prefix": "@cf/",
|
||||
"price_tokens": "price in tokens",
|
||||
}
|
||||
|
||||
func buildCloudflarePricingStructureSignature(raw string) markdownPricingStructureSignature {
|
||||
return buildMarkdownPricingStructureSignature(raw, cloudflarePricingSignatureContainsNeedles)
|
||||
}
|
||||
|
||||
func writeCloudflarePricingSnapshotArtifacts(raw string, sourceURL string, snapshotPath string, signaturePath string, now time.Time) (markdownPricingStructureSignature, error) {
|
||||
return writeMarkdownPricingSnapshotArtifacts(raw, sourceURL, snapshotPath, signaturePath, now, cloudflarePricingSignatureContainsNeedles)
|
||||
}
|
||||
|
||||
func resolveCloudflarePricingSnapshotPaths(snapshotPath string, signaturePath string, snapshotDir string, now time.Time) (string, string) {
|
||||
return resolveMarkdownPricingSnapshotPaths(snapshotPath, signaturePath, snapshotDir, "cloudflare-pricing", now)
|
||||
}
|
||||
Reference in New Issue
Block a user