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:
@@ -16,8 +16,8 @@ fixture of phase 56 stays pinned by its own suite):
|
||||
* positive — ``md,dockerfile,containerfile`` walks ``Dockerfile``,
|
||||
``Containerfile`` and ``notes.md`` (the ``Makefile`` negative control
|
||||
stays out): rows + embedded chunks + the deterministic mock
|
||||
``SUMMARY_MODE`` digest for both build files (non-markdown → the
|
||||
phase-30 ``lite`` path), ``formats == {"dockerfile": 1,
|
||||
``SUMMARY_MODE`` digest for EVERY doc (phase 118, A2: markdown
|
||||
included — the phase-30 ``lite`` path), ``formats == {"dockerfile": 1,
|
||||
"containerfile": 1, "md": 1}`` with NO ``unknown`` key;
|
||||
* case — an on-disk ``DOCKERFILE`` imports under the ``dockerfile``
|
||||
token, its row keeps the on-disk case;
|
||||
@@ -146,9 +146,9 @@ def test_name_token_files_import_end_to_end(mock_llm_port: int, db: Session) ->
|
||||
# D2: extensionless files count under their matched token.
|
||||
assert summary.formats == {"dockerfile": 1, "containerfile": 1, "md": 1}
|
||||
assert "unknown" not in summary.formats
|
||||
# Phase 30: both build files are non-markdown → lite summaries;
|
||||
# the markdown control never is.
|
||||
assert (summary.summaries, summary.summary_errors) == (2, 0)
|
||||
# Phase 118 (A2): EVERY doc gets a lite summary — both build
|
||||
# files AND the markdown control.
|
||||
assert (summary.summaries, summary.summary_errors) == (3, 0)
|
||||
|
||||
for rel, sentinel, tokens in (
|
||||
(DOCKER_REL, DOCKER_SENTINEL, DOCKER_SENTINEL_TOKENS),
|
||||
@@ -179,13 +179,18 @@ def test_name_token_files_import_end_to_end(mock_llm_port: int, db: Session) ->
|
||||
assert len(schunks) == 1 and schunks[0].position == -1
|
||||
assert schunks[0].embedding is not None
|
||||
|
||||
# The markdown control doc imported too — but markdown never
|
||||
# gets a summary (phase 30).
|
||||
# The markdown control doc imported too — AND got the mock
|
||||
# ``SUMMARY_MODE`` digest (phase 118, A2: markdown summarized).
|
||||
note = db.scalar(
|
||||
select(Document).where(Document.source == SOURCE, Document.path == NOTES_REL)
|
||||
)
|
||||
assert note is not None
|
||||
assert note.summary is None
|
||||
assert note.summary is not None
|
||||
assert note.summary.startswith("This document covers extensionless fixture notes")
|
||||
assert f"Source: {SOURCE}/{NOTES_REL}" in note.summary
|
||||
note_schunks = [c for c in note.chunks if c.is_summary]
|
||||
assert len(note_schunks) == 1 and note_schunks[0].position == -1
|
||||
assert note_schunks[0].embedding is not None
|
||||
assert [c for c in note.chunks if not c.is_summary]
|
||||
|
||||
# The negative control: no token names Makefile exactly — never
|
||||
@@ -243,7 +248,8 @@ def test_without_tokens_the_extensionless_files_stay_out(
|
||||
summary.files, summary.added, summary.unchanged, summary.updated, summary.errors
|
||||
) == (1, 1, 0, 0, 0)
|
||||
assert summary.formats == {"md": 1}
|
||||
assert summary.summaries == 0
|
||||
# Phase 118 (A2): the md-only run still summarizes the note.
|
||||
assert summary.summaries == 1
|
||||
for rel in (DOCKER_REL, CONTAINER_REL, "Makefile"):
|
||||
assert (
|
||||
db.scalar(
|
||||
|
||||
Reference in New Issue
Block a user