managarten/apps/mana/apps
Till JS 1c6201be50 feat(ai): MissionRunner — orchestrates Planner + proposal staging
Executes one iteration end-to-end: resolve Mission inputs → build the
policy-filtered tool allowlist → invoke the Planner → stage each
PlannedStep as a Proposal (or auto-run if policy says so) → finalize
the iteration with summary + status.

- `data/ai/missions/runner.ts`
  - `runMission(id, deps)` runs a single iteration. Planner + stageStep
    are injected so the Runner is unit-testable without a live LLM.
  - `runDueMissions(now, deps)` scans for active missions past their
    nextRunAt and runs each once. Safe to call on a foreground tick.
  - Reuses the iteration id returned by `startIteration` so
    `finishIteration` updates the same row (fixed a dup-id bug the
    tests caught).
- `data/ai/missions/input-resolvers.ts` — registry: modules register a
  resolver at init, Runner looks up by module name. Missing resolvers
  degrade gracefully to "fewer inputs", never crash a run.
- `data/ai/missions/available-tools.ts` — exposes only tools the AI
  policy rates non-`deny`. Defence-in-depth with the executor + parser.

overallStatus derivation:
  0 steps                         → 'approved'  (no-op run is valid)
  all steps failed                → 'failed'
  any step staged (proposal id)   → 'awaiting-review'
  all steps ran auto              → 'approved'

Planner throw is caught and recorded as a failed iteration — one bad
mission can't stall the queue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:20:29 +02:00
..
landing refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
mobile refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
web feat(ai): MissionRunner — orchestrates Planner + proposal staging 2026-04-14 21:20:29 +02:00