r/devtools • • Oct 23 '26

Shifu found the coding context we needed, then ranked it out of the answer

I was evaluating a change to how Shifu finds saved work context for a coding task. The candidate improved precision among the records it returned. We still kept the existing version.

The awkward case was a useful record that both versions found. The candidate ranked it below the visible results, so the coding assistant's answer became less useful. Finding the record somewhere in the pipeline wasn't enough.

I'm building Shifu, a personal work-context engine. With MCP and harness instructions, a coding agent can retrieve relevant saved decisions and system context before a change. For that use, a tidy result list matters less than whether the constraint the next task needs actually reaches the answer.

Before the comparison, we set release gates around improved recall of required records, no increase in estimated complete-task cost, and no important answer getting worse. We compared the same questions over one frozen work history and inspected the returned records and final answers.

The candidate improved some precision measures, but recall of the required records stayed unchanged. Estimated cost for the complete task increased, and one held-out answer became less useful. It stayed held; the existing retrieval remained in place.

This was a small study on one work history, with model-assisted judging and source inspection. It doesn't establish how either version performs across other teams. The retrieval plans also differed, so I can't credit or blame one database change for the whole result.

The lesson I'm taking into the next experiment is to track the whole path: did we find the needed record, did it survive ranking, and did the final answer retain the important constraint? An average can hide a loss at any of those steps.

For people building retrieval into coding tools: what would make you reject a candidate even when its precision improves? Do you gate on a particular missed constraint or a downstream answer regression?

I'm Shifu's builder: https://useshifu.com. Sharing the build decision here; no private work records are included.

1 Upvotes

3 comments sorted by

1

u/CreativeSympathy8293 Oct 23 '26

I'd turn the must-retain constraint into a separate pass/fail fixture. For a hypothetical task requiring a backward-compatible API change, dropping that requirement is a failure even if the remaining context looks highly relevant. Write the expected constraint independently of the generated answer.

To diagnose your held-out regression, freeze the candidate pool, prompt, model and context-token budget, then swap only ranking/truncation. Add a control where the required record is guaranteed to reach the final context at the same budget. Check whether the answer still drops the constraint, and repeat both conditions so one lucky generation doesn't decide the result. That helps distinguish a context-selection failure from a generation failure without attributing the mixed pipeline comparison to one database change.

LangSmith's RAG tutorial separates retrieved-document relevance, groundedness and reference-answer correctness: https://docs.langchain.com/langsmith/evaluate-rag-tutorial

Proposed test; I haven't evaluated Shifu. Written with AI assistance.

1

u/Spare_Bat_3040 Oct 23 '26

Thanks, the fixed-pool control is helpful. We changed retrieval plans in the comparison, so I can't attribute the regression to ranking alone. A second case I'd want in the fixture is a constraint that was explicitly superseded: keeping it should fail too. Would you encode the reason a constraint stopped applying in the reference, or score only whether the final answer follows the newer decision?

1

u/CreativeSympathy8293 Oct 23 '26

I'd encode the supersession evidence in the reference, then score behavior and explanation separately.

For each fixture, save the old decision, the replacing decision, their source passages, applicable version/scope, and the task's as-of time. Write the expected treatment explicitly: required, superseded, or unresolved. A later timestamp alone shouldn't be your rule for deciding authority.

Synthetic example: v3 deliberately drops backward compatibility, while v2 maintenance still requires it. Pair the same history with a v2 task and a v3 task. The correct constraint changes with the task; retrieving the old record isn't itself a failure if the answer correctly treats it as superseded.

The behavior check asks whether the final answer follows the applicable decision and avoids enforcing the retired constraint. Score a supported explanation of the change separately when the question requests one. Otherwise, a correct concise answer shouldn't fail for omitting a history lesson. Don't require a model's private reasoning trace.

Proposed fixture/rubric, not a Shifu result. Written with AI assistance.