Skip to content

feat(admin): expose selector member set-aside state in pool visibility - #15240

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
maxmad64bis:feat/pool-member-setaside
Oct 2, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
maxmad64bis:feat/pool-member-setaside

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Extends the admin pool visibility route so each pool member also reports per-selector-member set-aside state as memberSetAside: [{ member, avoided, setAside: { kind, since, endsAt, streak } | null }] (proof: src/app/api/admin/proxy-pool-visibility/route.ts +30/−6, toMemberView gains a now parameter frozen once per request and propagated to all four time reads).

The state comes from two new read-only helpers — snapshotMemberSetAside(entryKey, member, nowMs?) reuses readMemberState, the REFUSAL_KINDS loop, the REFUSAL_POLICIES curve and the shared ProxySetAsideSnapshot type, while listEntryMembers(entryKey) enumerates member names from composite memory keys only, never throwing (proof: open-sse/utils/proxyRefusalMemory.ts +60 lines, zero new types).

The read path triggers no probe of any kind: no fetch(, no PUT, no getGroupMembers/switchSelector call — enumeration and snapshots are served from process memory alone, and healthy members report an explicit setAside: null rather than an ambiguous absence (proof: route grep for fetch(, getGroupMembers, switchSelector, includeSecrets: true returns zero hits; zero-probe test extended to ban getGroupMembers).

Related Issues

Follow-up (extension) of #14754, which introduced the entry-level set-aside view in this same route; this PR adds the per-selector-member level underneath it.

Validation

  • Change type: other (admin visibility route)
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Evidence (proxyRefusalMemory.ts +60/−0, route +30/−6, tests +170/−0, no existing test modified): two read-only helpers (member snapshot reusing the shared backoff curve; key-enumeration that never throws), one now frozen per request across all four time reads, five snapshot/listing cases plus one route case (avoided: true with since < endsAt vs avoided: false with setAside: null).

Tests Added Or Updated

  • tests/unit/proxy-pool-visibility.test.ts (+170/−0, separate test cases, finally reset): five snapshot/listing cases plus one route case, covering miss, hit, expiry, multi-kind seq rule, guards, and both route states.

Coverage Notes

  • The change touches open-sse/ and src/: both new helpers are covered by the five snapshot/listing cases, and the route mapping (ISO formatting, explicit null, frozen now) is covered by the route case.
  • No coverage moved down: the route hunk only adds a field plus a frozen timestamp; the existing entry-level assertions are unchanged in the same file.

Reviewer Notes

  • Member order in memberSetAside is memory insertion order and is not stable across restarts or post-purge reinsertion (documented in the helper JSDoc); no sorting applied in this route.
  • Single commit on the current release base (no stack); the changelog fragment is filed as changelog.d/features/15240-selector-member-set-aside-visibility.md.

@maxmad64bis
maxmad64bis force-pushed the feat/pool-member-setaside branch from 2949bc5 to 988a793 Compare September 30, 2026 21:51
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 30, 2026 22:07
@diegosouzapw
diegosouzapw merged commit 2065c1f into cheaper-inference:release/v3.8.52 Oct 2, 2026
24 of 25 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @maxmad64bis — merged into release/v3.8.52; it ships in the next release.

@maxmad64bis
maxmad64bis deleted the feat/pool-member-setaside branch October 2, 2026 18:01
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.

2 participants