← Back to Roadmap

Priority 0B: Session Artifacts + Verification Layer

P0B — Critical 5-7 days (3 phases) Backend + Frontend dev

Full research doc exists: Design: Session Artifacts — comprehensive architecture, TypeScript interfaces, API design, and implementation plan. This page summarizes and adds practical steps + competitor comparison.

What Are Session Artifacts?

When an agent works on a task, it produces artifacts — code diffs, test results, PR links, log files, screenshots. Currently AO captures only basic session logs. Everything else is lost or scattered across the filesystem.

Without artifacts: You can't verify what an agent did. You can't compare agent outputs. You can't replay or audit. You can't build on top of previous work.

How Goose (Block) Handles Sessions

Goose's session module at crates/goose/src/session/:

FileWhat It DoesAO Equivalent
session_manager.rsFull session lifecycle — create, resume, list, searchAO has session-manager but no artifact tracking
extension_data.rsStores arbitrary extension data per sessionAO has nothing — this is exactly what artifacts need
chat_history_search.rsFull-text search across session historiesAO can't search past sessions
diagnostics.rsSession health diagnostics and debuggingAO has basic status only

Additionally, Goose has:

Key takeaway from Goose: They store extension data + tool results as first-class session objects. AO should do the same — every tool invocation and its result becomes a searchable, displayable artifact.

Implementation Plan (From Existing Research)

Phase 1: Core Infrastructure (MVP) — 2-3 days

Add artifact types and path utilities

Core types from the research doc:

interface SessionArtifact {
  id: string;
  sessionId: string;
  type: 'diff' | 'test-result' | 'log' | 'pr' | 'screenshot' | 'file' | 'custom';
  name: string;
  path: string;         // relative to session artifact dir
  mimeType: string;
  size: number;
  createdAt: string;
  metadata: Record<string, unknown>;
}

interface ArtifactManifest {
  sessionId: string;
  schemaVersion: 1;
  artifacts: SessionArtifact[];
  summary: { totalSize: number; count: number; };
}

Path utility: ~/.agent-orchestrator/artifacts/{sessionId}/manifest.json

Implement ArtifactService

New file: packages/core/src/artifact-service.ts

interface ArtifactService {
  addArtifact(sessionId: string, artifact: CreateArtifactInput): Promise<SessionArtifact>;
  getArtifacts(sessionId: string): Promise<SessionArtifact[]>;
  getArtifact(sessionId: string, artifactId: string): Promise<SessionArtifact | null>;
  deleteArtifact(sessionId: string, artifactId: string): Promise<void>;
  getArtifactContent(sessionId: string, artifactId: string): Promise<Buffer>;
}

Storage: file-based (default). Each session gets a directory. Manifest tracks all artifacts.

Integrate with session-manager

Hook into session lifecycle:

  • On spawn: Create artifact directory, initialize manifest
  • On agent output: Auto-capture git diffs, test results, PR links
  • On kill: Finalize manifest, calculate summary stats

Add CLI commands

ao artifacts list <session-id>           # List artifacts for a session
ao artifacts show <session-id> <id>     # Show artifact details
ao artifacts export <session-id>         # Export all artifacts as zip
ao artifacts search <query>              # Search across all sessions

Phase 2: Dashboard & API — 2 days

Web API endpoints

GET  /api/sessions/:id/artifacts          # List artifacts
GET  /api/sessions/:id/artifacts/:aid     # Get artifact detail
GET  /api/sessions/:id/artifacts/:aid/raw # Download raw content
POST /api/sessions/:id/artifacts          # Add artifact manually

Dashboard UI — Artifact panel in session detail

New panel in SessionDetail.tsx:

  • Artifact list with type icons (diff, test, log, PR, file)
  • Click to expand: diff viewer for code changes, log viewer for logs
  • Summary bar: "5 artifacts, 3 diffs, 1 test result, 1 PR"
  • Download button for individual artifacts or full zip

Phase 3: Verification Layer — 2 days

Auto-artifact creation on lifecycle events

Triggered automatically:

  • Git push: Capture diff as artifact
  • Test run: Capture test results (pass/fail/coverage)
  • PR created: Capture PR link + description
  • CI complete: Capture CI status + logs

Verification checks

After agent completes, run verification:

  • Diff review: Does the diff match the issue requirements?
  • Test coverage: Did tests pass? Is coverage above threshold?
  • CI status: Did CI pass?
  • Code quality: Lint results, type check results

Output: verification score per session (green/yellow/red)

Orchestrator artifact queries

Orchestrator uses artifacts to make decisions:

  • "Which agent produced the best diff for this type of issue?"
  • "What's the average verification score by agent type?"
  • "Show me all sessions that failed verification"

How This Compares

FeatureAO (current)AO (with artifacts)GooseOpenHands
Session historyBasic logsFull artifact trailChat history + tool resultsFull workspace snapshot
Diff trackingNoneAuto-capturedVia extension dataFull file tree
VerificationNoneScore per sessionTool inspectionSWEBench integration
SearchNoneFull-text searchChat history searchYes

Acceptance Criteria