railyard/tools/reconcile-relay-rago/systemd/reconcile-relay-rago.timer
caelum0x ee5070acb8 feat(railyard): nightly Relay and Rago shadow-metering reconciliation (RY-RG1)
tools/reconcile-relay-rago compares relay_cost_events with Rago relay_llm_usage
events for one UTC day, event by event: missing (dropped), dead-letter, amount
mismatch, duplicate across orgs, orphan and overdue pending. Drift over 0.5%,
any dead-letter or any duplicate pages the railyard ntfy topic; smaller findings
are reported at default priority. ry_rago_drift_ratio and per-key and per-org
figures go to VictoriaMetrics; a JSON report is kept per day. Both databases are
read in READ ONLY transactions, so no charge of record changes.

Includes systemd service and timer (04:20 UTC), installer, env sample, the
emitter flip checklist per lane, and 12 offline tests (fake psql, local ntfy and
VictoriaMetrics).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:09:50 +03:00

12 lines
243 B
SYSTEMD

[Unit]
Description=Nightly Relay and Rago reconciliation (RY-RG1)
[Timer]
# After the restic backup (03:30 UTC), inside the night window.
OnCalendar=*-*-* 04:20:00 UTC
RandomizedDelaySec=5min
Persistent=true
[Install]
WantedBy=timers.target