Skip to content

Latest commit

 

History

History
761 lines (622 loc) · 31.1 KB

domain-model.md

File metadata and controls

761 lines (622 loc) · 31.1 KB

SimpleAudit Studio — Domain Model

Status: current (matches the code)
Date: 2026-09-28

1. Core invariant

Every AuditRun must reference immutable inputs.

Once an audit is submitted, its effective scenario content, model configuration, judge, generation parameters, engine version, and runtime metadata are frozen. Later edits to scenarios, judges, models or connections must not alter historical runs.

This invariant must be enforced by schema design and service behavior, not only by convention.

2. Entity overview

erDiagram
    PROJECT ||--o{ PROJECT_MEMBERSHIP : has
    USER ||--o{ PROJECT_MEMBERSHIP : holds
    PROJECT ||--o{ SCENARIO : owns
    PROJECT ||--o{ SCENARIO_SET : owns
    PROJECT ||--o{ MODEL_CONNECTION : owns
    SCENARIO ||--o{ SCENARIO_REVISION : has
    SCENARIO_SET ||--o{ SCENARIO_SET_VERSION : publishes
    SCENARIO_SET_VERSION ||--o{ SCENARIO_SET_VERSION_ITEM : contains
    SCENARIO_REVISION ||--o{ SCENARIO_SET_VERSION_ITEM : pinned_by
    MODEL_CONNECTION ||--o{ REGISTERED_MODEL : serves
    PROJECT ||--o{ JUDGE : owns
    JUDGE ||--o{ JUDGE_VERSION : versions
    REGISTERED_MODEL ||--o{ AUDIT_RUN : "target / auditor / judge model"
    JUDGE_VERSION ||--o{ AUDIT_RUN : grades
    SCENARIO_SET_VERSION ||--o{ AUDIT_RUN : pinned_by
    EXPERIMENT ||--o{ EXPERIMENT_RUN : has
    AUDIT_RUN ||--o{ EXPERIMENT_RUN : "member of"
    EXPERIMENT ||--o{ MONITOR : groups
    MONITOR ||--o{ AUDIT_RUN : launches
    AUDIT_RUN ||--o{ SCENARIO_RESULT : produces
    AUDIT_RUN ||--o{ AUDIT_EVENT : emits
Loading

All tables use a core_ prefix (e.g. core_audit_run). SCENARIO_RESULT and AUDIT_EVENT reference the run by run_id (no foreign key) so the worker can write them without locking the run row.

3. Scenario domain

3.1 Scenario

Identity record for a scenario across revisions.

Fields:

  • id
  • project_id
  • key — stable slug/identity
  • title
  • category
  • tags
  • archived_at
  • created_by
  • created_at
  • updated_at

Rules:

  • key is unique within project.
  • Archiving does not delete because historical versions may reference it.

3.2 ScenarioRevision

Immutable content snapshot of a scenario.

Fields:

  • id
  • scenario_id
  • revision — monotonically increasing per scenario
  • description
  • expected_behavior — JSON list of expectations (see below)
  • test_prompt
  • metadata — JSON object
  • content_hash
  • created_by
  • created_at

Expectations (scenarios/expectations.py): each entry of expected_behavior is a plain string or an object {"id", "text", "required"}; only text is required. required: false marks an item that is graded and reported but never changes the derived severity. The flag is applied by the SimpleAudit engine in code; the judge model sees only the text. Entries are stored in their smallest form: a required item without an id stays a plain string, so scenarios that use no flags keep their old shape and hash. Changing a flag creates a new revision. Optional-by-wording (lines starting "Optionally", "May", "Kan nevne (ikke påkrevd)") is a legacy convention of older engines; the engine converts such strings when it re-grades old results.

Scenario notes: metadata.rationale (why the scenario exists and why the expected behaviour is right), metadata.clinical_assessment (a reviewer's clinical comment) and metadata.grounding_url (the sources the scenario is based on, one per line) are free text for people, set from the scenario form (scenarios.services.with_scenario_notes, 4000 characters each; a blank note has no key). No prompt carries them: of a scenario's metadata the engine renders only judge_notes. Like all metadata they belong to the revision, so changing one creates a new revision, and they travel with export and import. The Scenarios page shows them, and the result page shows them to workspace members (not on public experiment pages). A grounding line that is a web address or a DOI is a link that opens in a new tab; any other line stays text. The source_url of each fact in metadata.facts (the dated facts of a SimpleAudit pack, which the fact-check judge reads) is shown the same way, as "Fact sources"; no other metadata text is scanned for links. The list is for workspace members, but the facts are not: the engine copies them, with source_url, into judgment.scenario_metadata, and a public result shows them in its raw result, as it already does for JSON-imported facts.

Pack import: importing a SimpleAudit pack (infra.seed.import_scenario_pack) keeps each scenario's metadata, severity (as severity_ceiling), documents and decision block in its revision and in its content hash. It leaves out file_uri (in a pack an absolute path inside the installed package, so it differs between installs), and source, as_of, conversation, language, subcategory and schema_version, which a revision has no field for. A pack that is already imported is not changed: an existing set with a published version is skipped, and a set that was deleted gets its old revisions back when the pack is imported again, because scenarios are reused by key. Content the import did not keep earlier comes in only with a fresh import, in a project that has none of the pack's scenarios.

Rules:

  • rows are append-only
  • no UPDATE path in application API
  • content_hash covers all fields that affect execution
  • duplicate identical content may create a new revision but should be detectable

Execution-relevant metadata:

ScenarioRevision.content_hash (infra.hashing.scenario_revision_hash, the only implementation) covers:

  • description
  • expected_behavior
  • test_prompt
  • metadata.execution if present

All other metadata is display/organizational and excluded from the hash unless explicitly moved under metadata.execution. This prevents accidental semantic changes from labels or UI preferences.

3.3 ScenarioSet

Named collection of scenarios.

Fields:

  • id
  • project_id
  • name
  • description
  • created_by
  • created_at
  • updated_at

Rules:

  • mutable metadata only
  • membership is defined through versions, not direct mutable links

3.4 ScenarioSetVersion

Immutable published snapshot of a set.

Fields:

  • id
  • set_id
  • version — monotonically increasing per set
  • scenario_count
  • content_hash
  • shared_expectations — JSON list of expectations merged into every scenario of the version at run time (entries as in ScenarioRevision.expected_behavior)
  • published_by
  • published_at

Rules:

  • rows are append-only
  • content_hash is deterministic over ordered items and revision hashes, and covers shared_expectations when there are any (versions without shared expectations keep their old hash)
  • publishing without new shared expectations carries the latest version's over; changing them publishes a new version with every scenario's frozen revision (scenarios.services.set_shared_expectations)
  • the worker passes them to infra/engine.py, which merges them through the engine with source: "shared"; an engine without expectation objects gets the texts only, and every item then counts
  • audits reference this entity, never ScenarioSet directly

Drafts: on the Scenarios page "Save" publishes a version with the edit, and "Save draft" only adds the scenario revision. The set's drafts are then published together as one version, or discarded.

  • a scenario of the latest version has a draft when its newest revision differs in content from the one the version holds and no version of any set holds it (scenarios.services.pending_drafts). Nothing is stored for this
  • a revision does not record which set it was saved from: a draft of a scenario shared between sets shows in each of them, and is no draft anywhere once one of them publishes it. An edit another set published is not a draft here; this set keeps the revision it runs
  • every other publish (another scenario's edit, a delete, an import, shared expectations, a revert) keeps the revisions the latest version holds, so drafts stay pending
  • discarding deletes the scenario's revisions above the newest one any version holds (discard_drafts): they were never published, so no run used them. For a shared scenario this drops the draft in each set

3.5 ScenarioSetVersionItem

Ordered membership of a scenario revision in a set version.

Fields:

  • id
  • version_id
  • scenario_id
  • revision_id
  • position

Rules:

  • unique (version_id, scenario_id)
  • unique (version_id, position)
  • append-only after publish
  • position determines execution order if order matters

4. Model registry

4.1 ModelConnection

A provider endpoint: one base URL + auth that serves multiple models.

Fields:

  • id
  • project_id
  • name
  • provider
  • base_url
  • secret_reference
  • api_key_direct
  • enabled
  • created_by
  • created_at
  • updated_at

Rules:

  • unique (project_id, name)
  • raw credentials are never exposed via API responses
  • secret_reference names a secret in environment/vault/secret manager
  • connection changes do not affect existing runs (snapshots are frozen)

4.2 RegisteredModel

A specific model available under a connection.

Fields:

  • id
  • connection_id
  • project_id
  • display_name
  • model_id
  • description
  • model_revision
  • capabilities — JSON
  • default_parameters — JSON
  • enabled
  • created_at

Rules:

  • capabilities.decision — set by automatic detection when models are added on Connections → Discover models. Any OpenAI-compatible connection (Ollama, vLLM, …) is probed once per model with a 2-option question on {api-root}/v1/systemone (the System One endpoint shared by Ollama and vLLM): a 200 marks the model as a decision model, while a 400 "does not support decision" (Ollama) or 501 (vLLM) marks it as not one, with no inference spent either way. OpenRouter connections use the model-id prefix heuristic (typesafe/, jev) because its /v1/systemone endpoint is a paid proxy without a public model listing. Models can be used as decision targets, or as judge models for decision judges, only when this flag is true. The TypeSafe (Jev decision models) connection preset points at https://api.typesafe.ai/v1 with TYPESAFE_API_KEY.
  • unique (connection_id, model_id)
  • display name is user-facing; model_id is provider-specific
  • inherits auth from its connection

4.3 API keys

A connection authenticates with either api_key_direct (stored on the connection) or secret_reference, the name of an environment variable read at execution time (e.g. OPENAI_API_KEY). The direct key wins when both are set. Keys are never rendered into pages: the Connections page and model discovery look the connection up server-side (model_registry.services).

4.4 Judge and JudgeVersion (judges/)

A judge is how a run is graded. Judge holds the identity (project_id, name, description; unique per workspace). Each JudgeVersion is immutable and bundles the grading method. The model that grades is not part of it: runs and monitors pick a judge model separately, like target and auditor, so one judge can be compared across graders.

A judge prompt has two parts: the criteria (what to evaluate, plain words) and the output format (the JSON the judge returns, its schema, and the code that turns it into a severity). Users write criteria; formats come from SimpleAudit (simpleaudit.judges.compose).

  • base — the SimpleAudit judge the version starts from (simpleaudit.judges key: safety, harm, helpfulness, factuality, abstention, binary_abstention, checklist, …; default = SimpleAudit's unnamed default judge). The base's output format comes along, fields and post-processing included. "" = a generic format with the version's own criteria.
  • output — severity, score, binary, checklist or decision; with a base, the base's
  • criteria — blank means the base's criteria; required without a base
  • probe_prompt — how the auditor plays the user; blank means the base's (SimpleAudit's default without a base)
  • options — generic formats only: {"dimensions": [...]} for a score (each scored 1–10, the score is their average, computed in code), {"question": ..., "pass_when": bool} for a yes/no question (a wrong answer gets the scenario's designed severity, high when it has none)
  • note, created_by, created_at

judges.services.library_judge turns a version into what ModelAuditor(judge=) takes: an unedited base by name (exactly as the library runs it), edited criteria via customize_judge, a generic format via build_judge.

Rules:

  • saving a judge creates a new version only when base, output, criteria, probe prompt or options change; name and description are not versioned. Text equal to the base's is stored blank, so it keeps following the base
  • cloning starts a new judge whose history begins at v1
  • runs and monitors reference versions with RESTRICT, so a used judge can't be deleted
  • new workspaces start with one judge per SimpleAudit judge (the safety judge named "Safety Judge (SimpleAudit Default)"); the Judges page offers any that are missing

Decision judges

SimpleAudit's decision judges (output == "decision": decision_safety, decision_harm, decision_expectations, decision_abstention, decision_helpfulness) ask a decision model typed yes/no, choice and score questions and grade the answers in code. Their criteria are a read-only description of those rules: a version can't edit them.

  • a decision judge needs a decision judge model (capabilities.decision), and a decision judge model needs a decision judge. audits.services. judge_pairing_error refuses any other pair at run creation (judge_model_mismatch) and on New Experiment; the engine checks again for frozen runs. A decision target is graded by Choice Match, so the pair does not matter for it
  • the engine builds a DecisionJudgeClient from the frozen judge-model snapshot (infra.engine.decision_judge_client_for): OpenRouter's fixed System One URL, Ollama with its 64 KiB cap, any other connection at {base_url}/v1/systemone. The key comes from the connection's secret reference at execution time
  • the verdict carries judge_decision (served model version, every answer with its probabilities, uncertain questions, usage); run detail shows it as the Decision judge answers card, with low-confidence results flagged
  • the seed registers Jev (TypeSafe connection, TYPESAFE_API_KEY) as a decision model, and seed_demo_audits adds a demo run that re-grades the recorded safety baseline transcripts with the Decision Safety Judge on Jev, so a new workspace shows decision-model grading without an API key

5. Audit run

5.1 AuditRun

The scientific experiment record.

Fields:

  • id
  • project_id
  • name
  • status
  • scenario_set_version_id
  • target_model_id
  • auditor_model_id
  • judge_version_id — how the run is graded (criteria, output format, probe prompt)
  • judge_model_id — the model that grades
  • target_config_snapshot — JSON without secrets
  • auditor_config_snapshot — JSON without secrets
  • judge_config_snapshot — JSON without secrets; its judge key freezes the judge name, version, its spec (JudgeVersion.content(), what the engine builds the SimpleAudit judge from) and the criteria, judge and probe prompts resolved to full text
  • generation_parameters_snapshot — JSON
  • simpleaudit_version
  • git_commit
  • runtime_metadata — JSON
  • workflow_run_id
  • queued_at
  • started_at
  • finished_at
  • total_scenarios
  • completed_scenarios
  • successful_scenarios
  • failed_scenarios
  • retried_scenarios
  • summary_metrics — JSON (failures_by_role: failed scenarios per role, e.g. {"target": 44, "judge": 3})
  • error_code
  • error_message
  • experiments — many-to-many through ExperimentRun (a run can belong to several)
  • monitor_id — set when launched by a Monitor
  • created_by
  • created_at

Status enum:

queued
preparing
target_execution
auditing
judging
aggregation
report_generation
completed
failed
cancelled

Rules:

  • status transitions validated by service layer
  • terminal states are immutable; retry always creates a new AuditRun referencing the same immutable inputs
  • config snapshots never contain raw API keys; they keep connection_id and secret_reference, and the worker resolves the key at execution time (infra.engine.snapshot_api_key), so a rotated key applies to queued runs too
  • workers execute only from config snapshots and pinned scenario version
  • the target system prompt is a run setting: generation_parameters_snapshot.system_prompt
  • simpleaudit_version and git_commit must be non-null for production runs
  • worker must verify loaded SimpleAudit version/commit against the run manifest and fail with stable error SIMPLEAUDIT_VERSION_MISMATCH on mismatch
  • workflow_run_id links to execution system but is not authoritative domain state

Rejudge

Rejudge (the run page, POST /runs/<id>/rejudge/) grades a finished run's stored transcripts again with another judge or judge model, through SimpleAudit's rejudge. The source run never changes: the result is a new AuditRun (audits.services.create_rejudge_run).

  • the new run keeps the source's scenario set version and its target, auditor, agent and generation snapshots, and freezes its own judge; runtime_metadata.rejudged_from ({run_id, name}) names the source
  • the worker reads each transcript from the source run's ScenarioResult and calls only the judge (infra.engine.rejudge_result), with the request parameters a live run would send it. Target and auditor tokens are the source's; judge tokens are the new run's
  • the new run has a result for exactly the scenarios the source has one for (total_scenarios counts them); a scenario the source never ran is skipped
  • a source result without a complete transcript (the scenario failed before or during the conversation) is not graded: it stays failed, with the source's failure marked not retryable
  • repeated scenarios are graded per repetition and aggregated again
  • not offered for active runs, decision targets (graded in code against the scenario), traced runs (their judge also read the trace, which a rejudge cannot show the new judge), or with decision judges, decision judge models and Choice Match (SimpleAudit cannot rejudge with them)
  • for a run that cannot be rejudged, the run page shows the control greyed out with the reason (audits.services.rejudge_block_reason)
  • scenario judge notes are not stored on results, so a rejudge does not apply them

5.2 Experiment

A named set of runs compared together, usually launched from one design on New Experiment (/experiments/new/). Every design input (scenario sets, target, auditor, judge model, judges, max turns, language) takes one or more values; the cartesian product is the list of runs, each an ordinary AuditRun added as a member. The review step can drop, rename, edit (settings, system prompt and generation config) or duplicate runs before launch. A design that yields a single run still becomes an Experiment: a singleton with no factors, so every launch from New Experiment has its own shareable results page.

Membership is editable after launch. On the experiment page admins and auditors can add workspace runs (including runs already in other experiments, which stay there too) or remove runs (the runs themselves are kept); a run page can add the run to an existing experiment. Runs and their frozen inputs never change; only membership does.

Fields: project_id, name, visibility, created_by, timestamps. runs is many-to-many through ExperimentRun (experiment_id, run_id, added_by, added_at; unique per pair). factors — the inputs that differ across the member runs — is computed on read, so it follows membership edits.

Rules:

  • at most 50 runs per experiment (at launch and when adding)
  • runs are created atomically (all or none)
  • only runs of the experiment's own workspace can be added
  • adding/removing runs: workspace admins and auditors; on a public experiment, admins only and with an explicit confirmation, since adding a run publishes it (a run is publicly readable when any experiment it belongs to is public)
  • deleting an experiment removes only the grouping: its runs, results and monitors are kept (monitors are detached); same permissions as editing membership
  • runs repeated by the experiment's own monitor are not removed one by one (the next tick would add a new one); pause or delete the monitor instead
  • results compare the latest run of each run setup by default; pooling all runs is opt-in, since pooling hides drift

5.3 Monitor

One run setup repeated on a schedule to track drift. Created from New Experiment when Repeat is not "Once" (one monitor per run setup, linked to the experiment if there is one). Each tick creates an ordinary AuditRun with monitor_id, added to the monitor's experiment.

Fields: project_id, name, enabled, scenario_set_id with an optional pinned scenario_set_version_id, target, auditor and judge model ids, judge_id with an optional pinned judge_version_id (empty = the judge's latest version at each tick), generation_parameters (same shape as the run snapshot), timing (interval_hours, or cron_expression read in timezone), next_run_at, last_run_id, last_tick_at, last_error, experiment_id, created_by.

Rules:

  • the worker's sweeper ticks due monitors every pass (manage.py run_monitors does one pass for an external cron); claims use select_for_update(skip_locked)
  • missed ticks are skipped, not replayed; a tick is skipped while the previous run of that monitor is still active
  • creating or running a monitor needs admin or auditor; each tick re-checks the creator's role and pauses the monitor if it was lost
  • at most 50 monitors per workspace; fixed intervals are 6 hours to 90 days, cron expressions have no minimum
  • the drift baseline resets when the scenario set version, judge version or judge model changes

5.4 Reproducibility manifest

Derived from AuditRun and pinned entities:

{
  "simpleaudit_version": "...",
  "git_commit": "...",
  "scenario_set": {
    "id": 1,
    "version": 3,
    "content_hash": "sha256:..."
  },
  "scenarios": [
    {
      "scenario_id": 10,
      "revision": 2,
      "content_hash": "sha256:..."
    }
  ],
  "target": {},
  "auditor": {},
  "judge": {},
  "generation_parameters": {},
  "runtime_metadata": {}
}

The manifest must be downloadable and stable.

6. Results and events (audits/events.py)

6.1 ScenarioResult

One row per (run, scenario version item), upserted by the worker.

Fields: run_id, version_item_id, status, attempts (the highest attempt seen; retries never lower it), result (JSON: judgment, severity, transcript summary; with repetitions reps, aggregated_severity, agreement_rate), list_summary (a small projection for list pages; with shared expectations it holds shared_checks, the per-trial status of each shared rule, which the run page's "Shared checks" panel sums), updated_at. Unique on (run_id, version_item_id).

6.2 AuditEvent

Append-only progress log that drives live progress (SSE) and the run page.

Fields: run_id, version_item_id ("_run" for run-level events), kind (e.g. scenario_attempted, run_completed, run_failed, run_cancelled, finalize_waiting), payload (JSON), created_at.

6.3 HumanLabel

A reviewer's own verdict on one judged transcript, given on the result page: the reference a judge is checked against.

Fields: result_id, rep (the repetition number the result page shows; 1 for a scenario run once), scale, verdict, comment, blind, created_by, timestamps. Unique on (result_id, rep, scale, created_by).

scale is one of SimpleAudit's calibration scales, and verdict one of its levels or unsure:

scale levels used for runs graded by
severity pass, low, medium, high, critical every judge without a verdict scale
pass_fail pass, fail the Pass/Fail judge and judges based on it
pass_medium_fail pass, medium, fail the Pass/Medium/Fail judge and judges based on it

The scales and levels come from SimpleAudit (infra.engine.label_scale), so Studio keeps no list of them.

Rules:

  • a label is on the scale of the judge that graded the run it is given in (audits.labels.run_scale). On a pass/fail scale the form shows the rules that judge is given: its criteria and what each level means
  • one label per reviewer, transcript and scale; saving again replaces it, and a blank label removes it. Several reviewers can label the same transcript
  • labelling needs admin or auditor; every workspace member can read labels. They are not shown on public pages
  • a label is kept on the result that first held the transcript. A rejudged run grades its source's transcripts, so it shows the source's labels and adds to them (audits.labels.origin_result). When the rejudge used a judge on another scale, its labels are kept beside the source's
  • unsure records that a reviewer looked and could not decide
  • the result page shows the judge's verdict next to the form, so labels given there are not blind the way simpleaudit calibrate <judge> label is
  • review mode (/runs/<id>/review/, /runs/<id>/results/<rid>/review/) is a result page built for labelling: label buttons, then the conversation (with the steps an agent or retrieval run took), then the scenario. The judge's part of a transcript and other reviewers' labels stay out until the reviewer has labelled it; the combined verdict until every repetition that can be labelled has their label
  • blind is true for a label saved in review mode before the reveal. Changing its verdict afterwards makes it false; a comment leaves it as it is. Labels from the normal result page are false. It records what the page showed, not what the reviewer may have seen elsewhere. The calibration page says how many of the labels it compares were blind

Judge calibration

/runs/<id>/calibration/ scores judges against the human labels with SimpleAudit's calibration module (audits.labels.calibration, infra.engine.calibrate_judges). Nothing is stored and no model is called.

  • one row per run that graded the same transcripts: the run that produced them and every rejudge of it. Label once, rejudge with another judge, and compare the rows
  • everything is compared on the scale of the judge whose run the page is opened from. SimpleAudit reads a severity as a level of a pass/fail scale (pass stays pass; on pass_fail every other level is fail), so a severity judge and labels given on the ladder count on a pass/fail page. A pass/fail judge is read by its verdict there (ScenarioResult.list_summary keeps it), and on the ladder by the severity derived from it
  • nothing reads the other way: a label given on a pass/fail scale is left out of a ladder page and counted, and a pass_fail judge gets a row without numbers on a pass_medium_fail page
  • a reviewer's label on the page's scale wins over their label read from another scale
  • the unit is one transcript (a scenario, or one repetition of it). With several reviewers the reference is their median label; unsure leaves a transcript out
  • each row gives the share of transcripts on the same level (with a 95% interval), how often the judge was stricter or more lenient and, from 10 compared transcripts, Gwet's AC2 (AC1 on two levels). On more than two levels it adds the share within one level and the severe misses (on the ladder: reference high or critical, judge pass or low)
  • a labelled transcript the judge has no verdict for (error, ungraded, not run) is counted apart, not as a disagreement
  • below the rows, the reviewers' label against this run's judge as a cross table (reviewers' median label by judge verdict, with totals), counted over the compared transcripts (audits.labels.label_overview). A cell links to its transcripts. The page says how many of the run's transcripts are labelled and how many are labelled Unsure only; the numbers describe the labelled transcripts, not the run
  • the list of every labelled transcript gives both verdicts, each reviewer's label and comment, and a link to the result; /runs/<id>/calibration/labels.csv downloads the same rows. Both are for workspace members

7. Comparison

/compare/?runs=a,b,… compares completed runs on the scenarios they share (audits/comparison.py). Nothing is stored. The page shows every input that differs between runs (models, scenario set version, engine version, generation parameters, judge, system prompt) and warns when the judge or auditor differs, since judge effects can dominate target-model effects.

8. User preferences

User.preferences (JSON) holds per-user UI settings written through POST /me/preferences/ (a whitelist of keys, 20 KB cap). Today: dashboard_columns, the dashboard grid's column order, visibility and widths.

9. Users and authorization

Minimum MVP:

  • User
  • Project
  • ProjectMembership

Roles:

  • admin
  • auditor
  • viewer

Permissions:

Action admin auditor viewer
view workspace resources and results yes yes yes
create/edit scenarios, publish versions yes yes no
manage model connections and models yes yes no
launch runs and experiments, create monitors yes yes no
add/remove runs of, or delete, a private experiment yes yes no
add/remove runs of, or delete, a public experiment (with confirmation) yes no no
cancel, archive, rename runs yes yes no
manage any monitor yes own only no
manage members, rename/delete workspace yes no no

Superusers can do everything, in every workspace. Archived workspaces are read-only for everyone except superusers. The UI and the API enforce the same rule (infra.ui.write_block_reason, require_project_role).

10. Migrations

One 0001_initial per app (the schema was reset before release) plus later additive migrations. The HF Space and Compose web service run migrate on start.

11. SimpleAudit compatibility

The platform must preserve existing SimpleAudit semantics:

  • Target → Auditor → Judge
  • scenario description/expected behavior/test prompt meanings
  • severity labels
  • judgment structure
  • token accounting
  • result aggregation

Any change to these semantics needs regression tests against existing expected outputs.

Scenario failure attribution

A failed ScenarioResult stores a structured failure object beside the raw error text (top level of the result, and on each failed repetition). role (target | auditor | judge | system) is the only required field; kind (rate_limit, unavailable, auth, timeout, bad_response, config, unknown), message, http_status, endpoint, model, retryable and attempt are best effort and omitted when unknown. The role comes from the engine's error_phase plus the last phase the engine reported through on_turn, so it needs no target cooperation; the model is never assumed (the endpoint is shown when the model is unknown). A judge endpoint failure is a failed scenario, not an UNCERTAIN verdict. Results stored without failure render as before. Code: audits/failures.py.