Harden ClawHub stats sync (SOL-5)#9
Open
VisionaireLabs wants to merge 1 commit into
Open
Conversation
Make the weekly lib/clawhub.ts stats refresh resilient to a flaky source: - Retries: bounded exponential backoff + jitter for network errors, timeouts, 429, and 5xx (was 429-only). 4xx stays non-retryable. - Per-request 15s timeout via AbortController so a hung connection cannot stall the job. - Structured JSON-line logging (ts/level/event/fields) for CI observability. - Graceful last-good fallback: if the source looks unavailable (nothing updated, or >50% of slugs fail), lib/clawhub.ts is left untouched and the run exits non-zero so the weekly job flags the outage instead of committing half-stale numbers. Document the weekly sync task in docs/clawhub-sync.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Hardens the weekly
lib/clawhub.tsstats refresh (scripts/refresh-clawhub-stats.mjs) so a flaky ClawHub source can't stall the job or corrupt the catalog.Changes
429, and5xx(was429-only). Other4xxstay non-retryable.Retry-Afterstill honored.AbortControllerso a hung connection can't stall CI.{ ts, level, event, … });info→stdout,warn/error→stderr. Grep byevent.lib/clawhub.tsis left untouched and the run exits non-zero so the weekly job goes red instead of committing half-stale numbers. CI's "Commit if changed" step is then skipped.docs/clawhub-sync.mddocuments the weekly task, schedule, resilience behavior, manual run, and tuning constants.Scope unchanged: stats-only, membership stays human-gated.
Test
node --checkpasses.node scripts/refresh-clawhub-stats.mjs --dry— fetched all 40 slugs, emitted structured logs, wrote nothing, exit 0.Resolves SOL-5.
🤖 Generated with Claude Code