fix: close merged review debt and converge repository truth #23
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 #23"
general
weight: 0.35
Xander-Xai
Why
Multiple merged feature/remediation PRs (#9–#22) left unresolved review debt and two kinds of current-truth drift:
main— e.g. the RAG evaluator's primaryall_queriesdenominator averaged only over survivors; reranker uplift compared raw ranks so every miss↔hit transition was inverted; an unconfigured reranker was treated as healthy; preflight blockedbm25_onlyon an unrelated embedding outage; the streaming provider adapter could never readchoices[0].delta.content; warmup 401 runs reportedPASS; quoted API keys escaped the pre-commit guard.project_facts.pyhardcoded the metric family and population list and read effective config (polluted by a local.env) instead of source fallbacks; the OpenAPI audit failed open; docs carried two lifecycle taxonomies.Evidence direction for this PR: code/evidence → tests → facts → current docs → GitHub metadata. No metric was fabricated; no
v6.4, release, tag, history rewrite or protected-mainchange was made.Review-debt matrix (PR #9–#21)
Legend: LIVE FIXED = the finding still held on current
mainand this PR fixes it; FIXED ELSEWHERE = already fixed by a later merged PR; SUPERSEDED = invalidated by a later refactor/move.| PR | Thread | Sev | Status on main | Disposition |
|---|---|---|---|---|
| #9 | Strip tracking-only query strings | P2 | LIVE | LIVE FIXED —
_clean_urlemits the filtered query || #10 | Revalidate private ERP authz before serving hits | P1 | LIVE | LIVE FIXED — private ERP tools are never served from cache (
authorization_required) || #10 | Reject ERP not-found strings from cache writes | P2 | LIVE | LIVE FIXED —
cacheable_resultrejects未找到…|| #11 | Preserve payload doc_id vs collision guard | P2 | LIVE | LIVE FIXED — explicit
doc_idwins over metadata || #11 | Apply execution deletion filter to dry-run | P2 | LIVE | LIVE FIXED — dry-run uses the same
safe_to_deletefilter || #11 | Bound migration vector processing | P2 | LIVE | LIVE FIXED — compact pass-1 + bounded batch upsert/delete |
| #12 | Update existing L2 tests for fail-closed | P1 | FIXED ELSEWHERE | FIXED ELSEWHERE —
test_cache_embedding_fail_closed.py+ fixtures on main || #12 | Invalidate legacy synthetic-vector entries | P2 | LIVE | LIVE FIXED —
CACHE_PAYLOAD_VERSIONv1→v2 || #13 | Apply request filters to BM25 results | P1 | LIVE | LIVE FIXED — scene/metadata predicate on BM25 candidates |
| #13 | Fail rebuild when a collection cannot be opened | P1 | LIVE | LIVE FIXED — DEGRADED, never publishes READY |
| #14 | Preserve Recall@K and MRR in artifacts | P2 | LIVE | LIVE FIXED |
| #14 | Derive channel outcomes from channel results | P2 | LIVE | LIVE FIXED — marked
NOT_MEASURED(no fabricated attribution) || #14 | Render status from evidence payload | P2 | LIVE | LIVE FIXED —
render_markdownderives from payload || #15 | Index streaming choices before reading delta | P1 | LIVE | LIVE FIXED —
_nestedtraverses list indexes || #15 | Include every billable attempt in cost cap | P1 | LIVE | LIVE FIXED — cases × (warmup+repeat) × max_attempts |
| #15 | Render staging-specific Markdown evidence | P2 | LIVE | LIVE FIXED — same renderer, payload-driven |
| #15 | Mark zero-success runs as failures | P2 | LIVE | LIVE FIXED —
FAILED(PARTIAL reserved for mixed) || #16 | Preserve warmup authentication failures | P1 | LIVE | LIVE FIXED —
BLOCKED_BY_AUTHENTICATION|| #16 | Handle malformed JSON from 200 chat probes | P2 | LIVE | LIVE FIXED —
INVALID_PROVIDER_RESPONSE|| #17 | Restore production-evidence script instructions | P1 | FIXED ELSEWHERE | FIXED ELSEWHERE — ops guide already documents both entry points |
| #17 | Preserve detection of quoted API keys | P1 | LIVE | LIVE FIXED — regex +
check_secrets.pycover quotes/case/whitespace || #18 | Treat OpenAPI construction failures as errors | P2 | LIVE | LIVE FIXED — fail closed (only missing ImportError warns) |
| #18 | Extract fallback facts without local overrides | P2 | LIVE | LIVE FIXED — AST fallback extraction |
| #18 | Match each generated fact to its labeled field | P2 | LIVE | LIVE FIXED — field-to-field capture, no global token search |
| #18 | Apply historical-banner filtering to extras | P2 | SUPERSEDED | LIVE FIXED (guard hardened) — extras now honor the banner |
| #19 | Include failed requests in all-queries denominator | P1 | LIVE | LIVE FIXED — zero-metric rows enter the population |
| #19 | Treat a missing rank as worse than every hit | P1 | LIVE | LIVE FIXED — reciprocal-rank comparison |
| #19 | Block rerank when provider unconfigured | P1 | LIVE | LIVE FIXED —
RERANKER_PROVIDER_UNAVAILABLE|| #19 | Verify document identities before skipping import | P1 | LIVE | LIVE FIXED — logical id + corpus hash audit |
| #19 | Derive blockers from requested experiments | P2 | LIVE | LIVE FIXED — CLI experiments passed into preflight |
| #19 | Import into the configured Qdrant endpoint | P2 | LIVE | LIVE FIXED —
QDRANT_HOST/QDRANT_PORT|| #20 | Derive the metric family instead of hardcoding | P2 | LIVE | LIVE FIXED — shared
scripts/eval_contract.py|| #20 | Validate populations extracted from evaluator | P2 | LIVE | LIVE FIXED — guard iterates derived list |
| #21 | Raise floor to pytest-asyncio 0.23.4 | P1 | FIXED ELSEWHERE | FIXED ELSEWHERE — completed by PR #22 (
requirements-dev.txt+dev-compatlane) |No thread is marked "resolved" without a current-
mainverification.Code fixes
scripts/evaluate_rag.py,scripts/eval_contract.py): end-to-end denominator, reciprocal-rank uplift, unconfigured-reranker blocker, requested-experiment-scoped preflight, contract single-sourcing.scripts/import_eval_corpus.py): identity/hash audit, configured Qdrant endpoint, manifest provenance. Migration (rag/point_id_migration.py): dry-run parity + bounded batches.evaluation/provider_adapter.py,provider_runner.py,runner.py): streaming list traversal, malformed-JSON handling, warmup-auth status, worst-case cost cap, JSON/Markdown parity, channel metrics without fabrication.scripts/project_facts.py,audit_doc_consistency.py,config_fallback.py): derived facts, env-independent fallbacks, field-to-field checks, fail-closed OpenAPI.core/tool_result_compressors.py,core/tool_result_cache.py,agents/base_agent.py,tools/erp_tools.py,cache/cache_policy.py,rag/qdrant_knowledge_base.py,scripts/check_secrets.py,.pre-commit-config.yaml): tracking-URL strip, private-ERP cache boundary, not-found cache rejection, doc_id precedence, BM25 filters, rebuild fail-closed, cache version bump, quoted credentials.Documentation convergence
docs/README.md: one canonical lifecycle taxonomy (per-file lifecycle insidereference/); retired labels are aliases only.changelog.md:## Unreleased(no auto-expiring month range) + entries for this PR; historical sections untouched.Makefile: layered dependency contract (Deployment / CI Lane A / Dev Lane B / historical lock).docs/reference/current-state.md: CURRENT truth no longer bound to a verification date; documents env-independent fallback facts.README.mdarchitecture:/api/chat/multimodalshown as the unified entry,/api/chat/imageas legacy/specialized.production-readiness-checklist.md: explicit evidence-state legend.Evidence boundaries
Verification
Not run / environment-blocked: real provider calls, real Redis, real ERP, real Qdrant corpus import, and
make rag-eval-649(would require provider credentials + a populated index). These are leftNOT_RUN/NOT_VERIFIED, not reported as PASS.GitHub cleanup
mainre-verification and a reply referencing this PR/commit.fix/post-merge-review-debt-and-truth-convergencepushed; onlymainremains protected; no force-push, no history rewrite.Updates #7