jackwener/maka-agent

refactor(runtime): finish agent-run.ts extraction (prior-run context + status projection helpers)

Fechada

#1.407 aberto em 23 de jul. de 2026

 (1 comentário) (0 reação) (1 responsável)TypeScript (0 fork)github user discovery
enhancementgood first issue

Métricas do repositório

Stars
 (1 estrela)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Part of #1084 (second-pass sink-file and boundary governance). Half of the original slice already landed (session-projection-helpers.ts exists and is imported at agent-run.ts:38); this finishes the rest. Scope re-verified against current main (agent-run.ts, 1652 lines).

Scope

  • New prior-run-context.ts: PriorRuntimeContext (~L144), buildPriorRuntimeContext (~L977), buildResumedChildRuntimeContext (~L1061, added by #1329 — include this child variant), backfillMissingPriorRuntimeEvents (~L1159) and the repair/backfill helpers.
  • Move the remaining pure helpers into the existing session-projection-helpers.ts: isTerminalRunStatus (~L1591), statusFromEvent (~L1603), turnStatusFromEvent (~L1626), blockedReasonFromErrorReason (~L1645). No new file for these.

Invariants

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

Verification

Typecheck/build + agent-run/session tests.

Guia do colaborador