← Back to Pull requests

docs: normalize PRD truth against the code, keeping the design intent #78

Closed
unknown closed this pull request without merging on Oct 07, 2026 14:43 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 14:16 UTC
Author

PRD.md recorded goals, design proposals and shipped capabilities in one undifferentiated voice, so a reader could not tell which was which. Every number in it is a DESIGN_TARGET, but several sections read as though the system measured those numbers or ran the closed loops that produce them.

PRD.md only. No code, config or evidence level changed.

Classification

Adds four markers — CURRENT, DESIGN_TARGET, HISTORICAL_DESIGN, PENDING_VALIDATION — and a per-section index giving every one of §1–§13 a status and its basis.

The design content is kept: the reasoning is still useful and deleting it would lose the trade-offs. It is now labelled instead of implied.

Factual contradictions corrected against the code

| Where | PRD said | Code says |
|---|---|---|
| §5.2.5 / §9 KV thresholds | 0.7 / 0.8 / 0.9 / 0.95 | THRESHOLD_TRUNCATE=0.80, THRESHOLD_SOFT_STOP=0.90, THRESHOLD_CRITICAL=0.95 |
| §6 BLIP trigger | two signals, <5% rate | max(keyword_rule_score, bert_classifier_score, has_image_hit) — three; module docs say ~15% |
| Audit actions (status table) | 5 | KNOWN_ACTIONS registers 9 |
| Reconciliation table | 3 microservice dirs | 6 tracked |
| §12 metric list | 16 metrics | none have a series anywhere |
| §10.2 Prompt Registry | DB-managed, auto-increment | config value generation.prompt_version + a file directory |
| §4.5 CLIP execution | CPU ONNX + SIMD, ≤80ms, 120ms timeout | no ONNX path; neither constant exists |
| §10.2 epoch | daily-rolling, auto-updated | activation is a manual step |

The §12 metric list is the significant one: L1/L2 hit rates, BLIP trigger rate, Evidence Gate score distribution, NLI contradiction ratio, effective concurrency, max_num_seqs, admission reject/queue counts, degradation counts, prefix-cache hit rate, cache-version switches, rerank batch fill rate and queue latency, and GPU utilisation. Split into the series that genuinely exist and an explicit not implemented list, so an operator does not go looking for them.

Claims weaker than the prose implied

  • §12.2 described a weekly 500-log human annotation loop, a 2000-sample annotated set, Bayesian weekly RRF weight optimisation, ROC-tuned gate thresholds, and a mandatory one-week A/B gate before release. The A/B platform is real and wired into core/pipeline.py, but no experiment is configured and none has run; there is no annotation corpus, no scheduler, no weight-learning code. Every unimplemented item is now marked ★, and the summary item that called the system a "可自学习系统" is corrected to say it is not one.

  • §7.3 described cross-request micro-batching on the online path. batch_predict() is explicitly in-request synchronous; cross-request submit_batch() exists but the main path does not call it.

  • §7.2's Retrieval Agreement Score is real and reaches the Evidence Gate, but it clusters [score, hash(doc_id)] proxy vectors — it measures whether the recall paths agree, not semantic quality.

  • §4.4/§4.5/§6/§7.2 weighted the model as learning RRF weights from click logs and grid search. They are deterministic mappings from config.json.
  • Acceptance criteria

  • Unverified figures are never described as measured results

  • Every P99 is explicitly DESIGN_TARGET

  • Unrun data loops are marked ★, not written as running on a schedule

  • Airflow DAG registration is separated from Airflow actually running

  • The RAGAS harness is separated from a quality result

  • The microservice split is HISTORICAL_DESIGN

  • Historical production scale stays HISTORICAL_PRODUCTION
  • Verification

    check_repo_consistency.py passes · 599 consistency tests pass · ruff clean · 209 local references resolve, 0 broken links or anchors.

    🤖 Generated with opencode

    Diff: 475 lines (+356 / -119) across 5 files Reviewer: Xander-Xai Review duration: 27m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 475 lines diff across 5 files
    0.46
    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.369
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #78"
    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: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    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: 18.1% · Safe to merge
    18.1%