phase: 158_thinking_timeline
All verification complete. Every gate is green and the docs check out. Final report:
## Phase 158 final verification pass — COMPLETE
**Verified (all tasks pre-completed; this pass re-ran the full gate):**
- Unit + integration: `uv run pytest --cov=app --cov-report=term-missing` → **3618 passed, 99% coverage on `app/`** (>90% gate)
- Phase E2E in isolation: `uv run pytest tests/e2e/test_thinking_timeline.py -v --no-cov` → **6/6 passed** (order pin, fold-at-rest, live-open, restore+`segments` array, shared page, no-thinking single disclosure)
- Regression E2E, each in isolation: `test_thinking_display` 5✓, `test_tool_call_compact` 4✓, `test_turn_progress_loader` 3✓ (per-run pin updated), `test_big_read_progress` 4✓, `test_agent_document_tools` 4✓, `test_share_chat` 4✓, `test_chat_persistence` 4✓, `test_smoke` 3✓
- Lint/types: `uv run ruff check . && uv run pyright` → **clean (0 errors)**
**Completion criteria:** all 9 met — timeline E2E pins ✓, restore/shared `segments` ✓, no-thinking single-disclosure + the three UNCHANGED regression suites green ✓, pre-phase byte-identical round-trip (integration pin: key absent, never null; >50 / >32 000 / empty text / unknown kind all 422) ✓, full suite + coverage + E2E + lint ✓, `git diff --stat` footprint limited to `app/schemas.py`, `frontend/assets/{app,shared}.js`, `tests/`, README, phase files (a pre-existing owner `TODO.md` edit is out of scope, not staged by the phase commit) ✓, D15→per-run supersession recorded in the updated pin ✓. (Commit + phase move are the harness's job; task dirs already in `complete/`.)
**Documentation:** README.md — Thinking section correctly describes the phase-158 timeline; config reference matches `.env.example` exactly; page table matches registered routes; no stale single-block wording. AGENTS.md — rules and quick-reference commands all accurate. **Verified consistent — no changes needed.**
**Decisions/deviations:** none. `test_tool_call_compact.py` carries a one-line docstring-only update (referenced the removed `closeToolCalls`); its test logic is byte-identical to the phase-117 contract and green.
**Next pending phase:** none — `todo/` contains only 158.
This commit is contained in:
@@ -63,7 +63,7 @@ def test_pagehide_records_the_partial_index_after_the_push() -> None:
|
||||
assert "if (persistedOnLeave) return;" in body, "phase-20 idempotency guard"
|
||||
assert "if (!acc) return;" in body, "nothing brain-side yet → no save"
|
||||
i_guard = body.index("persistedOnLeave = true;")
|
||||
i_push = body.index("rememberBrainTurn(acc, { thinking: thinkingAcc || undefined });")
|
||||
i_push = body.index("rememberBrainTurn(acc, {")
|
||||
i_index = body.index("leavePartialIndex = conversation.length - 1")
|
||||
assert i_guard < i_push < i_index, (
|
||||
"flag → push the partial → record its index (the record it just pushed)"
|
||||
@@ -125,11 +125,16 @@ def test_every_settle_writes_through_the_correlation() -> None:
|
||||
stop_idx = js.find('stoppedByUser || err?.name === "AbortError"', catch)
|
||||
stop_branch = js[stop_idx: js.find("} else {", stop_idx)]
|
||||
assert "leavePartialIndex" in stop_branch, "the stop settle is correlated"
|
||||
# The pagehide handler pushes the plain two-arg partial (the record
|
||||
# that the settles replace).
|
||||
# The pagehide handler pushes the partial through rememberBrainTurn
|
||||
# (phase 158, D4: + the optional segments — non-empty only).
|
||||
fn = js.find('window.addEventListener("pagehide"')
|
||||
body = js[fn: js.find("\n});", fn)]
|
||||
assert "rememberBrainTurn(acc, { thinking: thinkingAcc || undefined });" in body
|
||||
assert "rememberBrainTurn(acc, {" in body
|
||||
assert "thinking: thinkingAcc || undefined" in body
|
||||
assert (
|
||||
"segments: pagehideSegments.length ? pagehideSegments : undefined"
|
||||
in body
|
||||
), "phase 158: the partial's timeline persists (non-empty only)"
|
||||
assert "leavePartialIndex" not in body.replace(
|
||||
"leavePartialIndex = conversation.length - 1", ""
|
||||
), "the pagehide handler only records the index — it never settles"
|
||||
|
||||
Reference in New Issue
Block a user