phase: 139_read_range_tool_lines
All verification is complete and green. Phase 139's three tasks (01–03) were already implemented in prior passes; this was the final verification pass, and every gate holds. ## Phase 139 — final verification report **Verified in working tree (no code changes needed):** - `readRangeSuffix` single-source-of-truth helper in `app.js` + byte-identical parity copy in `shared.js` (EN-dash ` (lines N–M)`, `(from line N)`, `(first N lines)`, `Number.isInteger(x) && x >= 1` guard mirroring the server's `_whole_line_number`) - `appendToolLine(wrap, name, argument, offset = null, limit = null)` — `<span class="read-range">` sibling after `<code>`, only when suffix non-empty; `shared.js` `addToolLines` parity - Live `tool` branch: guarded `ev.offset`/`ev.limit`, additive `toolAcc` records (non-range keeps pre-phase shape), status label carries the suffix (A2); restore path passes stored `t.offset`/`t.limit` through, phase-95 truncation note untouched - E2E: `SAME_FILE_TRIGGER` mock flow (same file read twice, offsets 10/20 then 40/15) + 3-test Playwright suite **Test / lint / coverage results:** - `uv run pytest` (unit + integration): **3283 passed, 9 skipped, 0 failed** - `uv run pytest --cov=app --cov-report=term-missing`: **TOTAL 99%** (>90% gate) - `uv run pytest tests/e2e/test_read_range_tool_lines.py -v --no-cov`: **3 passed** in isolation - `uv run ruff check .`: clean; `uv run pyright`: **0 errors, 0 warnings** **Completion criteria:** 1. Range read renders `(lines N–M)` live; two same-file reads show DIFFERENT ranges — ✅ (E2E test 1) 2. Plain read byte-identical; phase-87/117 pins + emoji guard pass unedited — ✅ (E2E test 2 + full suite) 3. Suffix survives save → restore on chat page + shared page — ✅ (E2E test 3) 4. Full suite green, coverage >90%, E2E isolated green, ruff + pyright clean — ✅ 5. Commit + phase move — left to the harness per executor rules (no `git add`/`commit` run) **Notable:** the missing pytest summary line on one run was a transient output-buffering artifact, confirmed by re-run; DB was already up and healthy. **Next pending phase:** `140_pictorial_pdf_pages`
This commit is contained in:
@@ -978,6 +978,20 @@ class ToolCall(BaseModel):
|
||||
is JSON) — a saved chat written before phase 95 (no fields) validates
|
||||
UNCHANGED (the phase-50 backward-compat rule) and renders without
|
||||
the marker.
|
||||
|
||||
Phase 139 (task 02): the read's REQUESTED line range (phase 131's
|
||||
``offset`` / ``limit`` wire fields) rides the SAME record so a saved
|
||||
chat re-renders the "(lines N–M)" suffix on the Reading line after
|
||||
a save → restore round-trip (the chat page's restore path and the
|
||||
shared page both read it off the stored row). Small additive fields
|
||||
with defaults, no migration (the phase-95 truncated-fields
|
||||
precedent): both are ABSENT (``None``) on every non-range record —
|
||||
the UI includes a field only when well-formed — and both carry the
|
||||
same >= 1 whole-line bound as the server's ``_whole_line_number``
|
||||
(``app/api/chat.py``; the UI's guard mirrors it, so a value that
|
||||
422s here is one the UI never legitimately produces). A saved chat
|
||||
written before the phase (no fields) validates UNCHANGED and renders
|
||||
without the suffix (the phase-50 backward-compat rule).
|
||||
"""
|
||||
|
||||
name: str = Field(max_length=100)
|
||||
@@ -985,6 +999,8 @@ class ToolCall(BaseModel):
|
||||
truncated: bool = False
|
||||
chars_shown: int | None = Field(default=None, ge=0)
|
||||
chars_total: int | None = Field(default=None, ge=0)
|
||||
offset: int | None = Field(default=None, ge=1)
|
||||
limit: int | None = Field(default=None, ge=1)
|
||||
|
||||
|
||||
#: One suggestion chip (phase 83, A1): a short deterministic string —
|
||||
|
||||
Reference in New Issue
Block a user