0.8.0 agents-beta — Agent runtime (Phase 6)
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/AgentContextcontract,run_agent()with per-run JSONL traces ({library}/agents/traces/{run_uid}.jsonl),agent_runsindex table (migration 014), one-agent-at-a-time run lock, typedAgentRunError. - 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_articleremain as compat wrappers — zero call-site churn. /agentspage: 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=1streams 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. suggestionstable (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_disabledconfig (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-detectorcode 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
contradictionsuggestions ("challenges something you trusted"). Accepting
appends the contradiction to the article's note. Empty trusted set = zero
LLM calls. contradiction_detector_enabledkill-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'sschedule: on-ingestvalue is live;crondispatch still deferred. - Six-pair eval fixture set added to the harness (
fake_similars+
ai_tierseed support). No new migration, no frontend change.