phase: 113_source_chip_quality
Build and Push Containers / build-and-push-app (push) Successful in 2m2s
Build and Push Containers / build-and-push-db (push) Successful in 15s

All gates green — no defects found; this pass was verification only.

**Phase 113 final verification pass — report**

- Verified (no code changes needed): `select_documents_tiered` cited/related tiering + `select_documents` wrapper, `TurnPlan.related_docs`, `ChatDoneEvent.related` (additive, old payloads parse), `appendRelated` UI row (`.related-doc`, never `.source-chip`), done-frame + restore-path wiring, two settings with validators, `.env.example` entries
- `uv run pytest --cov=app --cov-report=term-missing` → 2422 passed, app/ coverage **99%** (>90% gate)
- `uv run pytest tests/e2e/test_source_chip_quality.py -v --no-cov` (isolated) → 2 passed
- Regression E2E `test_retrieval_quality.py` + `test_honest_deflection.py` + `test_chat_rag.py` + `test_sources_midstream_bug.py` → 17 passed
- `uv run ruff check . && uv run pyright` → clean (0 errors); `bash .agents/validate.sh` → "validation OK"

Completion criteria:
1. Single-doc question → exactly one `.source-chip` (E2E): ✅ passed
2. Weak 2nd doc only in de-emphasized related row, never `.source-chip` (unit + E2E): ✅ passed
3. Deflected turn → zero citation chips, weak hits in related row: ✅ passed
4. Full suite green, coverage >90%, isolated E2E green, lint/types clean: ✅ passed
5. `--no-gpg-sign` commit + phase dir move: left to harness per pass rules (task files already in `complete/`)

No deviations. Next pending phase: `114_embed_question_length`.
This commit is contained in:
2026-09-15 03:11:05 -04:00
parent 1374faf136
commit 97d663d16d
31 changed files with 2370 additions and 52 deletions
+15
View File
@@ -98,6 +98,21 @@ def app_server(mock_llm: int) -> Iterator[str]:
# The production default stays 0.62 (re-tuned against the real
# `embed` model's 0.41–0.84 cosine range, PLAN A8).
env["BOR_RELEVANCE_THRESHOLD"] = "0.30"
# Phase 112 (defect fix): the code-default lexical_support_floor (0.35)
# violates the startup validator against the mock-calibrated threshold
# (0.30) and the app under test refused to boot — pin the
# mock-calibrated value (tests/conftest.py pattern). It also pins the
# gate quadrant end-to-end: "Who composed Rhapsody in Blue?" (top
# ~0.124 with FTS hits) deflects while the corroborated-lexical
# kafkabridge question (top ~0.239) grounds.
env["BOR_LEXICAL_SUPPORT_FLOOR"] = "0.15"
# Phase 113: the source usefulness bar (citation slot), mock-calibrated
# (half the threshold, like the lexical floor): a doc earns a citation
# chip only when its best-chunk cosine clears it (e.g. the kafkabridge
# doc at ~0.20 clears; the rhapsody weak hits at ~0.12 or below do not
# and demote to the related tier). The production default stays 0.35
# (app/config.py, LOCKED A2).
env["BOR_SOURCE_USEFULNESS_FLOOR"] = "0.15"
# Phase 67 (LLM retry): the e2e pins the retry MECHANISM with instant
# waits (BOR_LLM_RETRY_DELAY=0 — the 5 s default is unit-pinned via
# tests/unit/test_config.py). BOR_LLM_RETRIES is forced to the code