feat(monitor): budgeted, resumable baseline (--max-scans)#19
Merged
Conversation
ClawHub is rate-limited to ~2 req/s, so a full ~6k-skill registry sweep takes >60 min and can't finish in one CI run — and because the snapshot only commits after scanning everything, every timed-out baseline saved nothing. (Confirmed empirically: five runs, none completed.) Make the baseline resumable: - build_snapshot() gains scan_budget: cap how many skills are actually fetched+scanned per run; the overflow is recorded as UNKNOWN placeholders (metadata only, no error). Because UNKNOWN records aren't 'unchanged', the next run re-scans them — so the baseline builds up over successive runs and then daily incremental only touches what changed. - crawl monitor --max-scans N wires it; snapshot records pending_count. - Workflow passes --max-scans 1500 (~one CI run's worth) so the baseline converges over a few runs instead of timing out. Tests: budget defers overflow, baseline converges over runs, no-budget scans all. Docs updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL
✅ Malwar Scan Results
Scanned by Malwar — malware detection for agentic AI skills. |
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.
Description
Empirically confirmed over five runs: a single-run full baseline can't complete. ClawHub throttles to ~2 req/s, the registry is ~6k skills, so even at 1 request/skill a full sweep needs ~50+ min before LLM escalation — past the CI timeout. And since the snapshot only commits after scanning everything, every timed-out run saved nothing → no baseline ever formed.
Fix — make the baseline resumable instead of all-or-nothing:
build_snapshot(scan_budget=N)caps how many skills are actually fetched + scanned per run. The overflow is recorded asUNKNOWNplaceholders (metadata only, no error). BecauseUNKNOWNrecords don't count as "unchanged", the next run re-scans them — so the baseline builds up over successive runs, then steady-state daily runs only touch what changed.crawl monitor --max-scans Nexposes it; each snapshot recordsscanned_count/reused_count/pending_count.--max-scans 1500(~one CI run's worth at the rate limit), so the full baseline converges over a few runs rather than dying to a timeout.This composes with everything prior: incremental (#16), retries (#17), one-request-per-skill (#18). Net effect: the monitor now reliably makes progress every run and self-heals into a complete baseline.
Type of Change
Checklist
ruff+mypyclean, workflow YAML validateddocs/crawl.md)🤖 Generated with Claude Code
https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL
Generated by Claude Code