{
  "id": "8be4d523-8fb0-4011-aeba-844f4ca3cb3f",
  "prevId": "e8fe34c9-853f-46c8-867a-6d69aabd1789",
  "version": "6",
  "dialect": "sqlite",
  "tables": {
    "session_host_metrics": {
      "name": "session_host_metrics",
      "columns": {
        "session_id": {
          "name": "session_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "tty_busy_ms": {
          "name": "tty_busy_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "render_ms": {
          "name": "render_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "persist_ms": {
          "name": "persist_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "egress_ms": {
          "name": "egress_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "total_command_ms": {
          "name": "total_command_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "session_host_metrics_session_id_sessions_id_fk": {
          "name": "session_host_metrics_session_id_sessions_id_fk",
          "tableFrom": "session_host_metrics",
          "columnsFrom": ["session_id"],
          "tableTo": "sessions",
          "columnsTo": ["id"],
          "onUpdate": "no action",
          "onDelete": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "session_tool_payload": {
      "name": "session_tool_payload",
      "columns": {
        "session_id": {
          "name": "session_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload": {
          "name": "payload",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload_version": {
          "name": "payload_version",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        }
      },
      "indexes": {},
      "foreignKeys": {
        "session_tool_payload_session_id_sessions_id_fk": {
          "name": "session_tool_payload_session_id_sessions_id_fk",
          "tableFrom": "session_tool_payload",
          "columnsFrom": ["session_id"],
          "tableTo": "sessions",
          "columnsTo": ["id"],
          "onUpdate": "no action",
          "onDelete": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "sessions": {
      "name": "sessions",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "timestamp": {
          "name": "timestamp",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "timestamp_iso": {
          "name": "timestamp_iso",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "completed_at_iso": {
          "name": "completed_at_iso",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cwd": {
          "name": "cwd",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "suite_run_id": {
          "name": "suite_run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "suite_name": {
          "name": "suite_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "recipe": {
          "name": "recipe",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "passed": {
          "name": "passed",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "run_outcome": {
          "name": "run_outcome",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "cli_version": {
          "name": "cli_version",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "engine_version": {
          "name": "engine_version",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "sessions_tool_timestamp_idx": {
          "name": "sessions_tool_timestamp_idx",
          "columns": ["tool", "\"timestamp\" DESC"],
          "isUnique": false
        },
        "sessions_timestamp_idx": {
          "name": "sessions_timestamp_idx",
          "columns": ["\"timestamp\" DESC"],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "run_steps": {
      "name": "run_steps",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "run_id": {
          "name": "run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "logical_step_key": {
          "name": "logical_step_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ordinal": {
          "name": "ordinal",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "attempt": {
          "name": "attempt",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "command": {
          "name": "command",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "stable_id": {
          "name": "stable_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "effective_args": {
          "name": "effective_args",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "exit_code": {
          "name": "exit_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "outcome": {
          "name": "outcome",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "verdict_summary": {
          "name": "verdict_summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "session_id": {
          "name": "session_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "evidence": {
          "name": "evidence",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "parent_step_id": {
          "name": "parent_step_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "dependency": {
          "name": "dependency",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "run_steps_run_order_idx": {
          "name": "run_steps_run_order_idx",
          "columns": ["run_id", "ordinal", "attempt"],
          "isUnique": false
        },
        "run_steps_session_id_unique_idx": {
          "name": "run_steps_session_id_unique_idx",
          "columns": ["session_id"],
          "isUnique": true
        },
        "run_steps_stable_id_idx": {
          "name": "run_steps_stable_id_idx",
          "columns": ["stable_id"],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "run_steps_run_id_runs_id_fk": {
          "name": "run_steps_run_id_runs_id_fk",
          "tableFrom": "run_steps",
          "columnsFrom": ["run_id"],
          "tableTo": "runs",
          "columnsTo": ["id"],
          "onUpdate": "no action",
          "onDelete": "cascade"
        },
        "run_steps_session_id_sessions_id_fk": {
          "name": "run_steps_session_id_sessions_id_fk",
          "tableFrom": "run_steps",
          "columnsFrom": ["session_id"],
          "tableTo": "sessions",
          "columnsTo": ["id"],
          "onUpdate": "no action",
          "onDelete": "set null"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "runs": {
      "name": "runs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "source": {
          "name": "source",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "correlation_run_id": {
          "name": "correlation_run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cwd": {
          "name": "cwd",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "started_at": {
          "name": "started_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "started_at_iso": {
          "name": "started_at_iso",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "completed_at_iso": {
          "name": "completed_at_iso",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "exit_code": {
          "name": "exit_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "aggregate": {
          "name": "aggregate",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "review_brief": {
          "name": "review_brief",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "legacy_suite_run_id": {
          "name": "legacy_suite_run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cli_version": {
          "name": "cli_version",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "engine_versions": {
          "name": "engine_versions",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "runs_completed_at_idx": {
          "name": "runs_completed_at_idx",
          "columns": ["\"completed_at\" DESC"],
          "isUnique": false
        },
        "runs_legacy_suite_run_id_idx": {
          "name": "runs_legacy_suite_run_id_idx",
          "columns": ["legacy_suite_run_id"],
          "isUnique": false
        },
        "runs_source_completed_at_idx": {
          "name": "runs_source_completed_at_idx",
          "columns": ["source", "\"completed_at\" DESC"],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "graph_catalog": {
      "name": "graph_catalog",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "language": {
          "name": "language",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "cache_key": {
          "name": "cache_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "files_fingerprint": {
          "name": "files_fingerprint",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "built_at": {
          "name": "built_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload": {
          "name": "payload",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "graph_shard_fragment": {
      "name": "graph_shard_fragment",
      "columns": {
        "shard_id": {
          "name": "shard_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "language": {
          "name": "language",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "cache_key": {
          "name": "cache_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "shard_fingerprint": {
          "name": "shard_fingerprint",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload": {
          "name": "payload",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "tool_baseline_entries": {
      "name": "tool_baseline_entries",
      "columns": {
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "fingerprint": {
          "name": "fingerprint",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload": {
          "name": "payload",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "captured_at": {
          "name": "captured_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "tool_baseline_entries_tool_fingerprint_pk": {
          "columns": ["tool", "fingerprint"],
          "name": "tool_baseline_entries_tool_fingerprint_pk"
        }
      },
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "tool_baseline_meta": {
      "name": "tool_baseline_meta",
      "columns": {
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "captured_at": {
          "name": "captured_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "baseline_format_version": {
          "name": "baseline_format_version",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fingerprint_strategy_id": {
          "name": "fingerprint_strategy_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fingerprint_strategy_version": {
          "name": "fingerprint_strategy_version",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "tool_state": {
      "name": "tool_state",
      "columns": {
        "tool": {
          "name": "tool",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "payload": {
          "name": "payload",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "tool_state_tool_key_pk": {
          "columns": ["tool", "key"],
          "name": "tool_state_tool_key_pk"
        }
      },
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "policy_audit_events": {
      "name": "policy_audit_events",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "run_id": {
          "name": "run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "timestamp": {
          "name": "timestamp",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_kind": {
          "name": "subject_kind",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_id": {
          "name": "subject_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject": {
          "name": "subject",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "outcome": {
          "name": "outcome",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "reasons": {
          "name": "reasons",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "source_tiers": {
          "name": "source_tiers",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "matched_exception_ids": {
          "name": "matched_exception_ids",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "policy_audit_events_timestamp_idx": {
          "name": "policy_audit_events_timestamp_idx",
          "columns": ["timestamp"],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    }
  },
  "views": {},
  "enums": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  },
  "internal": {
    "indexes": {
      "sessions_tool_timestamp_idx": {
        "columns": {
          "\"timestamp\" DESC": {
            "isExpression": true
          }
        }
      },
      "sessions_timestamp_idx": {
        "columns": {
          "\"timestamp\" DESC": {
            "isExpression": true
          }
        }
      },
      "runs_completed_at_idx": {
        "columns": {
          "\"completed_at\" DESC": {
            "isExpression": true
          }
        }
      },
      "runs_source_completed_at_idx": {
        "columns": {
          "\"completed_at\" DESC": {
            "isExpression": true
          }
        }
      }
    }
  }
}
