jackwener/maka-agent

refactor(cli): extract the shell-run hydration state machine from pi-tui-runner.ts

Geschlossen

#1.412 geöffnet am 23.07.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (0 Forks)github user discovery
enhancementgood first issue

Repository-Metriken

Stars
 (1 Stern)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Part of #1084 (second-pass sink-file and boundary governance). The underlying buffer primitives (ShellRunUpdateBuffer, mergeShellRunUpdate, projectShellRunUpdateForSession) and shell-run-elapsed-ticker.ts are already extracted; the runner-local state machine is not. Scope re-verified against current main (pi-tui-runner.ts, 2642 lines).

Scope

Move the hydration controller (~L456–543) into shell-run-hydration.ts:

  • local state: shellRunOwnerMappings, hydratingShellRunsFor, shellRunHydrationEpoch, shellRunHydrationRetryTimer, pendingShellRunUpdates
  • closures: applyShellRunViewUpdate, replayPendingShellRunUpdates, resetShellRunSessionState, hydrateShellRuns, and the update subscription

Expose a controller that takes driver/applyToTranscript deps; the runner keeps only wiring.

Invariants

Same as #1084: behavior-neutral; stable exports; no reverse imports; flat PR off main.

Verification

Typecheck/build + the existing behavior-driven runner tests.

Contributor Guide