← Back to Pull requests

docs: refresh project documentation #87

Closed
unknown closed this pull request without merging on Oct 08, 2026 10:08 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 08:49 UTC
Author

Summary

Documentation refresh driven by a read-only audit of fed45f0. Three of the five drift sites found are documented rather than fixed in this PR, because fixing them changes runtime behaviour and needs its own test and review cycle. One is fixed, because it is text that describes code that does not exist.

New issues opened by the same audit: #84 (documentation synchronization), #85 (production validation checklist), #86 (evaluation benchmark).

What changed

Added

  • ## 企业场景 — the enterprise scenario: what the business problem is, the three constraints that make this a RAG problem rather than a fine-tuning problem (knowledge changes often, answers must be traceable, visibility is role-scoped), the four user journeys, and why RAG is the right shape.

  • ### 数据流程 — a second Mermaid diagram covering offline knowledge build → epoch-versioned storage → online epoch-scoped retrieval, including the three things that are easy to miss: chunking is deterministic (so epochs are comparable and revertible), logical identity is separated from physical identity, and epoch activation is a human step the scheduler never performs.

  • ## Production Readiness — the condensed table the repo was missing: 已实现 (REPO_VERIFIED + LOCAL_REAL_VALIDATION) versus 未验证 (PENDING / DESIGN_TARGET), with each item's promotion criterion.

  • docs/production-readiness.md — the per-capability authority behind that section. Three columns on purpose: code status, real-environment status, promotion criterion. A row can be verified in code and pending against real infrastructure; that gap is the point of the document.

  • ### 已知未收敛的实现细节 — a new row in the 30-second table so the three known rough edges are visible in the first screen rather than discovered during review.
  • Corrected

  • Weighted RRF runs twice. retrieval/parallel_recall.py fuses with query-aware weights (regulation → BM25 1.5, visual → CLIP 2.0); core/pipeline.py:_merge_and_dedup then re-scores with query-independent w_text / w_clip / w_ocr and reorders, partially cancelling the first. The call site at line 429 says "RRF 已在并行召回管理器中完成" — its comment contradicts its own body. Both the README and the architecture baseline previously implied one fusion. Now stated in both, with the intended convergence direction and a pointer to #84.

  • Microservices: 5 of 6 cannot start. Each of rewrite-service, retrieval-service, generation-service, cache-service, monitoring-service adds only the project root to sys.path and imports siblings by bare top-level name, failing with ModuleNotFoundError under the exact commands in docker-compose.microservices.yml (api-gateway does it correctly). The README previously said "retained components", which reads as present-but-unintegrated; the accurate statement is "not startable as configured". Reproduced, not inferred.

  • bm25_retriever.py docstring described an ES < 8.0 fallback to a precomputed role_bucket field. No such fallback and no such field exist in the repository; _es_version was assigned and never read. Removed. Text only, no behaviour change.
  • Disclosed

  • Fail-closed degradation under absent rerank weights. Without CrossEncoder weights the ensemble falls back deterministically, so ce_top1_score / ce_top3_mean_score are 0, the Evidence Gate maximum is 0.2·agreement + 0.2·doc_consistency ≤ 0.40, which is below low_confidence = 0.55 — so on this repository as committed, every query is rejected. That is a gate degrading by not opening the gate, which is the correct direction, and it is also why the missing assets are PENDING rather than cosmetic. The README previously marked the weights PENDING, which invites the opposite reading. No test asserts this end-to-end consequence and no artifact demonstrates it; both tracked in #85 (VAL-DEGRADE-001), which needs no external environment.

  • Dynamic path selection has no measurable benefit yet. Selection logic is deterministic and tested, but complexity and visual_required are absent from all 301 golden-set entries, so the two features this repository is differentiated by cannot be scored. Tracked in #86.
  • Not changed

  • No Kubernetes work, no load testing, no admin backend.

  • No benchmark number, performance figure, deployment record or customer data was introduced anywhere.

  • No capability was added. HISTORICAL_PRODUCTION, HISTORICAL, REPO_VERIFIED, LOCAL_REAL_VALIDATION, DESIGN_TARGET and PENDING keep their existing meanings.
  • Verification

    python3 -m pytest tests/ -q     2569 passed, 15 skipped
    ruff check .                    All checks passed!
    ruff format --check .           293 files already formatted
    python3 scripts/check_repo_consistency.py   Repository consistency check passed.
    

    Reviewer notes

    Two things worth checking specifically, because they are the substantive claims rather than the formatting:

    1. Is the double-fusion description in §核心工程能力 1 and docs/architecture-baseline.md accurate against the code?
    2. Is the 0.40 / 0.55 Evidence Gate arithmetic in docs/production-readiness.md right? If so, #85 VAL-DEGRADE-001 becomes the highest-value validation in the repository, because it needs no environment and closes the largest interpretation gap.

    Refs #84

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Xander-Xai Review duration: 79m
    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
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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 #87"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%