Repository navigation
feat(security): distributed threat intelligence valkey l2 cache and radar batching (#122) - #215
Merged
dan-petty merged 4 commits intoSep 16, 2026
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical cache behavior and multiple moderate correctness, configuration, validation, performance, and testing issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds distributed Valkey L2 threat-intelligence caching and batched Cloudflare Radar lookups for security reviews.
Changes:
- Adds caching, TTLs, statistics, and telemetry.
- Integrates batched domain lookups into the review pipeline.
- Adds Valkey client support, tests, configuration defaults, and task documentation.
File summaries
| File | Description |
|---|---|
tests/test_vulnerability_lookup.py |
Updates vulnerability lookup tests. |
tests/test_security_threat_intel.py |
Tests caching, batching, fallback, and metrics. |
src/devops_cli/valkey/client.py |
Adds TTL alias support. |
src/devops_cli/security/vulnerability_lookup.py |
Implements Valkey caching and domain batching. |
src/devops_cli/config/defaults.py |
Adds cache and batch defaults. |
src/devops_cli/config/constants.py |
Adds the cache key prefix. |
src/devops_cli/ai/review/pipeline.py |
Integrates domain and IP threat-intelligence lookups. |
docs/agent/tasks/task-122-distributed-threat-intel-valkey-l2.md |
Documents task objectives and status. |
Review details
Suppressed comments (2)
src/devops_cli/ai/review/pipeline.py:1090
- The new domain/IP partition and review-pipeline integration are not covered by the existing review-pipeline tests (the added tests exercise
CloudflareRadarClientdirectly). A regression in batch result keys, fallback records, or routing domains versus IPs could therefore pass CI. Add a focused pipeline test mocking both clients and asserting domains usecheck_domains_batchwhile IPs use Shodan.
domain_targets = [target for target, rtype in unique_nets if rtype != "ip"]
ip_targets = [target for target, rtype in unique_nets if rtype == "ip"]
if domain_targets:
net_cache.update(_fetch_domains_threat_intel(radar_client, domain_targets))
src/devops_cli/valkey/client.py:220
- The new
exalias is only exercised through a MagicMock intest_security_threat_intel.py; the existing socket tests coverex_seconds, not this path. A regression could omit or misencodeEX 86400while all new tests still pass. Add a protocol-level test forset(..., ex=60)that verifies the emittedSET ... EX 60command.
ex: int | None = None,
) -> bool:
"""Set key to hold string value with optional expiration seconds."""
effective_ttl = ex if ex is not None else (ex_seconds if ex_seconds is not None else ttl)
- Files reviewed: 8/8 changed files
- Comments generated: 8
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…he and batching (#122)
dan-petty
force-pushed
the
feat/122-distributed-threat-intel-valkey-l2
branch
from
September 16, 2026 12:10
29a7da3 to
0753d2c
Compare
dan-petty
added a commit
that referenced
this pull request
Sep 16, 2026
* feat(release): v0.2.18 * fix(security): harden secret sanitizer boundaries and safe path exclusions (#116) (#203) * fix(security): harden secret sanitizer boundaries and safe path exclusions (#116) * fix(release): default release PRs to draft mode * fix(security): harden secret boundaries, remove extension lookahead, and update task status (#116) * fix(security): remediate devsecops findings and add native rate management (#204) * test * fix(security): remediate devsecops findings and add native rate management * docs(task): update task-204 status to in review and link PR #204 * fix(security): permit token masking in filesystem path arguments * fix(security): remediate review findings, exclude home in sandbox, and relocate MockProvider (#205) (#206) * fix(security): remediate review findings, exclude home in sandbox, and relocate MockProvider (#205) * docs(task): update task-205 status to in review and link PR #206 * test(sandbox): provide explicit tmp_path workspace_dir in test_docker_sandbox_wait_timeout * fix(rag): support both gitignore and gitwildmatch pathspec factories * feat(sandbox): multi-tier networking options and decommission task.md (#207) (#208) * feat(sandbox): multi-tier networking options and decommission task.md index (#207) * docs(agent): transition task 207 to in-review with PR #208 * test(projects): update test fixtures to eliminate task.md references * fix(security): replace concrete RFC 1918 and internal homelab endpoints with standard documentation values * fix(sandbox): harden network containment, secret output masking, and rate limiter caching * fix(sandbox): remediate egress containment, dns resolution, and output masking findings (#207) * fix(security): stream sandbox container output directly to sys streams avoiding logger sink cleartext alerts (#207) * docs(agents): mandate working pull requests from oldest to newest (FIFO) * docs(roadmap): add v0.2.23 reactive workstation command center and interactive TUI * docs(agents): mandate root-cause remediation, roadmap synthesis, and interaction improvement * fix(docs): escape placeholder angle brackets and prune completed roadmap matrix items * fix(security): stream sandbox output via centralized output writers to resolve codeql cleartext alerts * fix(k8s): uncap ollama memory limits and elevate daemonset/deployment thresholds (#209) (#210) * fix(k8s): uncap ollama memory limits and elevate daemonset/deployment thresholds (#209) * fix(k8s): add CoreDNS resource configs and tighten test assertions (#209) * fix(github): enforce gh request throttling, disk quota persistence, and diff-only project sync (#211) (#212) * fix(github): enforce window-budgeted rate pacing, disk quota persistence, and diff-only project sync (#211) * docs(agent): record PR #212 in task 211 tracking * fix(github): enforce low-quota circuit breakers, preamble-tolerant JSON parsing, and casing-safe project diffing (#211) * fix(github): replace quota thresholds with logical exponential backoff (#211) * test(github): patch run_gh instead of run_subprocess in reconcile tests (#211) * fix(github): derive rate limit pacing from actual response values without hardcoded windows (#211) * fix(ci): stop running all of the ci tasks every time a pr is marked ready for review. * fix(ci): decouple project automation into dedicated workflow and add quota safety guards (#211) * fix(github): align rate limiter baseline velocity and add quota test coverage (#211) * refactor(ai): eliminate inline function parameter defaults in favor of defaults submodule * fix(github): enforce strict non-negative rate quotas, 25% threshold, and remediate review findings (#211) * fix(typecheck): resolve Path None guard and optional quota remaining in mypy (#211) * docs: refresh CLI and MCP references for updated commands and errors (#211) * fix(ci): enforce mandatory pre-push devops ci gate, handle unauthenticated acquire, and expand test coverage (#211) * fix(pr): align checks fallback to run_subprocess and isolate rate limiter sleep test (#211) * fix(ci): complete pre-push gate, argo drift tests, and coverage expansion (#211) * docs(agent): update task-211 documentation with linear window pacing and pre-push quality gate (#211) * fix(pr): guard pr ready against failing checks and fix project automation uv sync (#211) * docs(pr): update cli and mcp reference for pr ready --force * fix(github): address pr 212 review comments on workflows, sandbox, defaults, and rate limiter (#211) * fix(security): derive artifact version from package metadata and validate whitelist tokens (#211) * feat(security): sigstore cosign container provenance and image signing (#112) (#213) * fix(ci): prune all merged PR devcontainer images from ghcr and guard in-flight builds * feat(security): sigstore cosign container provenance and image signing (#112) * docs(agent): link PR 213 in task 112 tracking doc * fix(security): resolve review comments for cosign container provenance (#112) * ci: re-trigger validation after resolving all review threads * feat(security): falco ebpf runtime security and anomaly streamer (#113) (#214) * feat(security): falco ebpf runtime security and anomaly streamer (#113) * fix(security): resolve review comments for falco ebpf runtime security (#113) * chore: retrigger validation after resolving all review threads * feat(security): distributed threat intelligence valkey l2 cache and radar batching (#122) (#215) * feat(security): distributed threat intelligence valkey l2 cache and radar batching (#122) * fix(security): resolve review comments for threat intel valkey l2 cache and batching (#122) * chore: retrigger validation after resolving all review threads * perf(github): adjust rate limit no-delay used threshold to 30%
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.
Summary
Resolves #122.
Architectural Changes:
CloudflareRadarClientusing key formatvalkey:threat_intel:domain:<target>.DEFAULT_THREAT_INTEL_CACHE_TTL_SECONDS = 86400).check_domains_batch(domains, batch_size=25)inCloudflareRadarClient.devops_cli_threat_intel_lookups_total,threat_intel.lookup.cloudflare_batch).get_cache_stats()trackingrequests,hits,misses, andhit_ratio._fetch_vulnerabilities_and_reputationsindevops_cli.ai.review.pipelineto batch domain targets with_fetch_domains_threat_intelandradar_client.check_domains_batch._fetch_domains_threat_inteland_fetch_ip_threat_intel, maintaining strict nesting depth <= 4 and complexity <= 10.Verification:
tests/test_security_threat_intel.py(7 tests covering L1 cache, L2 cache hits, L2 misses, TTL, offline fallback, batch lookups, and hit ratio metrics).tests/test_vulnerability_lookup.py.tests/test_architectural_invariants.py.uv run devops ci.