jackwener/maka-agent

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

Fermée

#1 407 ouverte le 23 juil. 2026

 (1 commentaire) (0 réaction) (1 personne assignée)TypeScript (0 fork)github user discovery
enhancementgood first issue

Métriques du dépôt

Stars
 (1 étoile)
Métriques de merge PR
 (Métriques PR en attente)

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.

Guide contributeur