quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
150 stars 23 forks source link

Save Export Errors #3167

Open OAGr opened 5 months ago

OAGr commented 5 months ago

Description of suggestion or shortcoming:

Now that we're getting ModelRevisionBuilds, it would be good to save data about which exports were verified. Right now, this only applies to exports with Specs, so we should verify the specs.

I propose the following schema (as a first pass):

model ModelRevisionBuild {
  id              String        @id @default(cuid())
  createdAt       DateTime      @default(now())
  modelRevision   ModelRevision @relation(fields: [modelRevisionId], references: [id], onDelete: Cascade)
  modelRevisionId String
  runSeconds      Float
  errors          String[]

  @@index([modelRevisionId])
}

model ModelVariableExportBuild {
  id              String        @id @default(cuid())

  ModelRevisionBuild   ModelRevisionBuild @relation(fields: [modelRevisionBuildId], references: [id], onDelete: Cascade)
  modelRevisionBuildId String

  modelVariableExport ModelVaribleExport @relation(fields: [modelVariableExportId], references: [id], onDelete: Cascade)
  modelVariableExportId String

  runSeconds      Float
  errors          String[]
  @@index([modelRevisionBuildId])
}

Later, we'll want to save information about the Spec statistics here, but this might be complicated, as different specs might save different statistics.