Skip to content

0.8.0 agents-beta — Agent runtime (Phase 6)

Choose a tag to compare

@esagduyu esagduyu released this 18 Jul 19:39
· 60 commits to main since this release

Every AI feature now executes as a recorded, replayable agent run; personas
and the ContradictionDetector build on the frozen kernel contract.

Agent runtime (Phase 6 K1–K2)

  • New tiro/agents/ kernel: TiroAgent/AgentContext contract, run_agent() with per-run JSONL traces ({library}/agents/traces/{run_uid}.jsonl), agent_runs index table (migration 014), one-agent-at-a-time run lock, typed AgentRunError.
  • All four AI features migrated behavior-identically (golden transcript tests pin prompt bytes): MetadataExtractor (Haiku extraction — every web/email/imap/rss/import ingest is now a recorded run), PreferenceClassifier, DigestWriter (scheduler untouched), IngenuityAnalyst. extract_metadata/classify_articles/generate_digest/analyze_article remain as compat wrappers — zero call-site churn.
  • /agents page: agent cards, filterable paginated run history, collapsible trace viewer, replay with cost-note confirm. Routes: GET /api/agents, GET /api/agents/runs, GET /api/agents/runs/{run_uid} (?trace=1 streams JSONL), POST /api/agents/runs/{run_uid}/replay, POST /api/agents/{name}/run.
  • Trace retention (agent_trace_retention_days/agent_trace_max_mb, files pruned, rows kept); doctor gains orphan-trace vacuum + stuck-run sweep.
  • Evals harness: tiro/evals/ fixtures + tiro evals run [agent] [--real] (structural mode is free/CI-gated via pytest); tiro agent list|run.
  • STATIC_VERSION 69.

Agent runtime — personas (Phase 6 K3)

  • Persona files ({library}/personas/*.md): community-shareable prompt templates over a closed placeholder set, running through the agent runtime on scope-derived read-only contexts. Untrusted by construction: suggest-only writes, no network tool, fenced interpolation with a fixed preamble, forced output kind, adversarially tested.
  • suggestions table (migration 017) + accept/dismiss flow running the standard validated writes; suggestion chips in inbox/reader and a queue + persona management on /agents.
  • Three forkable default personas: devils-advocate, daily-themes, research-brief. personas_disabled config (API-toggled). Manual runs only in K3; on-ingest/cron dispatch arrives with K4's hook infrastructure.
  • Routes: GET /api/personas, POST /api/personas/{slug}/enable, POST /api/personas/{slug}/disable, GET /api/suggestions?status=&article_id=, POST /api/suggestions/{uid}/accept, POST /api/suggestions/{uid}/dismiss.
  • Backup snapshots now include personas/ (an export/backup posture fix landed alongside K3 closeout — agents/traces/ remains deliberately excluded, per the K1–K2 D15 owner-ratification item).
  • STATIC_VERSION 70.

Agent runtime — ContradictionDetector & on-ingest hooks (Phase 6 K4)

  • New contradiction-detector code agent runs on ingest (post-save hook, never
    inside the rollback window; hook failures can never fail a save): finds up to
    8 similar articles, keeps the trusted set (rating > 0 or must-read), gets one
    light-tier claims-level verdict per candidate, and files confidence-gated
    contradiction suggestions ("challenges something you trusted"). Accepting
    appends the contradiction to the article's note. Empty trusted set = zero
    LLM calls.
  • contradiction_detector_enabled kill-switch (default on, config/env only —
    gates the on-ingest dispatch, never manual runs); tiro agent run contradiction-detector --backfill [--limit] for existing libraries
    (resumable, newest-first; bulk imports are hook-exempt by design).
  • On-ingest personas (article scope) now dispatch through the same hook —
    K3's schedule: on-ingest value is live; cron dispatch still deferred.
  • Six-pair eval fixture set added to the harness (fake_similars +
    ai_tier seed support). No new migration, no frontend change.