# Generated by Django 5.2 on 2025-11-18 20:21

import django.db.models.deletion
import uuid
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0190_promptconfig'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='EvalRun',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('scenario_slug', models.CharField(max_length=200)),
                ('scenario_version', models.CharField(blank=True, max_length=50)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('running', 'Running'), ('completed', 'Completed'), ('errored', 'Errored')], default='pending', max_length=20)),
                ('started_at', models.DateTimeField(blank=True, null=True)),
                ('finished_at', models.DateTimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True)),
                ('budget_id', models.CharField(blank=True, max_length=100)),
                ('branch_id', models.CharField(blank=True, max_length=100)),
                ('tokens_used', models.IntegerField(default=0)),
                ('credits_cost', models.DecimalField(decimal_places=6, default=Decimal('0'), max_digits=20)),
                ('completion_count', models.IntegerField(default=0)),
                ('step_count', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.persistentagent')),
                ('initiated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='EvalRunTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sequence', models.IntegerField()),
                ('name', models.CharField(max_length=200)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('running', 'Running'), ('passed', 'Passed'), ('failed', 'Failed'), ('errored', 'Errored'), ('skipped', 'Skipped')], default='pending', max_length=20)),
                ('assertion_type', models.CharField(max_length=50)),
                ('started_at', models.DateTimeField(blank=True, null=True)),
                ('finished_at', models.DateTimeField(blank=True, null=True)),
                ('expected_summary', models.TextField(blank=True)),
                ('observed_summary', models.TextField(blank=True)),
                ('tool_called', models.CharField(blank=True, max_length=200)),
                ('charter_before', models.TextField(blank=True)),
                ('charter_after', models.TextField(blank=True)),
                ('schedule_before', models.TextField(blank=True)),
                ('schedule_after', models.TextField(blank=True)),
                ('llm_question', models.TextField(blank=True)),
                ('llm_answer', models.TextField(blank=True)),
                ('llm_model', models.CharField(blank=True, max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('first_browser_task', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.browseruseagenttask')),
                ('first_message', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.persistentagentmessage')),
                ('first_step', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.persistentagentstep')),
                ('run', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='api.evalrun')),
            ],
            options={
                'ordering': ['sequence'],
            },
        ),
    ]
