Skip to content

A strategy names the segment, not the algorithm: restore model_realtime_* - #11

Merged
Varfalamei merged 1 commit into
masterfrom
fix/strategy-names-are-segments
Aug 17, 2026
Merged

Varfalamei merged 1 commit into
masterfrom
fix/strategy-names-are-segments

Conversation

@Varfalamei

Copy link
Copy Markdown
Contributor

Why

als_covis_youtravel reported two strategies of its own — als_covis_blend and covis_session — for the same two segments the ALS item-sim paths always served: a hot user scored with their live session, and an unknown visitor scored from theirs.

That was a mistake. A strategy says what was known about the visitor and which signal was used. Which artifact answered, and therefore which algorithm ran, is already carried by model_name right next to it. So the new strings added nothing, while breaking every consumer:

  • dashboards and analytics watching for model_realtime_* went silent
  • a teammate waiting to see his profile warm up could not have seen it — on als_covis those values are unreachable by construction

What

Both ALS artifacts now report model_realtime_hot_users (hot + session) and model_realtime_warm_users (unknown + session). Split A/B readouts on model_name.

MODEL_ALS_COVIS_BLEND and MODEL_COVIS_SESSION stay in the enum, unemitted, because their numeric ids in api/docs/DEBUG_INFO_CODEC.md are append-only — the same treatment MODEL_HOT_AND_COLD_USERS already gets. CLAUDE.md now states the rule, so the next algorithm change doesn't repeat this.

Tests

Reverting the labels costs the tests their discriminator: strategy alone no longer proves the blend ran. So two tests now compare the covis-configured model against the same model without the sub-config on identical input and require the outputs to differ, and the item-sim fallback is pinned by output equality instead of by a distinct label.

101 passed. black and the flake8 gate clean.

Verified against production

Loaded the live dev artifact (als_covis_youtravel, trained 2026-08-13, 214 MB, read straight from the bucket Triton serves):

request strategy
hot user, no session model_hot_users
hot user + session model_realtime_hot_users
unknown + session model_realtime_warm_users
unknown, no session model_cold_users

The paired change in the parent repo restores the same label for the API's flag-gated covis re-route.

…me_*

als_covis_youtravel reported two strategies of its own, als_covis_blend and
covis_session, for the same two segments the ALS item-sim paths always served: a
hot user scored with their live session, and an unknown visitor scored from
theirs. That was a mistake.

A strategy says what was known about the visitor and which signal was used.
Which artifact answered - and therefore which algorithm ran - is already carried
by model_name right next to it, so the new strings added nothing while breaking
everyone: dashboards and analytics watching for model_realtime_* went silent, and
a teammate waiting to see his profile warm up could not have seen it, because on
als_covis those values are unreachable by construction.

Both ALS artifacts now report model_realtime_hot_users and
model_realtime_warm_users; split A/B readouts on model_name. The two values stay
in the enum, unemitted, because their numeric ids in DEBUG_INFO_CODEC.md are
append-only - same treatment as model_hot_and_cold_users. CLAUDE.md states the
rule so the next algorithm change does not repeat this.

Reverting the labels costs the tests their discriminator: strategy alone no
longer proves the blend ran. Two tests now compare the covis-configured model
against the same model without the sub-config on identical input and require the
outputs to differ, and the item-sim fallback is pinned by output equality
instead. 101 passed.

Verified on the production dev artifact (als_covis_youtravel, 13.08): hot ->
model_hot_users, hot+session -> model_realtime_hot_users, unknown+session ->
model_realtime_warm_users, unknown -> model_cold_users.
@Varfalamei
Varfalamei merged commit 6658124 into master Aug 17, 2026
3 of 4 checks passed
@Varfalamei
Varfalamei deleted the fix/strategy-names-are-segments branch August 17, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant