phase: 118_summary_seed_context
**Phase 118 final verification pass — complete.** All criteria verified; 4 pre-existing defects found and fixed.
- **Verified:** summary-seed wiring (`select_suggested` top-5 no-floor → summary blocks, no full text in HIGH prompt), all-doc markdown summaries + NULL backfill (`summary_backfilled`, no `sources_meta` bump), `read` adds full text with `read_docs`-only dedupe, `done.sources` = suggested+read / durable record = suggested+related+read + `suggested=N` log line (seen live in E2E), byte-locked PERSONA/LOW/TOOLS_SECTION, battery gate PASS recorded in `TOOL_CALLING_TESTING.md` §10 (turbo 2026-09-16: 1/2/4 GREEN, cond-3 reported 9/10 per A7, contract 21/21, caps 0).
- **Defects fixed (all pre-existing, none phase-118):** ① `ChatMessage` schema missing the phase-113 `related` key → `extra="forbid"` 422'd every done-time auto-save of grounded turns with a related tier, leaving `message_count=1` (root cause of `test_share_chat` 3F; browser-level instrumentation proved the PUT 422) — added the field + unit/integration pins; ② `test_theme_semantic_completion` pins stale vs phase-117 debox (border/chip removed) — re-targeted to assert border/chip *absence*; ③ `test_header_consistency` `<26`px pin red on 26.125px native date-input line — bound relaxed to `<34` (wrap-detection intent kept); ④ `test_navbar_refresh` bor.chat.v1 key set updated for `related`.
- **Test/lint/coverage:** `uv run pytest --cov=app --cov-report=term-missing` → **2506 passed, app/ 99%** (>90%); `uv run ruff check . && uv run pyright` → clean, 0 errors.
- **E2E:** new story suite in isolation → **2 passed**; full 103-suite matrix sweep (each isolated) → **all 103 green** after the fixes; `test_share_chat` 4 passed, `test_theme_semantic_completion` 8 passed, `test_header_consistency` 3 passed, `test_navbar_refresh` 7 passed.
- **Deviations:** none from LOCKED decisions. Note: orphaned diagnostic uvicorn processes briefly made E2E sessions exercise stale code — killed and re-verified; a sweep-regenerated tracked screenshot was restored. No commits made (harness commits).
- **Completion criteria:** all 7 ✅ (commit/phase-move is the harness's step).
- **Next pending phase:** none — `todo/` holds only this phase's overview pending the harness move.
This commit is contained in:
@@ -331,7 +331,16 @@ def test_extra_keys_still_forbidden() -> None:
|
||||
def test_minimal_message_still_validates() -> None:
|
||||
"""Optional keys may be ABSENT exactly as pre-phase-83."""
|
||||
msg = ChatMessage.model_validate({"who": "user", "text": "hi"})
|
||||
assert (msg.sources, msg.deflected, msg.suggestions, msg.thinking, msg.tools, msg.stopped) == (
|
||||
assert (
|
||||
msg.sources,
|
||||
msg.related,
|
||||
msg.deflected,
|
||||
msg.suggestions,
|
||||
msg.thinking,
|
||||
msg.tools,
|
||||
msg.stopped,
|
||||
) == (
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
@@ -358,6 +367,7 @@ def test_realistic_bor_chat_v1_payload_round_trips() -> None:
|
||||
"who": "user",
|
||||
"text": "How did I install k3s on the new node?",
|
||||
"sources": None,
|
||||
"related": None,
|
||||
"deflected": None,
|
||||
"suggestions": None,
|
||||
"thinking": None,
|
||||
@@ -371,6 +381,14 @@ def test_realistic_bor_chat_v1_payload_round_trips() -> None:
|
||||
{"source": "Homelab", "path": "kubernetes.md", "title": "Kubernetes Cluster"},
|
||||
{"source": "Deployments", "path": "k3s-install.md", "title": "k3s Install Notes"},
|
||||
],
|
||||
# Phase 113 related-doc tier — an ACCEPTED key (the phase-113
|
||||
# omission of this field made extra="forbid" 422 every
|
||||
# done-time auto-save carrying it, so grounded turns' brain
|
||||
# messages never persisted — the A2 quiet failure swallowed
|
||||
# the 422). Round-trips like sources.
|
||||
"related": [
|
||||
{"source": "Homelab", "path": "traefik.md", "title": "Traefik Notes"}
|
||||
],
|
||||
"deflected": False,
|
||||
"suggestions": None,
|
||||
"thinking": "The kubernetes doc covers the cluster layout…",
|
||||
@@ -398,6 +416,7 @@ def test_realistic_bor_chat_v1_payload_round_trips() -> None:
|
||||
"who": "user",
|
||||
"text": "And what ports does Traefik expose?",
|
||||
"sources": None,
|
||||
"related": None,
|
||||
"deflected": None,
|
||||
"suggestions": None,
|
||||
"thinking": None,
|
||||
@@ -408,6 +427,7 @@ def test_realistic_bor_chat_v1_payload_round_trips() -> None:
|
||||
"who": "brain",
|
||||
"text": "Traefik exposes 80/443 on every node.",
|
||||
"sources": None,
|
||||
"related": None,
|
||||
"deflected": None,
|
||||
"suggestions": ["What is the Traefik dashboard password?"],
|
||||
"thinking": None,
|
||||
@@ -433,6 +453,7 @@ def test_realistic_payload_round_trips_through_update_model() -> None:
|
||||
"who": "brain",
|
||||
"text": "answer",
|
||||
"sources": [_source_ref()],
|
||||
"related": None,
|
||||
"deflected": None,
|
||||
"suggestions": ["follow-up?"],
|
||||
"thinking": "scratchpad",
|
||||
|
||||
Reference in New Issue
Block a user