Skip to main content

fill_result_values

Function fill_result_values 

Source
pub async fn fill_result_values(
    st: &AppState,
    me: &Actor,
    revision_id: Uuid,
    wanted: &str,
    limits: &str,
    files: &[String],
) -> AppResult<(Run, usize)>
Expand description

Fill with AI… on the Results card: asks the assistant to propose result values of a simulation revision from its reports, as drafts (never as results). wanted names the values to extract (empty = every key number), limits is the user’s own note on limits, files the report files to read (empty = all). Returns the run and the number of proposals it created.

§Invariants

  • Permission: the assistant must be configured (Disabled/404); the revision must be readable (hidden = missing, 404) and its group must not have switched the assistant interface off (404, like a hidden group); the actor must be an editor of the group (403). Pressing the button is the request for drafts, so they are allowed for this run; accepting stays a separate step that needs a check-out.
  • Validation: the revision is a simulation; texts are capped (MAX_QUESTION_CHARS, MAX_LIMITS_CHARS); every named file is a file of this revision (400 otherwise).
  • Steps: the run is not one transaction; the proposals are written by the propose_result_values tool in its own transaction.
  • Audit: assistant.run as for every run (action, text length, tools, tokens – never the text or the answer).
  • Notifications / webhooks: none.