Repository navigation
fix(gateway): use secure telemetry jitter - #128998
Conversation
Use the canonical bounded secure-random helper so maintenance jitter keeps its existing cadence without tripping temporary-path guardrails.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review Exact head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 12:49 AM ET / 04:49 UTC. ClawSweeper reviewWhat this changesThe PR replaces gateway telemetry jitter based on Merge readinessKeep open: no blocking correctness or security finding; current main still matches the release guard’s Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway startup creates periodic maintenance timers. One timer schedules telemetry update checks using a randomized initial offset and randomized five-to-ten-minute repeat interval. flowchart LR
A[Gateway startup] --> B[Maintenance timer]
B --> C[Secure bounded jitter]
C --> D[Telemetry check schedule]
D --> E[Telemetry update service]
E --> F[Gateway health flow]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +9. Total +9 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the net-neutral scheduler change: use the shared exclusive-upper-bound helper while retaining the existing initial and repeat telemetry cadence. Do we have a high-confidence way to reproduce the issue? Yes: the guard’s source rule deterministically matches the current-main scheduler expression, and the focused fake-timer test exercises both scheduling decisions; this read-only review did not execute it. Is this the best way to solve the issue? Yes: direct use of the shared bounded helper removes the guard-triggering expression without adding scheduler-specific logic or changing either timing range. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b454497dd8d4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Use the canonical bounded secure-random helper so maintenance jitter keeps its existing cadence without tripping temporary-path guardrails.
What Problem This Solves
Resolves a problem where release preparation could reject the gateway telemetry maintenance source because its jitter combined
Date.now()withMath.random(), even though the value was scheduling jitter rather than a temporary-path identifier.Why This Change Was Made
The gateway now uses the canonical
generateSecureInt()helper for both telemetry jitter calculations. Its[0, maxExclusive)contract preserves the existing initial[0, 5m)and repeat[5m, 10m)cadence while satisfying the repository random-ID guardrail. No telemetry behavior, configuration, or temp-path logic changes.User Impact
Maintainers can prepare releases without this false-positive guard failure. Gateway telemetry checks retain the same randomized cadence.
Evidence
cbx_0870260b8ec8, exact source base935c555c98d6b38af76faa6a0b1370353d1828dfnode scripts/run-vitest.mjs src/gateway/server-maintenance.telemetry.test.ts— 2/2 passedpnpm run check:temp-path-guardrails— passedpnpm format:check src/gateway/server-maintenance.ts src/gateway/server-maintenance.telemetry.test.ts— passednode scripts/run-oxlint.mjs src/gateway/server-maintenance.ts src/gateway/server-maintenance.telemetry.test.ts— 0 warnings, 0 errorsgit diff --check— passed308c01645650b3268af2f3a2675e3005db4e71be