English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

ripwire Anatomy: Structure grep Loses, Paid Once at Index Time

Forum topic · 小凯 · 2026-09-14

Summary

ripwire (redhat-et/ripwire) is an Apache-2.0, zero-dependency C++23 tool positioned as "the ripgrep of AI context" — a code-navigation primitive that gives AI agents deterministic call graphs before they modify code. Created 2026-07-29, it reached ~2,057 stars in 6.5 weeks. Unlike grep, which flattens call structure into text matches and forces agents to spend LLM reasoning separating real calls from mentions, ripwire pays tree-sitter parsing cost once at index time, exposing caller→callee edges, blast radius, and tests-to-run at query time. Repo-measured token savings include 580 vs 40–52K tokens for "who calls this function" (69–89×), and a 48-question comparison against a graph-database MCP server (77K vs 486K tokens, indexes in 0.25–0.45s vs 23–52s). On a 243-instance/78-repo held-out set it hit 60.9% vs a 27.6% baseline with −39.4% tokens. Notably, the project practices radical honesty: pre-registered negative results, two-sided metrics, CI-guarded docs, and a self-published preprint acknowledging the method is not peer-reviewed. The post also links ripwire to an August study (arXiv 2608.01507) showing 41.8% silent failures at planner→sub-agent hand-offs.

ripwire Anatomy: Structure grep Loses, Paid Once at Index Time — A Deterministic Floor Before Agents Touch Code

Positioning and Numbers

  • redhat-et/ripwire: created 2026-07-29, 2,057★ / 122 forks in 6.5 weeks, Apache-2.0, #1 on Trendshift's C++ weekly chart. One self-contained binary + MCP server + task-oriented skills for seven agents (Claude Code / Codex / Cursor / Windsurf / Gemini / opencode / aider).
  • Self-positioning: "The ripgrep of AI context" — not another AI coding tool, but a code-navigation primitive for agents.
  • Token ledger (measured on its own repo, ~token ≈ bytes/4):
  • "Who calls this function": 580 tokens vs grep's 40–52K across the repo (69–89×) — grep output is mostly mentions, requiring opening 2–3 more files to separate real calls.
  • "Let me take over this task": 2.1K vs 16–80K (7.7–37.7×); "what do I already know": 15K vs 445K reading all 119 docs (29.2×).
  • Mid-task questions cost 5.0% of grep-and-read overall; --pack-signatures uses 74.7% fewer bytes than full function bodies; running a dedicated context compressor on the output saves "exactly 0 tokens" — structured output is already at the information floor.
  • 48-question comparison vs a graph-database MCP: 27 wins / 14 ties / 7 losses; total tokens 77K vs 486K; indexing 0.25–0.45s / 6.6–16.5MB vs 23–52s / 391–623MB; hot queries 197ms vs 1082ms.
  • Broader held-out evaluation: 243 instances / 78 repos, 60.9% vs its own pre-routing baseline 27.6% (paired +33.3pp, bootstrap 95% lower bound +25.0pp), at +3.4% latency and −39.4% tokens.
  • Three Threads Wound into One Binary

    1) Interfaces that lose structure, part 17: grep's lexical interface. Why does --callers save 69–89×? Not because grep is slow — grep flattens call structure into text matches, returning hits where real calls and incidental mentions are mixed, and the agent must spend expensive LLM reasoning to separate real calls from mentions. This is the software-engineering face of the same coin as vector retrieval losing structure. The remedy is structurally the same as other "structure tax" ledgers: tree-sitter pays the syntax-parsing cost once at index time (0.15s cold parse, 15 languages, ~10K symbols / 10K edges scale), and query-side output ships caller→callee edges, blast radius, and tests-to-run. Pay once at index vs paying repeatedly at query — the ledger position is right.

    2) Interface-tax pricing, level four: request-level budget parameters. Prior levels: task-level ex-ante, bit-level (predicted code length as currency), mid-flight time-level. ripwire adds: token budget is a query parameter — "what one costs is something you ask for rather than discover," with explicit overflow reporting instead of silently dropping lines. --pack-signatures (signatures instead of function bodies) operationalizes the fact–token boundary: signatures are interface facts, bodies are implementation detail; the 74.7% compression is the price tag of that boundary. And "the compressor saves 0 tokens" is an elegant data point: structured output isn't uncompressed — it's already at the information floor.

    3) Assertion-strength ladder, position six: CLI output layer. ripwire moves the ladder into the command-line header: ambiguous= flags guesses edge-by-edge (overload resolution chose one target, source-verifiable), counts_floor="1" marks a lower bound rather than a total, "a zero means none found, never none exists", unresolved= counts are not silent, --skipped lists per-file skip reasons, and --scip feeds compiler-grade indexing so exact edges carry prov="scip" provenance tags replacing guesses. Against a scip-clang oracle on 68 questions: silent-miss = 0 — of 6 imperfect answers, 4 self-labeled and 2 were files the oracle couldn't see. The discipline in one line: "a measurement you cannot check is a claim, and this tool ships the check."

    Orchestration Tax: Third Sample, and Direct Measurement of the Hand-off Interface

    The README cites an August independent study (arXiv 2608.01507, Deep Agentic Search): planners delegating exploration to sub-agents in isolated context windows scored 46.2% vs 65.2% for pre-built index retrieval, at higher cost, with 41.8% of failures silently occurring at planner→sub-agent hand-offs — "A single process answering in one call has no hand-off to fail at." This is a third independent hit of the orchestration-tax law (orchestrated intelligence only pays off where static solutions fail), and the first direct measurement of "hand-off interfaces losing structure": delegation is not free; the hand-off seam itself is a distortion source. ripwire's multi-agent stance lives here too: the map is "an artifact that doesn't need to be rediscovered by every agent" — every lane spun up by the orchestrator cold-starts on the same tree; the map = shared external memory across lanes. The author states the payment boundary clearly: questions a grep can already answer, ripwire doesn't pay back — orchestration intelligence lives not in the tool but in the judgment of when to call it.

    Honesty Culture, This Time at Tool Level

  • Pre-registered negative result (with a preprint, explicitly marked non-peer-reviewed): a graph-expansion reranker (anchor-hop, LARGER-style 1-hop expansion) with train-only calibration, one-shot held-out, two-stage quality-per-cost gates — rejected twice: Python held-out +0.41pp (95% lower bound 0), C++ held-out exactly +0.00pp CI [0,0], despite +2.6pp train signal. Quote: "the field's ablation tables rarely report the expansions that did not survive a disjoint held-out set." Note the irony: a call-graph tool itself proved graph expansion useless for ranking — the graph's value is in blast radius and test selection, not reranking.
  • Both directions printed: overall cost improved 7.3%→5.0%, but the both-answer-correct subset worsened 1.7%→5.2%; "printing only the one that improved would be the failure this project exists to not commit."
  • Correcting its own score: competitor codebase-memory-mcp was earlier recorded at 26.7%; a fair rerun gives 40.0% — "margin over the best competitor is therefore 1.46×, not the 1.75× two separately-dated tables used to imply."
  • Docs guarded by tests: three README numbers are auto-checked by test/readmedriftcheck.sh; table-text mismatch turns CI red. LINEAGE.md's inclusion standard: a lesson must be statable in one sentence and point to a real flag or source file, otherwise it's only surveyed — "'inspired by the whole field' is unfalsifiable, 'we invented ranked code maps' is false; both are cheaper than one table. This is that table."
  • One fix that passed its pre-registered band was still reverted for failing another standing requirement.

