Skip to content

Experiment: does the self-scan DB help AI agents navigate this repo? (A/B on #4472) #4479

Closed

Description

@squid-protocol

Question

Does GitGalaxy's own self-scan DB (tests/tools/self_scan.py + the self-scan-query skill: file size/complexity, call graph, blast radius) make AI coding agents cheaper or faster on this repo, without hurting the result?

Method (2026-10-05)

  • Task: fact cross-check: engine adapter misses section-COPY-REPLACING records (329 stale ledger entries); update needs --corpus to drop entries #4472 (fact cross-check engine adapter + update --corpus). It needs cross-file navigation through GalaxyIR, the cross-check tool and its adapters.
  • Two identical Claude Sonnet agents, launched together from the same base (663227494, or the fix: train -- #4457, #4458 #4471 train branch if needed), each in its own worktree, with identical briefs except:
    • Arm A: regenerate the self-scan DB in its worktree (~25s) and use self-scan-query first for orientation and impact questions.
    • Arm B: grep and file reads only; the self-scan DB is forbidden.
  • Measured: total tokens, tool calls and duration (from the harness); self-reported grep calls, files read, self-scan queries and test runs; outcome quality (tests, correctness, diff size, review). Each opens a draft PR ([experiment A] / [experiment B]); the better fix merges and the other closes.
  • Caveat: one issue and one run per arm is an anecdote. A large gap is a signal; a small one needs 2–3 more issues before concluding.

Results

Arm A (self-scan DB) Arm B (grep/read only)
Tokens (harness) 75,795 69,568
Tool calls (harness) 26 25
Wall-clock (harness) 5.2 min 4.7 min
Self-scan queries 1 (plus the ~25s regeneration) —
Grep calls / files read (self-reported) 5 / ~6 6 / ~6
Outcome ledger 455 left (328 copy-replacing entries cleared); 14 changed lines in the tool, with a fallback; found the --corpus filter was inverted ledger 455 left; 23 changed lines; picks by record name for multi-COPY members
PR #4481 (kept) #4480 (closed)

Finding (n=1): no saving on this task. Arm A used ~9% more tokens and ~30s more, mostly the DB regeneration and reading its output. Its one query gave a function map of fact_crosscheck.py that pointed it at engine_extras, which it called "marginally helpful". Everything else needed grep and Read. Both arms reached the same ledger result and independently made the same 3-entry pointer-width reassignment, which corroborates it.

Interpretation: #4472 was well-scoped (the issue named the file, function and fields), so the navigation the DB helps with was already done by the issue text. A fairer test is a vaguely-specified, cross-cutting issue ("why does X happen?"), or impact analysis before a refactor. Self-reported wall-clock was unreliable (both said ~25 min; the harness measured ~5), so only harness numbers count.

Recommendation: keep the self-scan step optional, not mandatory, in agent briefs. Use it for unfamiliar or blast-radius questions, not for issues that already name their files. Re-test on 2–3 vaguer issues before deciding further.

🤖 Generated with Claude Code

Activity

  1. added
    metrics
    testing
    priority: low
    on Oct 5, 2026
  2. added
    scope:infra
    needs:corpus
    on Oct 16, 2026
  3. squid-protocol commented on Oct 24, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-10-24T06:31Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  4. squid-protocol commented on Oct 24, 2026

    @squid-protocol
    OwnerAuthor

    Closing: the A/B question is answered across 5 pairs (PR #6395 round 3 and earlier rounds). The self-scan DB does not make agents cheaper or faster (+9, -1.7, -21, +1.8, +14.6% tokens; slower in all five), so it stays optional. Verdict is recorded in docs/agents/self-scan-ab-protocol.md. Sibling gaps found in round 3 (chronometer._scan_git_history omitting untracked files silently, log-only warning) belong to the #138 fix, not this experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claim:melekmetricsneeds:corpuspriority: lowscope:infratesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions