Repository navigation
Description
Problem or Motivation
With the defaults (rerank=True, hybrid=True), SearchReranker (src/devops_cli/ai/rag/reranker.py:149) sorts the hits by its own weighted score: 0.5 vector, 0.2 token overlap and fixed bonuses. Retriever._rank_results returns that order when rerank is on (src/devops_cli/ai/rag/retriever.py:421-422), so the RRF order of the hybrid step has no effect.
On the 62-query project eval set of #4961, the weighted score lowers quality:
- nDCG@10: 0.386 (current path, B0) against 0.468 for dense search only (D0). D0 - B0 is +0.082 [+0.006, +0.159], bootstrap p 0.036 (sign-flip p 0.043).
- MRR@10: 0.423 against 0.557 (p 0.011).
- On the 42 natural-language queries, D0 - B0 is +0.113 (p 0.024).
- It also lowers the hybrid pool: B2w (hybrid plus the weighted score) 0.430 against B2f (hybrid only) 0.514.
This is the largest gain of the plan that needs no GPU and no cluster change.
Proposed Solution & Architectural Design
Delete SearchReranker, its rerank flag path and the DEFAULT_RERANKER_* weights (src/devops_cli/config/defaults.py:414-416 and 509-510). The final order is the RRF order of the hybrid step until the cross-encoder stage of #4961 (child 7) comes. Remove the settings that no code reads any more, and update the RAG text in ARCHITECTURE.md and the generated settings reference. No shim (alpha before 1.0.0).
Target Subsystem
src/devops_cli/ai/rag/ (reranker, retriever), src/devops_cli/config/defaults.py, ARCHITECTURE.md.
Existing Tool Considered
This change deletes code and adds none. The eval scorer of #3902 measures the result. Estimated cost: about 0.12M tokens and 2 hours.
Acceptance criteria
git grepfinds noSearchRerankerand noDEFAULT_RERANKER_constant.- On the eval set of test(ai): a gold set measures retrieval of knowledge base facts #3902, the production path has nDCG@10 of at least 0.45, and it is above B0prod (0.393) with p < 0.05 (paired comparison).
- RAG query p95 stays at or below 737 ms in
devops_cli_rag_query_duration_msover 7 days.
Dependencies
#3902 (the eval set and the scorer).
Source: #4961
Alternatives check of 2026-11-27: partly.
Tool: AmenRa/ranx (https://github.com/AmenRa/ranx), MIT, last activity 2025-08-07, not maintained.
Reason: Searches found ranx, an open MIT library that fuses ranked runs (RRF and other combiners) and scores nDCG/MRR with paired significance tests, so it covers the fusion ordering and the eval metric; it cannot delete SearchReranker, its flag, settings or docs, and the hybrid step already does RRF.
Covers:
- Reciprocal rank fusion of vector and lexical ranked runs
- nDCG
@10and MRR@10scoring over a query set - Paired significance tests between two runs
Lacks:
- Removal of SearchReranker, its rerank flag and weight constants
- Order wired into Retriever with no new dependency
- Duplicates the RRF already inside the hybrid step
Proposed design
Problem statement
With the defaults, SearchReranker sorts the RAG hits by its own weighted score. Retriever._rank_results then returns that order, so the RRF order of the hybrid step has no effect. On the 62-query eval set, the weighted score lowers nDCG@10 from 0.468 to 0.386 and MRR@10 from 0.557 to 0.423. The change deletes the weighted reranker and its settings, so the hybrid RRF order becomes the final order until the cross-encoder stage of #4961 comes.
Acceptance criteria
Requirement: Fusion order is the final order
The retriever SHALL return the reciprocal-rank-fusion order of the hybrid step as the final order of the hits.
Scenario: Hybrid query keeps the fused order
- WHEN a test runs a hybrid query with
hybrid=Trueagainst a stub search that returns a fixed hit set - THEN the returned hits follow the fused order and no weighted-score sort changes it
Requirement: No weighted reranker in the source
The module devops_cli.ai.rag.reranker MUST hold no SearchReranker class and the module devops_cli.config.defaults MUST hold no DEFAULT_RANKER_ constant.
Scenario: The reranker names are absent
- WHEN a test imports
devops_cli.ai.rag.rerankeranddevops_cli.config.defaults - THEN neither module has an attribute
SearchRerankeror an attribute whose name starts withDEFAULT_RANKER_
Requirement: Retriever takes no rerank flag
Retriever MUST NOT accept a rerank argument and MUST keep its hybrid argument.
Scenario: Retriever refuses rerank
- WHEN a test builds
Retrieverwithrerank=True - THEN the call raises
TypeErrorand a build withhybrid=Trueand norerankargument succeeds
Requirement: Documentation names no reranker key
ARCHITECTURE.md and the generated settings reference MUST NOT name a reranker setting.
Scenario: The docs check passes
- WHEN
uv run devops ci --check --only docsruns on the change - THEN the check passes and the generated settings reference holds no
DEFAULT_RANKER_key
Existing Tool Considered
The alternatives check of 2026-11-15 in the body of this issue returned none, with no tool. No open, maintained tool or library covers the need, and the check gives its reason and the tool that it considered. RRF already lives in the hybrid step of Retriever, so an outside fusion package would duplicate it. The change deletes code and adds none; the written cost is about 0.12M tokens and 2 hours.
Key questions
- Which order do the hits take when the weighted score goes?: The hits take the reciprocal-rank-fusion order of the hybrid step. The retriever keeps no weighted sort. A cross-encoder rerank waits for child 7 of feat(ai): track embedding and reranking serving for retrieval #4961. (best practice) [sources: src/devops_cli/ai/rag/retriever.py, src/devops_cli/ai/rag/reranker.py:149]
- Chosen: RRF order of the hybrid step. The eval of feat(ai): track embedding and reranking serving for retrieval #4961 shows the weighted score lowers nDCG
@10from 0.468 to 0.386 and MRR@10from 0.557 to 0.423. - Rejected: Keep the weighted score. It is the measured loss: B0 scores 0.386 against 0.468 for dense search only, with p 0.036.
- Rejected: Add a cross-encoder rerank now. It needs a GPU and belongs to child 7 of feat(ai): track embedding and reranking serving for retrieval #4961.
- Chosen: RRF order of the hybrid step. The eval of feat(ai): track embedding and reranking serving for retrieval #4961 shows the weighted score lowers nDCG
- Does the rerank path stay behind a shim?: No. Delet the class, the
rerankparameter and theDEFAULT_RANKER_constants, and keep no shim. The pre-1.0 policy removes a superseded path instead of keeping it behind a flag. (best practice) [sources: docs/adr/0001-github-is-the-roadmap-source.md, docs/adr/0005-review-findings-come-from-tools-not-models.md]- Chosen: Delet the path and its settings. ADR 0001 and ADR 0005 remove a superseded path rather than keep it, before 1.0.0.
- Rejected: Keep a no-op shim. It keeps settings that no code reads and leaves the documentation stale.
- Which code and tests change?:
RetrieverimportsSearchRerankerand builds it, and takes thererankflag. The testtests/ai/rag/test_embedding_model_compatibility.pyuses the class. Remove the import, the construction and the parameter, and update that test. [sources: src/devops_cli/ai/rag/retriever.py, src/devops_cli/ai/rag/reranker.py:149, tests/ai/rag/test_embedding_model_compatibility.py] - Which settings become unused and must go?: The
DEFAULT_RANKER_constants ofsrc/devops_cli/config/defaults.pygo. Each setting that only the class reads goes with them. The generated settings reference changes to match. [sources: src/devops_cli/config/defaults.py] - Which documentation must change?: The RAG text of
ARCHITECTURE.mdand the generated settings reference change. Thedocsrow ofStatic Analysisrefuses a generated document that is not the output of its generator. Runuv run devops ci --check --only docs. [sources: ARCHITECTURE.md, docs/adr/0004-ci-is-the-authoritative-gate.md, CONTEXT.md] - How are the quality gain and the latency verified?: A follow-up issue verifies the quality and the latency. The eval scorer needs the 62-query set of test(ai): a gold set measures retrieval of knowledge base facts #3902, and the p95 needs 7 days of production data. The pull request of this issue cannot check either one. (best practice) [sources: src/devops_cli/telemetry/instruments.py]
- Chosen: Defer the measurement to a follow-up issue. The eval scorer needs test(ai): a gold set measures retrieval of knowledge base facts #3902 and the p95 needs 7 days of production data, so no pull request can check them.
- Rejected: Keep the measurement criteria here. The item then waits on test(ai): a gold set measures retrieval of knowledge base facts #3902 and on 7 days of production data before it can merge.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both items change RAG ranking behaviour, but #1066 keeps the cosine score on model mismatch while this candidate removes the weighted-score reranker entirely.devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: Searches turned up only general reranking/fusion material — the
sentence-transformersCrossEncoder (a cross-encoder reranker) and small hybrid-retrieval demo repositories — none of which provides the change the issue asks for: deleting the in-repoSearchRerankerweighted score and letting the existing RRF order of the hybrid step stand. The issue itself states the change deletes code and adds no dependency, and the cross-encoder stage belongs to a later child of #4961, so no external tool or library covers this need.Tool: none found
Lacks:
SearchRerankerweighted-score path or theDEFAULT_RERANKER_*defaults@10on the eval set of test(ai): a gold set measures retrieval of knowledge base facts #3902, p95 latency) are project-specific measurements that no library providesTools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at 0cdf3e4 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 059df0f (see proposed design in issue body).
Moved to new items: #6287.
devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check:
none, no tool. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources:
fix(ai): rank RAG hits by fusion order instead of weighted score (#4965)
chore(main): release 0.247.0 (#7752)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC