refactor(tui): resume rows fold titles only, timestamp from artifact mtime

Rows no longer read logs for anything but the batch title fold: the
activity timestamp is a live session's last in-memory event time or the
artifact mtime via the optional sessionPersistence.locate(), falling
back to creation time; the last-turn, route, and goal columns are gone.
Route availability moves to the Enter-time preflight, which already
fully reads and replay-validates the one chosen log. The projectSessions
public API this PR had added to session-query is reverted — the change
is now confined to the TUI package.
This commit is contained in:
Turtle
2026-08-03 16:40:47 +08:00
parent 776cc6889a
commit 7077d6befc
25 changed files with 295 additions and 372 deletions

View File

@@ -69,6 +69,8 @@ export interface TuiHarnessOptions {
sessionPersistence?: {
list(): Promise<SessionHeader[]>
load?(id: ReturnType<typeof SessionId>): Promise<{ meta: SessionHeader; events: Session['events'] }>
/** Per-session artifact location for mtime-based activity; defaults to none. */
locate?(meta: SessionHeader): { kind: string; path: string } | undefined
}
handoffResume?: TuiRuntime['handoffResume']
/** Host-supplied exit line; absent exercises the no-message path. */
@@ -156,7 +158,7 @@ export async function createTuiTestHarness<TerminalType extends Terminal, Exit e
const persistence = options.sessionPersistence
ctx.provide('sessionPersistence', {
...persistence,
locate: () => undefined,
locate: (meta: SessionHeader) => persistence.locate?.(meta),
create: () => Promise.resolve(),
append: () => Promise.resolve(),
load: persistence.load === undefined