phase: 182_verbatim_show_text
**Phase 182 — final verification pass (all 8 tasks already complete; this was verification + docs + one defect fix).**
- Verified: `app/rag/verbatim.py` (locator grammar, `splitlines()` slice, line-boundary cap, `resolve_answer_blocks`), `SHOW_TEXT_TOOL` + `shown_texts`, `SHOW_TEXT_CLAUSE`, `done.answer_text` (9 fields, key dropped when empty) + `ChatMessageRecord.answer_text` (≤50, 600 000-char cap counted in the 8 M budget), `verbatim.js` + 4 `{verbatim:true}` renderers, `Containerfile` minify step, `.env.example` 3 vars.
- `uv run python -c "…answer_text, show_text_max_chars, show_text_max_blocks"` → `True 12000 5`; each negative refuses startup naming its field; `0` accepted as inert ✅
- `bash .agents/validate.sh` → **validation OK**: 4320 unit+integration tests green, `TOTAL 6849 17 → 99%` (gate app/ >90% OK), `ruff check .` "All checks passed!", `pyright` 0 errors (re-run after my edits, 08:28).
- E2E, each in isolation `--no-cov`: `test_verbatim_show_text.py` 13 passed (panel bytes == `documents.content`, server caption, clipboard == server string, `/document.html?source=…&path=…`, honest unresolved state, reload+share, `show_image` regression, flag-off app) ✅; green: `test_answer_images` `test_harness_aligned_tools` `test_agent_document_tools` `test_markdown_tables` `test_markdown_inline_links_images` `test_svg_document_preview` `test_smoke` `test_document_viewer` `test_markdown_blockquotes` `test_chat_persistence` `test_thinking_timeline` `test_chat_rag` `test_settings_mobile_value_width`.
- **Defect found & fixed (pre-existing, not phase 182):** `tests/e2e/test_admin_settings_panel.py::test_admin_sees_groups_and_source_badges` failed — its whole-page `assert "reese" not in page.content()` tripped on the shell's onboarding chips, which follow the newest saved chats in the one shared E2E DB (a leftover `reeselink.json` question from a tool suite). Scoped the strict sweep to `.settings-shell` and kept a whole-page `reese:reese` credential needle → 12 passed with the leftovers still present.
- Docs: README fixed 2 inconsistencies — Quick Start omitted the **required** `BOR_ADMIN_PASSWORD`/`BOR_SESSION_SECRET` (the app fail-loud refuses boot) and the broken anchor `#chat--` → `#chat-`; full re-read of README (1816 lines) + AGENTS confirmed the phase-182 feature/settings/log/UI-contract text matches the code, and every `.env.example` var + every `Settings` field is documented.
- Notable: kept `resolve_answer_blocks` synchronous on the SSE terminal path (bounded indexed SELECTs, matching the existing `query_log` precedent and the phase's documented fence-lookup bound); no live-infra changes made.
- Next pending phase: none — `todo/` holds only 182 (its 8 task files are in `complete/`; the harness commits + moves `00_phase.md`).
This commit is contained in:
@@ -149,6 +149,45 @@ def test_docs_token_is_a_secret_live_overridable_row() -> None:
|
||||
assert "docs_token" not in NON_OVERRIDABLE
|
||||
|
||||
|
||||
def test_verbatim_display_rows_are_plain_live_overridable() -> None:
|
||||
"""Phase 182 (task 01, LOCKED A8): the three verbatim-display rows sit
|
||||
in ``Agent tools`` (the ``read_max_chars`` group, beside it) with the
|
||||
``Answer text`` / ``Show text max chars`` / ``Show text max blocks``
|
||||
labels and are plain — not ``secret`` (a bool and two ints), not
|
||||
``restart_required`` (the chat request path reads them per turn via
|
||||
``get_settings()`` — live), overridable (the overlay is generic over
|
||||
``bool``/``int`` fields). ``answer_text`` is the master switch and the
|
||||
two budgets accept ``0`` (inert) — a negative value fails startup, not
|
||||
the panel."""
|
||||
for key, label in (
|
||||
("answer_text", "Answer text"),
|
||||
("show_text_max_chars", "Show text max chars"),
|
||||
("show_text_max_blocks", "Show text max blocks"),
|
||||
):
|
||||
meta = CATALOG[key]
|
||||
assert meta.group == "Agent tools"
|
||||
assert meta.label == label
|
||||
assert meta.secret is False
|
||||
assert meta.restart_required is False
|
||||
assert meta.overridable is True
|
||||
assert key not in SECRETS
|
||||
assert key not in RESTART_REQUIRED
|
||||
assert key not in NON_OVERRIDABLE
|
||||
|
||||
|
||||
def test_verbatim_display_field_types() -> None:
|
||||
"""Phase 182 (task 01): the master switch is a ``bool`` and the two
|
||||
budgets are ``int``s with the LOCKED A8 defaults (``True`` /
|
||||
``12000`` / ``5``) — the types the panel renders its input for and the
|
||||
overlay coerces from the stored raw string."""
|
||||
assert Settings.model_fields["answer_text"].annotation is bool
|
||||
assert Settings.model_fields["show_text_max_chars"].annotation is int
|
||||
assert Settings.model_fields["show_text_max_blocks"].annotation is int
|
||||
assert Settings.model_fields["answer_text"].default is True
|
||||
assert Settings.model_fields["show_text_max_chars"].default == 12_000
|
||||
assert Settings.model_fields["show_text_max_blocks"].default == 5
|
||||
|
||||
|
||||
def test_labels_nonempty_and_unique() -> None:
|
||||
labels = [meta.label for meta in CATALOG.values()]
|
||||
assert all(label.strip() for label in labels), "empty label in the catalogue"
|
||||
|
||||
Reference in New Issue
Block a user