Phase 3.5 cleanup: 17-item backlog burndown #5
Reference in New Issue
Block a user
Delete Branch "phase-3.5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 3.5 burns down the combined Phase 2.6/3 + Phase 3.5/4 backlog tracked in CLAUDE.md (17 items total). 12 tasks across 7 waves; both old backlog sections are now empty. New residuals discovered during execution are tracked in a fresh Phase 3.6 / 4 backlog section.
What shipped (12 tasks, 7 waves)
consume_pending_meanwhile_digestsis now wired into post_turn (T66 surfaced this — meanwhile digests previously stayed pending forever)Architecture notes
Test plan
Phase 3.6 / 4 backlog (discovered during T76-T86)
Captured in CLAUDE.md:
Deferred:
Plan
`docs/plans/2026-04-26-v3.5-phase3.5-cleanup.md` (committed in
fb7e972).The recent-dialogue read and the directed-pair edge gather were duplicated between ``chat.services.regenerate`` and ``chat.web.turns``. Extracted into ``chat.services.turn_common`` with two helpers: - ``read_recent_dialogue(conn, chat_id, *, limit, exclude_event_id)``: oldest-first ``[{speaker, text}]`` over user_turn / user_turn_edit / assistant_turn rows, with the standard ``superseded_by IS NULL AND hidden = 0`` filter. ``exclude_event_id`` covers regenerate's need to drop the original assistant_turn before its supersede UPDATE lands. - ``gather_prior_edges(conn, present_ids)``: ``{(src, tgt): edge}`` over every directed pair across ``present_ids``, with the schema default 50/50 baseline for missing rows. ``chat.web.turns._read_recent_dialogue`` becomes a thin delegate so the chat-detail template and other in-module callers keep their import shape; ``_gather_state_update_inputs`` now calls into the shared edge gather. ``regenerate_assistant_turn`` calls both helpers in three call sites (primary + post-interjection edges, primary + interjection recent reads), still post-processing speaker ids to display names for its prompts. Decision: ``chat.services.scene_summarize._read_recent_dialogue`` is left in place — it has a ``since_event_id`` clamp (T80.2) and excludes ``user_turn_edit`` deliberately. Folding it into the shared helper would either silently change its read shape or require a second flag, both more invasive than the duplication. Documented in the new module docstring. Tests: tests/test_turn_common.py covers chronological ordering, supersede / other-chat / exclude_event_id filtering, and prior-edge default-fallback. Existing 6 regenerate + 18 turn_flow tests pass unchanged.