fix: single weighted-RRF fusion entry, one spelling for the rewrite path, README restructured #88
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #88"
general
weight: 0.35
Xander-Xai
Summary
Closes the two code items in #84 (items 2 and 3), plus the two review findings from #87 that were substantive rather than cosmetic. No capability is added and no benchmark number is introduced.
The theme is that "weighted RRF runs once, with query-aware weights" should be a property the code and the tests both prove, instead of a sentence in a README that the code contradicted.
1 · One fusion entry (#84 item 3)
retrieval/parallel_recall.pyfuses with the query-aware per-path weights produced bycore/pipeline.py::_build_rrf_weights(regulation → BM25 1.5, visual → CLIP 2.0). Downstream of it,_merge_and_dedupre-scored the already-fused list with a second weighting pass overw_text/w_clip/w_ocr. That pass is removed;_union_dedupreplaces it and only collapses duplicatedoc_ids — the duplicates ES Fallback appends after fusion — preserving order, scores and object identity.What the removed pass actually did, verified before changing anything
rrf_fusion()already returns unique documents,RecallResulthas noembedding_type, so every result took the samew_textmultiplier; the rank term came from insertion order, which made the score monotonically decreasing, so sorting descending preserved the incoming order exactly. Reconstructed and run against a fused-plus-fallback list: the output order was identical to the input.The pass was therefore order-preserving, not relevance-changing. #87 described it as cancelling the first pass's weighting; that was overstated, and the CHANGELOG entry here says so plainly rather than inheriting the claim. The real defect was a ~48-line pass whose docstring and call-site comment claimed query-aware fusion it never applied, sitting directly downstream of the fusion that does apply it — and any future change that made it non-uniform would have silently reordered a fused list. That is the fragility worth removing.
2 · One spelling for the rewrite recall path (#84 item 2)
The path was
rewrite_variants(plural) in theconfig.jsontopology key and inqdrant_paths, andrewrite_variant(singular) in thepath_resultskey, the_build_rrf_weightsweight key and theRecallResult.sourcevalue.The mismatch was silent: the weight still resolved, because both singular sites agreed with each other. But
qdrant_pathsnever matched the registered key, so a Qdrant failure on the rewrite path could not raise its warning — a permanently unreachable diagnostic. Now one spelling, matching the config topology, everywhere including docs and the exceptions comment.3 · Regression contracts
tests/test_architecture_contract.pygains seven tests, each of which fails on the pre-change tree:_union_deduppreserves relative order, scores and object identity — the structural guard against a second scoring pass returning._union_dedupkeeps the fused copy over a later duplicate.rrf_fusionis called exactly once per recall request, with the weights the pipeline built, and the post-fusion step leaves the result untouched.core/pipeline.pycontains norrf_scoreand no_merge_and_dedup.path_resultskeys and the weight keys are the same set.Verified by reverting each fix in isolation: the naming test and the diagnostic test both fail against the singular spelling.
4 · README restructured
Five sections a reader arrives with: Problem (why this domain needs RAG), Architecture (offline build and online Q&A, split explicitly), Retrieval Pipeline (the seven online stages, the recall-path table, the single fusion entry with the formula, a design-trade-off table and the four hallucination gates), Evaluation, Production Readiness.
The trade-off table is the part worth reading: why retrieval over fine-tuning, why hybrid over either single retriever, why rank fusion over score normalization, why two rerank stages, why dynamic rather than fixed recall, why refusal, why layered filtering. Each row carries the cost and the rejected alternative, so the choice is auditable rather than asserted.
5 · Evaluation: framework ready, execution pending
The section states the split explicitly and then explains why retrieval metrics are currently not attributable, which is the part that was missing:
doc_id/chunk_id/source_id, so relevance falls back to Level-2 normalized exact text. A re-chunk, an OCR variation or a merged passage silently zeroes a match — the measured recall would then reflect the build pipeline's incidental choices rather than retrieval quality.complexityandvisual_requiredare 0/301, so the dynamic-2–4-path and visual breakdowns cannot be produced at all (#86).doc_idandchunk_id.Measured field coverage,
business_type/difficultydistributions and the 262-distinct-passage figure were recomputed from the committed dataset, not copied. No metric value appears anywhere.6 · Two evidence corrections from review on #87
Both were raised by the review bot and were correct:
LOCAL_REAL_VALIDATION. The five local validations cover individual mechanisms (Redis session, Redis rate limit, nginx client IP, authenticated ES 8.11, authenticated Prometheus scrape); none is a full-stack run of/api/query, and in that run Qdrant was not exercised and the model stack was blocked. NowREPO_VERIFIED/PENDINGwith what would close it.sys.pathaddition per service.retrieval-serviceandgeneration-servicealso importmonitoring_service.metrics_collector, and nomonitoring_servicepackage exists — only theretrieval_servicesymlink. Both keep failing after that change. The remedy now states the package has to be normalised too.7 · Production Validation Checklist
A new subsection under Production Readiness lists every gate between "architecture demo" and "may take real traffic", each linked to its
VAL-*entry, all marked not executed. Backed by five entries added todocs/deferred-runtime-validation.md, which previously named these only in prose: real Qdrant (VAL-STORE-001), fail-closed degradation with no rerank weights (VAL-DEGRADE-001— deterministic, needs no environment, highest value in the repository), whether the second rerank stage helps at all (VAL-RERANK-001, including when the answer is negative), production infrastructure topology (VAL-TOPO-001) and sustained alert evaluation (VAL-ALERT-001).Not changed
retrieval_servicesymlink untouched.Verification
Reviewer notes
1. Is the corrected characterisation of the removed fusion pass right? That it was order-preserving, and the defect was a misleading pass rather than a wrong ranking — the reconstruction is in the commit message and the CHANGELOG.
2. Do the design-trade-off rows in the new Retrieval Pipeline section match the code, or does any of them claim a benefit this repository cannot support?
Refs #84. Follow-up to #87 (whose wording for items 2 and 3 this supersedes).