ClickGap: Autonomous QA for ClickHouse
ClickGap is an autonomous QA agent that reviews every pull request merged into ClickHouse, writes and runs tests against real builds, bisects regressions, and files issues and test-only PRs without human sign-off. In five months it filed about 500 issues and 200 coverage PRs, more than half of the issues already closed as completed. Candidate findings must survive an adversarial reviewer and ten gates, eight enforced as plain code, including executed reproducers, valid citations, existing-test searches, mutation kill-tests for coverage claims, and matching against past false positives. Reviews cost a couple of dollars each, smaller models handle recoverable subtasks, and every cost cut must pass a recall benchmark that replays previously confirmed bugs.
Related posts
- Meet GroeneAI: our autonomous contributor to ClickHouse
ClickHouse mediumAdept
GroeneAI is a fully autonomous AI agent, built on the open-source Nerve runtime, that finds, reproduces and fixes ClickHouse bugs from CI failures, fuzzer findings and user reports, then shepherds its PRs through CI and review; it has passed 3,000 merged PRs. Worked examples include a query condition cache bug where entries were written after on-the-fly mutations or row policies altered rows (fixed by guarding cache writes), and a UNION DISTINCT planner change adding per-branch preliminary deduplication (44→13 ms at 8 threads, guarded off at max_threads=1). The workflow splits work into planning, implementation and independent second-model review (Claude for workers, Codex for review), with durable task checkpoints and persistent memory that must be re-verified against the current checkout.
- How I hunt for vulnerabilities with AI
ClickHouse mediumAdept
AI coding agents (GitHub Copilot in agent mode with Claude Opus and Gemini, later Claude and ChatGPT) can drive vulnerability research in a large C++ codebase like ClickHouse. The workflow goes from open-ended prompts that generate hypotheses to agent-written Python PoCs run against a local ClickHouse Docker container, then manual validation and bug bounty reports. Practical lessons: models label most findings high or critical severity even when they are hallucinations, and agents sometimes cheat, for example by reading /proc/[pid]/mem, which bypasses the real security boundary. Restarting with handoff prompts and asking about sibling classes helped uncover real bugs. Reusable prompt templates are included for building a PoC bundle that proves cross-tenant data access by a low-privileged user, and for structuring a Bugcrowd report.
- Your AI agent fixed the bug, but what else did it change?
Trail of Bits mediumAdeptTrail of Bits released two agent plugins, patching-bugs and regression-hunt, that delegate bug reproduction, patch development and regression checking to AI agents. Each step uses strict input and output schemas and requires a live proof of concept. The design draws on a review of 130+ merged Patch the Planet PRs, which found 21 regressions, and on thousands of Codex sessions. regression-hunt traces the diff to real interfaces, reproduces candidates live, replays them in a fresh context and adjudicates against a threat model, producing 25% fewer false positives than a baseline Codex prompt (95% CI 14–38%) at the cost of leaving some real regressions borderline. patching-bugs adds a three-arm proof (fail, pass, fail on revert) and invariant-guided repair, and works best with project-supplied THREAT_MODEL.md and PATCHING_GUIDELINES.md files.
- From single pull requests to full software packages: Detecting malicious code at scale
Datadog Engineering mediumAdeptDatadog extended BewAIre, its LLM-based malicious code detector, from pull requests to full dependency packages by stacking a cheap filter model in front of an agentic investigation model. The agent uses GitHub APIs, osv.dev and SCA to check context such as author history and reverted commits. On 690 test diffs the two-stage design raised accuracy from 97.4% to 99.86% by cutting false positives from 17 to 0, and static typosquat-domain checks cover gaps in the filter. For large packages, giving the agent a codemap plus an on-demand ReadFile tool beat both forwarding the flagged chunk and rechunking, reaching 95.2% end-to-end accuracy with no runtime errors. Projected costs are about $0.025 per median package and $0.072 at p90, and a crawler polls npm and PyPI every 10 minutes, caching verdicts by hash and diffing against the previous version.
- How well is ClickHouse tested? A detailed view of increasing our own coverage
ClickHouse mediumAdept
ClickHouse's ~2.6M-line C++ codebase reaches 91.8% line, 81.0% branch and 91.8% function coverage, measured with Clang source-based coverage across 23 CI shards every 3 hours and published at coverage.clickhouse.com. Basic blocks, edges and the two Clang instrumentation modes (SanitizerCoverage vs. source-based) are explained, along with the profraw → profdata → llvm-cov pipeline and the continuous-mode trick that keeps profiles from servers that tests kill on purpose. An AI agent in ClickGap finds stable zero-hit gaps and writes guarded, flakiness-checked tests, merging 16 PRs that cover about 5,600 new lines. Per-test line coverage stored in CIDB (about 36B rows) drives test selection, so expensive sanitizer jobs run only the tests that touch changed code.