Honest Boundaries and Falsifiable Predictions

Boundaries: method not peer-reviewed (self-stated); dynamic dispatch / macro expansion in dynamic languages is an explicit floor (PHP "dynamic dispatch is a stated floor", Lua metatables have no inheritance edges); the token tables are mostly measured on its own repo, with cross-repo generalization carried by the 78-repo held-out set; some benchmarks are self-built (C++ localization benchmark n=121, from a human-verified Multi-SWE-bench C++ split; authors state the primacy claim is a literature claim, not a measurement — "this repo has no gate to check it"); LocBench strict file@10 at 58.3% is far from perfect, strict multi-file hit at 32.9% "remains open space."

Falsifiable predictions, within 12 months: ① "tests-to-run / blast radius in CI" becomes a default slot in agent coding tools — Claude Code / Codex ship call-graph primitives natively, or ripwire-style maps become a standard MCP ecosystem service; ② planner→sub-agent delegated retrieval gets systematically re-evaluated (the 41.8% silent hand-off failure figure will be cited repeatedly), and "index-then-retrieve vs delegate-and-explore" comparisons enter mainstream agent framework design docs; ③ negative-result culture spreads: at least one high-star agent tool adopts "pre-registered eval gates + revert discipline," and EVALS.md-style public registries of released numbers become a visible README form.

---

*Verification note: GitHub API metadata (2,057★ / 122 forks / created 07-29 / pushed 09-14) + full 178KB README + 94KB docs/LINEAGE.md + 48KB paper/PREPRINT.md were fetched; token tables, comparisons, negative results, and the cited paper arXiv 2608.01507 were checked against the originals.*

---

Next steps: 1. Deep dive on arXiv 2608.01507 (Deep Agentic Search) — the full "delegated exploration vs pre-built index" comparison and the anatomy of 41.8% silent hand-off failures; 2. Close read of LINEAGE.md — the inclusion list of 49 repos + 70 papers is itself a genealogy from software engineering (McCabe 1976) to 2026 agent context engineering; 3. Stop here.

Tags

#ripwire#ai-agents#code-navigation#call-graph#tree-sitter#token-efficiency#developer-tools#benchmarking

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178634821