Skip to content

Remaining test gaps in the episodes feature #229

Closed as not planned
Closed as not planned

Description

@0xKT

Auditing the suite for #223 included a pass over #217 (collapsible episodes) and #220 (upgrade nudge). Most of what those added is solid, and the small gaps -- an empty test body, the session.py wiring, clipToWidth, hasMeaningfulReasoning, _upgrade_command_works -- are closed in the #223 cleanup. Three items were left out of that PR because they need real work or a product decision rather than a quick assertion.

Each finding below was confirmed by reading assertions and, where noted, by mutating the code under test and watching the suite stay green. None of this breaks a user today; the risk is that a regression would pass silently.

Table width fitting has no tests

ui-tui/src/components/markdown.tsx:217-270 -- roughly 90 lines of clipWidth / fitWidths deciding how a markdown table is squeezed into the available columns. Boundary-heavy code (single wide column, more columns than cells, zero budget, CJK glyphs) and none of it is exercised.

Episode height estimation has no tests

ui-tui/src/lib/virtualHeights.ts:91-138 -- pure arithmetic over collapsed and expanded episodes, easy to pin with a table of cases, currently unpinned. Flagged as follow-up R8 during the #217 review.

The middle of the episode.start path is untested

The event has coverage at both ends -- the agent loop emits it, turnController consumes it -- but the three hops between have none:

  • raven/tui_rpc/spine.py:169-172 (outbound)
  • ui-tui/src/app/chatStream.ts:113-115 (inbound)
  • ui-tui/src/app/createGatewayEventHandler.ts:304-307 (dispatch)

Renaming the event on either side turns nothing red, so the wire contract is only guarded by convention.

A field nothing reads, credited by a test

ui-tui/src/domain/episodeSummary.ts:11-14 defines VerbRule.style, which is only ever written -- no reader anywhere in the tree. episodeSummary.test.ts:43 attributes the 'ran 2 commands' output to it, but that string comes from unit; setting every style value to 'count' leaves the test green.

This one is a product decision rather than a test gap: either something should read the field, or it should go along with the test's claim about it.

Activity

  1. 0xKT commented on Jul 30, 2026

    @0xKT
    MemberAuthor

    Closing as not planned, with the findings recorded so picking this up later is cheap.

    This is four separate pieces of work rather than one, and they differ a lot in cost:

    • virtualHeights.ts is the easy one -- everything it exposes is already an exported pure function, so a table of cases pins it with no production change.
    • The markdown table fitting is not: clipWidth (markdown.tsx:219) and fitWidths (:246) are module-private, so covering them means either exporting them or driving the whole component.
    • The episode.start middle hops span Python and TypeScript, so a wire-contract test has to bridge both sides.
    • VerbRule.style is not a test gap at all. Verified: it has zero readers anywhere in the tree -- it is only ever written. That is a product decision (give it a reader, or delete the field along with the test's claim about it), not something a test should paper over.

    None of this breaks a user today; the risk is that a regression in those paths would pass silently. Reopen if episodes get touched again -- that is when the first two become nearly free, since the files are already open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions