Skip to content

feat(subscriptions): warn before the weekly limit, not after (abilityai/trinity-enterprise#434) - #2410

Merged
webmixgamer merged 7 commits into
devfrom
feature/ent434-headroom-alert
Aug 27, 2026
Merged

webmixgamer merged 7 commits into
devfrom
feature/ent434-headroom-alert

Conversation

@webmixgamer

Copy link
Copy Markdown
Contributor

Summary

  • Alerts the operator when a subscription's 7-day window crosses a configurable threshold (default 75%), with a fleet escalation when every subscription is saturated at once.
  • Measuring the provider first deleted most of the specified design. One query against ent#433's history table shows seven_day_resets_at holding constant across five days of probes while utilization climbed 36→90, then stepping exactly +7 days. The weekly window is fixed-with-reset, not rolling — so utilization is monotonic within a window, the specified hysteresis floor is dead code, and resets_at is the window's identity.
  • That makes the alert id the entire state machine — sub-headroom-{sid}-{reset-day}-{tier} — with edge-trigger, cross-worker dedup and re-arm falling out of the sink's existing ON CONFLICT DO NOTHING. No durable memo to leak, race, or clean up on delete_subscription.
  • The threshold fires; the projection ranks. projected_end = utilization_pct / fraction_of_window_elapsed sets urgency from the operator's own burn rate rather than a configured time gap that is wrong for everyone: 75% at day 3 projects to 175% (high), 75% with hours left projects to ~77% (low). The alert is never withheld at the threshold.

Evidence

Live subscription_headroom_history, two windows:

seven_day_resets_at samples utilization
2026-08-25T00:00:00Z 8 over 5 days 36 → 40 → 41 → 45 → 46 → 47 → 90
2026-09-01T00:00:00Z (+7d exactly) 5 17 → 17 → 17 → 18 → 25

Under a rolling window with continuous usage resets_at would have advanced. It did not move for five days.

Three states, because two cannot express "we could not tell"

classify_headroom → saturated | has_headroom | unassessable.

_headroom_indicates_healthy returns False for stale, rejected-token, transport error and a genuinely saturated subscription — so #2396's docstring naming ent#434 as its consumer was wrong: the fleet escalation would have been blocked by exactly the condition it exists to report. Docstring corrected, body untouched — it feeds resolve_rate_limited_now, so a behavioural edit there moves every LIMIT badge (learnings 2026-08-25).

The classifier keys on utilization, not window status: allowed_warning is deliberately non-blocking (#2396), so a status-driven classifier would file a live 90% reading as has_headroom.

Where it runs

Inside the existing #447 sweep — not a second loop, which would mean a second lease over the same probe budget. Per subscription: recover_probe first, then ensure_reading + classify_headroom, in sibling try/except blocks.

Both orderings are load-bearing. _probe_floor_ok bounds probes at 60s/subscription, so whichever consumer probes first floors the other out — this way recovery's zero-age snapshot is reused rather than re-fetched; reversed, recover_probe answers "floored" and #447 quietly stops working. The sibling split is the same argument in the failure direction.

Two false claims corrected on the way

  • The auto-refresh toggle said probing happens "only while a dashboard is open" — untrue since Architecture Validation: 4 critical violations found (2026-04-22) #447, more so now. Label and caption rewritten (no per-day figure, per operator decision; it goes in the release note).
  • The generic settings catch-all now runs validate_ops_setting. 20 ops keys previously accepted "abc" or "-40" verbatim there while /ops/config validated them.

What this deliberately does NOT claim

The fleet alert says what was measured, never "auto-switch has nowhere to go" — select_best_alternative_subscription reads no headroom at all and will relocate agents onto a 99% subscription today. That is a real, separate bug: #2409 (P1), which consumes this classifier.

Changes

File What
services/subscription_headroom_alerts.py new — projection, tier, deterministic id, emitter; no durable state
services/subscription_headroom_service.py classify_headroom (3-state), ensure_reading (one probe decision/sub/cycle), SAMPLE_INTERVAL_SECONDS; #2396 docstring corrected
services/subscription_recovery_service.py sampling + alert evaluation, sibling guards, bounded concurrency, in-cycle lease refresh, re-priced fail-open rationale
routers/subscriptions.py PUT /settings/headroom-alert-threshold; auto-refresh GET carries the honest weekly_alert status
routers/settings.py 422-block the key + validate_ops_setting on the catch-all
canary/snapshot.py, operator_queue_service.py, test_1677_* the three registries a platform emitter must be in
SubscriptionsPanel.vue toggle copy corrected
5 docs + learnings.md (×2) incl. the rolling-window correction

Test Plan

Cost

~24 probes/day/subscription (max_tokens=1 Haiku) — 4× less than a watched instance already spends through the 900s ambient refresh. Interval is a constant, not a knob (#1644); inherits #471's 60s floor and single-flight; stops entirely at threshold_pct = 0.

Residual

create_item has no UPDATE path, so a 75% row still reads 75% at 92% — the same residual retention_guard documents. The escalation is a separate, self-contained item.

Refs abilityai/trinity-enterprise#434

🤖 Generated with Claude Code

…ai/trinity-enterprise#434)

Alerts the operator when a subscription's 7-day window crosses a configurable
threshold (default 75%), plus a fleet escalation when every subscription is
saturated at once.

Measuring the provider first deleted most of the specified design. A query
against ent#433's history table shows `seven_day_resets_at` holding constant
across five days of probes while utilization climbed 36->90, then stepping
exactly +7 days: the weekly window is FIXED-with-reset, not rolling. So
utilization is monotonic within a window, the specified hysteresis floor is
dead code, and `resets_at` IS the window's identity — putting it in the alert
id makes the id the whole state machine (edge-trigger, cross-worker dedup and
re-arm via the sink's existing ON CONFLICT DO NOTHING), with no durable memo to
leak, race, or clean up. `dashboard-grid-view.md` claimed these windows were
rolling; that claim is corrected here.

The threshold fires; the projection ranks. `projected_end = utilization_pct /
fraction_of_window_elapsed` decides urgency from the operator's own burn rate
rather than a configured time gap that is wrong for everyone — 75% at day 3
projects to 175% and is `high`, 75% with hours left projects to ~77% and is
`low`. The alert is never withheld at the threshold.

A new three-state `classify_headroom` (saturated | has_headroom | unassessable),
because the binary pair cannot express "we could not tell".
`_headroom_indicates_healthy` returns False for stale, rejected-token, transport
error AND genuinely saturated, so #2396's docstring naming ent#434 as its
consumer was wrong — the fleet escalation would have been blocked by exactly the
condition it reports. Docstring corrected, body untouched (it feeds
`resolve_rate_limited_now`; a behavioural edit there moves every LIMIT badge).

Runs inside the existing #447 sweep, not a second loop — a second loop means a
second lease over the same probe budget. Recovery probes FIRST so its zero-age
snapshot is reused rather than floored out, in sibling try/excepts so an
alert-path bug cannot stop the only mechanism that clears a stale LIMIT badge.

Two false claims corrected on the way: the auto-refresh toggle no longer says
probing happens "only while a dashboard is open" (untrue since #447), and the
generic settings catch-all now runs `validate_ops_setting` — 20 ops keys
previously accepted "abc" or "-40" verbatim there while `/ops/config` validated
them.

The fleet alert deliberately does NOT claim "auto-switch has nowhere to go":
`select_best_alternative_subscription` reads no headroom at all, so that claim
would be underived. Filed as #2409.

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@webmixgamer
webmixgamer changed the base branch from main to dev August 26, 2026 18:13
@webmixgamer webmixgamer added the ui PR touches the frontend UI — triggers Playwright e2e tests label Aug 26, 2026
@webmixgamer webmixgamer reopened this Aug 26, 2026
@webmixgamer
webmixgamer requested a review from dolho August 26, 2026 18:40
webmixgamer and others added 2 commits August 26, 2026 19:56
… the one real lever

/validate-pr's config-packaging gate (#1056 class) caught both halves of a
contradiction in the previous commit.

`SAMPLE_INTERVAL_SECONDS` documented itself as "a constant, not an operator
knob (#1644)" while reading `SUBSCRIPTION_SAMPLE_INTERVAL_SECONDS` from the
environment — a var neither compose forwards. Since neither compose uses
`env_file`, an unlisted var never reaches the container, so the read was inert
AND contradicted its own comment. That combination is worse than either alone:
it reads as configurable, is not, and invites a later "packaging fix" that
creates exactly the knob the comment argues against. It is now literally a
constant.

`SUBSCRIPTION_SWEEP_CONCURRENCY` is the opposite case — genuinely fleet-size
dependent, with no #1644 argument against it — so it is forwarded in both
composes (prod launches standalone, so dev-only wiring would not carry) and
documented in `.env.example`.

Two tests pin the split. The first asserts on the CODE shape
(`os.getenv("<name>"`), not the bare name: an unanchored match also hits the
comment explaining the bug, which is the
`debt:2026-08-24-source-regex-guard-governs-prose` trap where the previous fix
degraded the prose to satisfy the regex. The guard now also asserts the comment
SURVIVES.

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…trinity-enterprise#434)

/validate-pr's tiered-docs gate: ent#434 is a NEW CAPABILITY, and CLAUDE.md
requires a `docs/memory/requirements/<area>.md` entry for one. The siblings set
the precedent unambiguously — security.md already carries §20.5a (#471, the
reading) and §20.5b (ent#433, the durable history) — so this is §20.5c and not
a new area file.

Records the things that must not be re-derived later: the OSS-core ruling and
who made it, that the 7-day window was MEASURED fixed-with-reset rather than
assumed (and what that deleted from the spec), why assessability needed a third
state instead of the existing binary predicate, why the sample cadence reads no
env var, and the claim the fleet escalation deliberately does not make.

The requirements index maps areas to files rather than sections, and security.md
is already listed, so it needs no row.

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dolho

dolho commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

/review Report — PR #2410

Branch: feature/ent434-headroom-alert → dev (merge-base 775fab41)
Files: 23 (+2004/-46) · Scope: CLEAN (one deliberate adjacent fix, argued in the body)
Plan completion (ent#434 AC): 5 done · 1 partial · 1 not done

Measuring the provider before building the specified state machine is the right call, and the two learnings entries earn their place. The projection-as-urgency design, the id-as-state-machine, the sibling try/except isolating #447, and the three registries are all correct and well argued. One blocking defect below, in the one place the PR's own reasoning says it must not be.


Critical

[C1] The fleet alert can claim "All N registered subscriptions" over a partial denominator (Confidence: 9/10)
services/subscription_recovery_service.py — _evaluate_alerts

classifications = {
    r["sid"]: r["classification"] for r in results if r.get("classification")
}
verdict = alerts.fleet_verdict(classifications)

fleet_verdict is correct in isolation: an UNASSESSABLE member blocks the claim. But the dict it is handed is built only from results that produced a classification, and it is never reconciled against subs. A subscription that was never classified is not UNASSESSABLE — it is absent, and absent members cannot block anything.

Two reachable paths drop a member:

  1. A sampling exception. _sweep_one deliberately swallows it and leaves classification: None — the isolation property your own test_an_alert_bug_does_not_stop_recovery_detection asserts (assert result["classification"] is None). That None is then filtered out by the comprehension above.
  2. Mid-cycle lease yield. The chunk loop breaks on _try_acquire_leadership returning False, so results is shorter than subs, and _evaluate_alerts is still called with the partial list.

Repro (3 subscriptions, s3's sampling raises, s1/s2 at 88%):

SUMMARY: {'probed': 3, 'outcomes': {'not_limited': 3}, 'subscriptions': 3,
          'alerts': {'fleet': True, 'subscriptions': 0}, 'fleet_blocked_reason': None}
EMITTED: sub-headroom-fleet-2026-09-01
  title:    All 2 subscriptions are near their weekly limit
  question: All 2 registered subscriptions are at or past 75% of their weekly limit: one, two.

The instance has three subscriptions. s3 was never assessed and may have full headroom. The operator gets a high item asserting fleet-wide saturation on two-thirds of the evidence — and because the fleet branch returns early, the per-subscription alerts are suppressed too ('subscriptions': 0), so the wrong claim is the only thing emitted.

This is exactly AC #3 ("an unassessable subscription blocks the ALL-saturated claim and is named in the alert instead") and the ent#100 rule the module docstring invokes. The pure function honours it; the wiring does not. Note MIN_FLEET_SIZE = 2 means it needs ≥3 registered subscriptions to bite — real on any multi-subscription instance.

Fix: build the classification map from subs, not from results — a missing or None entry is UNASSESSABLE, not a non-member:

by_result = {r["sid"]: r.get("classification") for r in results}
classifications = {
    s.id: by_result.get(s.id) or alerts.UNASSESSABLE for s in subs
}

That also makes the lease-yield path self-correcting: a partial sweep can no longer produce a positive fleet claim. Worth a learnings.md entry with the fix — the class is "the pure predicate was right and the caller shrank its input", which is a sibling of the 2026-08-25 entry already in the ledger.


Informational

[I1] The toggle copy points at a control that does not exist (Confidence: 9/10)
src/frontend/src/components/settings/SubscriptionsPanel.vue:460

rate-limited subscription recovering, and to watch weekly limits for the alert below.

There is no alert control below. grep finds nothing in src/frontend/ referencing weekly_alert, headroom-alert-threshold, or the threshold at all — the backend computes _weekly_alert_status and no client renders it. Consequences: AC #1's "Settings-surfaced value" is API-only, and AC #4's "reports itself inactive on the Settings surface" (the #2217 lesson the docstring cites) is not delivered — the honest status exists in the payload and reaches nobody. The PR body doesn't claim the UI, but the copy does, which is the same over-claiming class the body quotes from learnings 2026-08-25.

Either ship the threshold + inactive_reason control, or drop "the alert below" and file the UI. It should not merge promising a control it doesn't render.

[I2] TIER_WARN is unreachable for any threshold ≥ 90 (Confidence: 8/10)
escalation_pct returns max(threshold_pct, 90), and decide_tier tests >= escalate_at first. At a legal threshold_pct of 90–99 the two bounds coincide, so every crossing files as crit/high and the warning tier is dead. The derived-single-knob argument is right; this consequence just isn't stated anywhere. A line in the endpoint docstring is enough.

[I3] Two justifications for the same allowlist entry contradict each other (Confidence: 8/10)
tests/unit/test_1677_operator_alert_emitters.py: "no agent input reaches any field". subscription_headroom_alerts._emit docstring: "agent-chosen names do reach the body (an agent may spawn children and name them), but they arrive sanitized". The docstring is the accurate one. The allowlist reason is the living caller inventory, so it should carry the true claim.

[I4] Unguarded int() on a newly-documented env knob, at import time (Confidence: 7/10)
_MAX_CONCURRENT_PROBES = max(1, int(os.getenv("SUBSCRIPTION_SWEEP_CONCURRENCY", "4"))) — module scope, so SUBSCRIPTION_SWEEP_CONCURRENCY=eight raises ValueError during import and takes the backend down rather than degrading. ${VAR:-4} in both composes covers unset and empty, so only a non-numeric value bites — but this is now a knob advertised in .env.example. Same pattern as the pre-existing RECOVERY_PROBE_SECONDS / _DISABLED_POLL_SECONDS in this file, so it is a house pattern rather than something you introduced; flagging it because #1197 is in the ledger for this shape.

[I5] Two blocking calls added to an async endpoint's request path (Confidence: 7/10)
_weekly_alert_status runs db.list_subscriptions() and client.ping() synchronously inside async def get_headroom_auto_refresh_setting. Admin-only and low-traffic, and the endpoint already did one sync settings read, so this is small — but the sweep took care to asyncio.to_thread the same DB call and this path doesn't.

[I6] The status can report active: true on an unreadable subscription list (Confidence: 7/10)
On exception subscription_count = None; None == 0 is False, so it falls through every reason arm and returns active: true, subscription_count: null. Everything else in this function is scrupulous about naming why it is off — this one path claims health from a failure.


Verified clean


Summary

  • Critical: 1 — C1 must be fixed before merge; it emits a false fleet-wide claim in the one scenario the design says it must refuse.
  • Informational: 6 — I1 is user-visible and worth resolving in this PR (either the control or the copy).
  • Scope: clean.

Everything else here is careful work — the measurement that deleted the specified state machine, and the floored-resource learning in particular, are the kind of thing the ledger exists for.

webmixgamer and others added 2 commits August 27, 2026 12:58
…rs (review of #2410)

Addresses dolho's review. C1 is the blocking one and it is real — reproduced
before fixing.

**C1 — the fleet alert could assert saturation over a partial denominator.**
`fleet_verdict` correctly refuses the claim when any member is UNASSESSABLE, but
its caller built the input as `{... for r in results if r.get("classification")}`.
A member whose sampling raised carries `classification: None` BY DESIGN — that
swallow is the isolation property protecting #447 — and a mid-cycle lease yield
`break`s with `results` shorter than `subs`. Either way the blocking member was
not UNASSESSABLE in the map, it was ABSENT, and absent members block nothing.
On a 3-subscription instance that emitted "All 2 registered subscriptions are at
or past 75%", with the per-subscription alerts suppressed by the fleet branch's
early return, so the false claim was the only thing emitted. The map is now
built from `subs`; a missing or None entry is UNASSESSABLE. That also makes the
lease-yield path self-correcting. Three regression tests, including one that
exercises a genuine partial sweep — my first attempt yielded the lease AFTER the
final chunk, which drops nothing and passed against the unfixed code.

The durable class is in learnings.md: a pure predicate can be right while its
caller narrows the domain, and the narrowing looks like ordinary filtering.

**I1 — the Settings control now exists.** The backend shipped with no client
rendering `weekly_alert` at all, which left AC #1's "Settings-surfaced value"
API-only and AC #4's "reports itself inactive ON THE SETTINGS SURFACE" reaching
nobody — the exact #2217 failure this design cites throughout — while the toggle
copy pointed at "the alert below". Threshold input + honest status line in
SubscriptionsPanel.vue over BaseInput/BaseButton/InlineError. Decidable rules
live in utils/headroomAlertSettings.js, not the SFC: vitest runs
`environment: 'node'` with no mount harness, so a rule inside a component is one
no test can reach (ent#392). 21 new frontend tests.

**I2** the tier collapse at threshold >= 90 is now stated and pinned — measured,
not assumed: at 90/95/99 only `crit` is reachable. **I3** the allowlist
justification said "no agent input reaches any field" while the docstring I
narrowed during /review admits agent-chosen names do; the docstring was right.
**I4** `_env_int` degrades to the default with a WARNING instead of raising at
import — the var is now advertised in .env.example, so a human types it (#1197).
Proved with a real container import under a garbage value. **I5** the status
read moved off the event loop, resolved once rather than twice so the toggle and
the alert status cannot disagree. **I6** an unreadable subscription list is its
own `count_unavailable` reason — `None == 0` is False, so it fell through every
arm and reported `active: true`, claiming health from a failure in the one
function whose job is naming why it is off.

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Found by an operator testing the new control on a local instance: clicking Save
showed "Could not save the threshold. Check your connection and try again." The
connection was fine. The backend answered 200 to the identical request via curl.

The real cause was local and harmless — Vite hot-reloaded
`SubscriptionsPanel.vue` but not `stores/subscriptions.js` (no Trinity store
wires `acceptHMRUpdate`), so the new control was calling an action the live
Pinia instance did not have. The call threw a TypeError that never reached the
network, my catch swallowed it, and `e?.response?.data?.detail || <fallback>`
produced a confident diagnosis of something it had not observed. The operator
went looking for a network problem that did not exist.

`describeSaveFailure` now distinguishes what actually happened: the server's own
named reason, else a refusal with its status, else — and ONLY else — a genuine
no-response case, else a client-side failure that names itself and points at a
reload rather than the network.

Writing its tests surfaced a second latent bug in the same one-liner: FastAPI's
422 body is `{detail: [...]}`, an ARRAY, which is truthy — so a real validation
error would have rendered "[object Object]" into the banner. The type check on
`detail` closes that too.

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
webmixgamer and others added 2 commits August 27, 2026 13:41
…#2280)

CI's regression diff caught a genuine one: `test_2280_hosted_compose_parity`
failed on all three head seeds and on none of the base seeds.

`docker-compose.hosted.yml` landed on dev in #2280 while this branch was open —
the pull-only twin of prod, with a guard asserting the two never drift except on
build/image. This branch had already added `SUBSCRIPTION_SWEEP_CONCURRENCY` to
dev and prod, so merging dev in produced exactly the drift that guard exists to
catch. My own packaging check during /validate-pr had verified two compose files
because the third did not exist when I ran it.

Adds the var to the hosted compose and generalises my packaging test from "both
composes" to the three STANDALONE deployment targets, with the exclusions named
and justified: `gitea` and the two `override` files are overlays merged onto the
base (`-f base -f overlay`) so they inherit its environment, `sibling` is the
/verify-local harness, and `prod.enterprise` declares no backend environment
block. Requiring the var in an overlay would be requiring it twice.

A hardcoded list of three has the same rot the original two had, so a second
test asserts no UNCLASSIFIED `docker-compose*.yml` exists — a genuinely new
deployment target now fails loudly and must be classified deliberately rather
than silently escaping the first list. Verified it fires by creating a fourth
file.

Also merges origin/dev (clean, no conflicts), which brings #2395 — the unit
suite's 25→45 minute timeout headroom — so the shard that was cancelled twice on
this PR should now be deterministic.

Full local unit suite after the merge: 12637 passed, 1 failed — `test_1920`,
which reproduces on a clean tree (it scans the private submodule; already a
tracked follow-up).

Refs Abilityai/trinity-enterprise#434

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@dolho dolho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at a19dafe7

Independent pass: I re-derived each finding from the current source and re-ran my original repro rather than reading the commit subjects. C1 is fixed on both trigger paths, all six informational findings are addressed, and the new surface holds up.

C1 — the fleet claim over a partial denominator

Fixed at the right place. classifications is now built from subs — the roster — with a missing or None entry becoming UNASSESSABLE, so fleet_verdict gets the full membership it was always written to expect.

I re-ran the exact repro from my review (3 subscriptions, s3's sampling raises):

{'subscriptions': 3, 'alerts': {'fleet': False, 'subscriptions': 2},
 'fleet_blocked_reason': 'unassessable_members'}
EMITTED: sub-headroom-s1-... | Subscription 'one' passed 75% of its weekly limit
EMITTED: sub-headroom-s2-... | Subscription 'two' passed 75% of its weekly limit

Better than the minimum I asked for: the false fleet claim is gone and the two genuine per-subscription alerts now fire, where before the early return suppressed them and the wrong claim was the only thing emitted.

I also checked the second trigger I named — the mid-cycle lease yield, which I could not exercise in the first review. Forcing the lease to drop after the first chunk:

{'probed': 4, 'subscriptions': 6, 'alerts': {'fleet': False, 'subscriptions': 4},
 'fleet_blocked_reason': 'unassessable_members'}

Four of six swept, fleet claim blocked, the four real ones still alerted. Closed by construction rather than by a second patch, which is the right shape.

The informational six

# Verdict
I1 — copy promised a control that did not exist fixed, properly. A real threshold control, a weekly_alert consumer, a store action, and the decidable parts in utils/headroomAlertSettings.js. "The alert below" is now true.
I2 — TIER_WARN unreachable at threshold ≥ 90 documented, and argued rather than just noted — at 90%+ of a weekly window there is no gentle tier. Fair.
I3 — allowlist reason contradicted the module docstring fixed — it now says agent-chosen names do reach the body but arrive sanitized and capped, and that it is the VOLUME an agent cannot drive. That is the accurate claim.
I4 — unguarded int() at import fixed via _env_int, and the docstring names the exact reason ${VAR:-4} does not cover it (unset and empty, but not eight).
I5 — blocking calls on the event loop fixed — the whole status build moved to asyncio.to_thread.
I6 — active: true on an unreadable subscription list fixed with its own count_unavailable arm, and the comment says exactly why None == 0 let it fall through.

The new surface

describeSaveFailure is a genuinely good addition and not one I asked for: the first version blamed the network for any thrown value, which sent an operator hunting a connection problem when the real cause was a stale store after HMR. Claiming an unobserved cause is worse than being vague, and the fix says so.

The SUBSCRIPTION_SWEEP_CONCURRENCY packaging catch is worth noting too — there are three deployment composes now, not two, because #2280 added the hosted twin while this branch was open. The parity guard caught it, which is the guard doing its job on a file that did not exist when the check was written.

One low finding, not blocking

INACTIVE_COPY has no guard tying it to the backend's reason set. All five reasons are covered today — I checked each one — but the parity test iterates Object.keys(INACTIVE_COPY), which is self-referential: it proves every key renders, not that every backend reason has a key. A sixth reason = "..." added to _weekly_alert_status_blocking would fail nothing.

The blast radius is small because the fallback is honest ('Inactive — this backend did not report a reason.') rather than silent or invented, which is why this is not blocking. If you want it closed, tests/unit/test_2086_model_catalog_parity.py is the in-repo precedent for a Python test validating a checked-in JS mirror.

Verification

118 pass across test_ent434, test_447, test_2396 and test_1677; 26 pass on the new headroomAlertSettings spec.

Verdict

Approving. The measurement that deleted the specified state machine was the right instinct in the first place, and the follow-up work fixed the one defect that mattered at its source rather than at the symptom.

@webmixgamer
webmixgamer merged commit 908f871 into dev Aug 27, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants