Skip to content

feat(config): deployment-identity breadcrumb stamped into ledger/trust/cost logs #162

Description

@ankit373

Problem

Ledger, trust, and cost jsonl logs can't be tied back to which registry config (routing.yaml/models.yaml/domains.yaml) was in effect when they were written. If routing.yaml changes, or logs are compared across machines, there's no way to tell which rules produced a given entry. Borrowed from CoSAI/rabbidave's "System Breadcrumb" pattern (a SHA256 fingerprint of the deployment's declared config, used as an immutable anchor for logs) — minus their shared-secret/auth use, which doesn't apply here.

Solution

  • config.Breadcrumb() (string, error) — SHA256 hex over the concatenated bytes of registry/{routing,models,domains}.yaml.
  • Stamp it (best-effort, non-fatal on error) into: ledger.Event (in Record), trust.RunLog (in LogRun), and cost.Row/the two ad-hoc cost.jsonl writers (internal/dispatch/dispatch.go:logDispatch, internal/swarm/cost.go:logAttempts).

Acceptance Criteria

  • config.Breadcrumb() implemented + tested (deterministic, changes when any of the 3 registry files change)
  • Ledger/trust/cost entries carry a config field, auto-stamped, omitted gracefully if registry files are unreadable
  • go test -race ./... green

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions