---
title: "Replaying merged changes: how we test whether a knowledge base makes coding agents better"
description: "Grab built a knowledge base for coding agents that maps how requests move through backend service code, what a change could break, and why the team made its decisions. To measure whether the knowledge base actually helps, they replay merged merge requests: rewind the repository to the commit before the merge, give an agent the same request with the solution stripped out, and use the merged diff as the answer key. Two identical agents plan from the same code, with only one having the knowledge base skill enabled, and an LLM grader scores each plan against the merged diff. The test prevents answer leakage through the knowledge base, request, repository, and grader. On their most tested stack, the knowledge base made plans better on more than half the MRs and nearly tripled the number of plans with full marks."
---

# Replaying merged changes: how we test whether a knowledge base makes coding agents better

[Grab](https://yomu.fyi/company/grab) · Sayam Bohra · Nov 11, 2026

**Type:** Explainer

## Summary

Grab built a knowledge base for coding agents that maps how requests move through backend service code, what a change could break, and why the team made its decisions. To measure whether the knowledge base actually helps, they replay merged merge requests: rewind the repository to the commit before the merge, give an agent the same request with the solution stripped out, and use the merged diff as the answer key. Two identical agents plan from the same code, with only one having the knowledge base skill enabled, and an LLM grader scores each plan against the merged diff. The test prevents answer leakage through the knowledge base, request, repository, and grader. On their most tested stack, the knowledge base made plans better on more than half the MRs and nearly tripled the number of plans with full marks.

## Context

Grab built a knowledge base for coding agents that maps how requests move through backend service code, what a change could break, configuration values, and team decisions. They needed a way to measure whether the knowledge base actually helps agents, since opinions and public benchmarks are insufficient. They found the answer in Git history: every merged MR is a solved problem that can serve as an answer key.

## Approach / What changed

For each backend service, an offline build reads the code and writes structured files that agents load through a skill. The build first does plain code analysis (syntax trees, entry points, imports, configuration keys, call graph) with no LLM, then LLM sub-agents write summaries and flow documents on top of that structure, with a verifier checking each batch. The knowledge base lives in Git; every change is a reviewed diff, and when MRs merge, an update job rebuilds only the touched files and opens a knowledge MR for service owners to approve.

## Takeaways

- Every merged MR is a solved problem that can serve as an answer key: rewind to the pre-merge commit, strip the solution from the request, and grade the agent’s plan against the merged diff.
- Grading plans instead of code avoids penalizing valid alternative implementations and isolates the knowledge base’s effect from the model’s coding ability.
- The knowledge base improved plans on more than half of the tested MRs, nearly tripled the number of plans with full marks, and most helped the weakest plans the most.

## FAQ

### How does the replay test work?

The replay test selects recent merged MRs that changed the service after the knowledge base snapshot, scrubs the request to keep only the need and expected outcome, rewinds the repository to the pre-merge commit, runs two identical agents (one with the knowledge base skill, one without), grades each plan against the merged diff using a fixed rubric, and compares the paired scores.

### Why grade plans instead of code?

The test grades plans, not code, because a plan shows whether the agent understood what to change without the model's coding ability affecting the score. Code has many correct implementations that rarely match line for line, so diffing code would penalize valid alternatives. Plans are also quick to produce, allowing full sweeps to be rerun whenever something changes.

### How does the test prevent answer leakage?

The test prevents answer leakage through four paths: the knowledge base (only MRs merged after the snapshot are replayed), the request (scrubber strips file paths, links, code, and solution descriptions), the repository (agents work at the pre-merge commit and cannot look up the MR or later history), and the grader (each grader sees one plan and the diff, never the other variant).

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Coding Agents](https://yomu.fyi/topic/coding-agents), [Evaluation](https://yomu.fyi/topic/evaluation), [Grab](https://yomu.fyi/topic/grab), [Knowledge Base](https://yomu.fyi/topic/knowledge-base)

- Source: [Grab](https://engineering.grab.com/replaying-merged-changes-knowledge-base-coding-agents-better)
- Source URL: https://engineering.grab.com/replaying-merged-changes-knowledge-base-coding-agents-better
- Ingested by Yomu: 2026-11-23T09:00:14.257Z

[Read original post](https://engineering.grab.com/replaying-merged-changes-knowledge-base-coding-agents-better)
