Skip to content

Quota probes run only in the orchestrator process, so a pool whose credential lives on an executor cannot be metered - #487

Merged
AdamFrisby merged 3 commits into
mainfrom
codeybox/874bab35
Sep 14, 2026
Merged

AdamFrisby merged 3 commits into
mainfrom
codeybox/874bab35

Conversation

@AdamFrisby

Copy link
Copy Markdown
Owner

Automated via CodeyBox — work item 874bab35bbf6414fb9ef119507f6c69f

Initiated by CodeyBox operator


Co-Authored-By: CodeyBox noreply@codeybox.invalid
🤖 Generated with CodeyBox

AdamFrisby and others added 3 commits September 14, 2026 16:24
Per-pool probe location: OrchestratorDirect (default, probes in-process
as today) or ExecutorReported (executor holding the credential probes
locally and reports readings via POST /executors/{hostId}/quota-reports).
Reports carry pool, availability, reset, and observed time; the store
validates on arrival (holder allowlist exact match, ranges, reset-vs-kind,
clock skew) and rejects without mutating. Stale or missing reports read
as Transient unknown with standard unknown handling and fail-closed on a
non-zero floor; fresh explicit unknowns preserve their reason. The gate
stays orchestrator-side in both modes.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
- ReportQuotaAsync now requires a live worker-registry registration for the
  claimed host (404 otherwise); HolderHostIds remains the second check.
- ValidateReading bounds resetting-window ResetAt to (ObservedAt-skew,
  now+maxRampHorizon+skew]; far-future/long-past resets rejected unstored.
- Notes reject control characters; GetSnapshot null-safe on AvailablePct
  across pool-kind hot-reload; deduped snapshot/validation helpers.
- Response echoes stored normalized pool name; config doc matches mapper
  (zero=default, negatives rejected). Adds 5 regression tests.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
ReportQuotaAsync accepted any valid bearer asserting any host id, so one
executor (or any API key holder) could forge another pool's meter: the
registry existence check and HolderHostIds allowlist both keyed off the
self-asserted path host. ApiClients entries now accept an optional
ExecutorHostId binding; quota-report ingress rejects unbound tokens
(including the shared operator key) and mismatched hosts with 403 before
consulting the registry, keeping HolderHostIds as the second check.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
@AdamFrisby
AdamFrisby merged commit a322867 into main Sep 14, 2026
@AdamFrisby
AdamFrisby deleted the codeybox/874bab35 branch September 14, 2026 17:31
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