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
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 ofregistry/{routing,models,domains}.yaml.ledger.Event(inRecord),trust.RunLog(inLogRun), andcost.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)configfield, auto-stamped, omitted gracefully if registry files are unreadablego test -race ./...green