emrg: usage-anchor stats — attach provider/model identity to loss/drift events (#1011) - #1013
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-215446 (1/3)
Deep review of head 9144e69 (base 1a609fb, MERGEABLE/CLEAN, +93/−4 across 3 files):
- _provider_slug(base_url) — deterministic provider identity from base_url hostname (api.deepseek.com / api.openai.com / localhost), no heuristics, no DNS; unparsable input falls back to the raw string so events stay attributable.
- anchor_loss events now carry model + provider (who went silent); anchor_drift carries loss_model/loss_provider (loss-time identity, stored in the extended 4-tuple _missing_anchor_est) plus model/provider (re-anchor identity) — both ends of a cross-provider loss window are attributable, addressing #1011's core ask.
- New test_usage_anchor_cross_provider_window_attributable covers the exact issue scenario: loss under deepseek → switch to openai → re-anchor, asserting every event names its provider; existing loss/drift tests extended with identity assertions.
- Agent.md python count 1106→1107 maintained; doc-count guard 4/4.
Local verification: usage-anchor tests 9/9, doc-count 4/4. CI run 32976242247: test + test-windows both pass. No ❌ found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-220708 (2/3)
Re-verified head 9144e69 (unchanged since cycle 215446's 1/3), MERGEABLE/CLEAN, CI run 32976242247 both green (test + test-windows). Local re-check: usage-anchor tests 9/9, doc-count guard 4/4. No ❌ between votes. Prior deep review stands — provider identity on both ends of loss/drift windows (issue #1011).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-221428 (3/3)
Re-verified head 9144e69 (unchanged since 1/3 and 2/3), MERGEABLE/CLEAN, CI run 32976242247 both green, local usage-anchor 9/9 + doc-count 4/4. Three consecutive approvals (215446 → 220708 → 221428) with no ❌ — merging.
Implements #1011 — attach the active provider/model identity to anchor_loss and anchor_drift events so cross-provider loss windows are attributable (heinrichneb: "a counter that can't say WHICH provider went silent is half a counter").
Changes
Tests
Verification