kranz-engine 0.4.0

Governed mission engine for auditable AI coding-agent work.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
//! Versioned display mapping over recorded causes. Never an execution policy.
use crate::events::{Event, EventKind};
use crate::gate_evaluation::{lifecycle, protocol};
use crate::live_permission::Actor;
use crate::types::{BlockCause, BlockContext, BlockOwner, MissionStatus, RunResult};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};

pub const MAPPING_VERSION: u32 = 1;

pub fn render_text(report: &Report) -> String {
    use std::fmt::Write as _;
    let safe = |text: &str| {
        text.chars()
            .map(|c| if c.is_control() { ' ' } else { c })
            .collect::<String>()
    };
    let mut out = format!(
        "Recorded outcome reasons (mapping v{})\n{}\n",
        report.mapping_version, report.selection
    );
    let _ = writeln!(
        out,
        "Window: {} → {}",
        report
            .from
            .map(|d| d.to_rfc3339())
            .unwrap_or_else(|| "all history".into()),
        report
            .through
            .map(|d| d.to_rfc3339())
            .unwrap_or_else(|| "latest recorded event".into())
    );
    if report.missions.is_empty() {
        out.push_str("No missions in this activity window.\n");
    }
    for class in &report.task_classes {
        let _ = writeln!(
            out,
            "  {}: {} missions; {} mixed; {} with unresolved requests or blocks",
            safe(&class.task_class),
            class.missions,
            class.mixed_missions,
            class.unresolved_missions
        );
        for count in &class.counts {
            let _ = writeln!(
                out,
                "    {}: {}/{} missions, {} observations",
                count.category.label(),
                count.missions,
                class.missions,
                count.observations
            );
        }
    }
    for mission in &report.missions {
        let _ = writeln!(
            out,
            "  {}: current state {}",
            safe(&mission.mission_id),
            mission
                .current_status
                .map(|s| serde_json::to_string(&s).unwrap_or_default())
                .unwrap_or_else(|| "unknown".into())
        );
        for row in &mission.observations {
            let _ = writeln!(
                out,
                "    event #{} [{}; {:?}] {}: {}",
                row.seq,
                row.category.label(),
                row.state,
                row.event_type,
                safe(&row.detail)
            );
            let _ = writeln!(out, "      milestone={:?} feature={:?} run={:?} attempt={:?} stage={:?} permission={:?} actor={:?} resolution-event={:?}", row.milestone_id, row.feature_id, row.run_id, row.attempt_id, row.stage, row.permission_request_id, row.actor, row.resolution_seq);
        }
    }
    if !report.unavailable_logs.is_empty() {
        let _ = writeln!(
            out,
            "Unavailable logs (excluded): {}",
            safe(&report.unavailable_logs.join(", "))
        );
    }
    out
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Category {
    ReportedDefect,
    EnvironmentPrerequisite,
    HumanPolicyBoundary,
    Interrupted,
    Cancelled,
    Unknown,
}
impl Category {
    pub fn label(self) -> &'static str {
        match self {
            Self::ReportedDefect => "reported defect",
            Self::EnvironmentPrerequisite => "environment prerequisite",
            Self::HumanPolicyBoundary => "human/policy boundary",
            Self::Interrupted => "interrupted",
            Self::Cancelled => "cancelled",
            Self::Unknown => "unknown",
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum ResolutionState {
    Recorded,
    Unresolved,
    Resolved,
    Closed,
    Expired,
    Superseded,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Observation {
    pub seq: u64,
    pub ts: DateTime<Utc>,
    pub event_type: String,
    pub category: Category,
    pub detail: String,
    pub state: ResolutionState,
    pub resolution_seq: Option<u64>,
    pub milestone_id: Option<String>,
    pub feature_id: Option<String>,
    pub run_id: Option<String>,
    pub attempt_id: Option<String>,
    pub permission_request_id: Option<String>,
    pub stage: Option<protocol::Stage>,
    pub actor: Option<Actor>,
    pub block_context: Option<BlockContext>,
    pub deadline: Option<DateTime<Utc>>,
}
impl Observation {
    fn new(event: &Event, category: Category, detail: &str) -> Self {
        Self {
            seq: event.seq,
            ts: event.ts,
            event_type: event.kind.type_name().into(),
            category,
            detail: crate::scrub::scrub_and_truncate(detail, 4096),
            state: ResolutionState::Recorded,
            resolution_seq: None,
            milestone_id: None,
            feature_id: None,
            run_id: None,
            attempt_id: None,
            permission_request_id: None,
            stage: None,
            actor: None,
            block_context: None,
            deadline: None,
        }
    }
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MissionReasons {
    pub mapping_version: u32,
    pub mission_id: String,
    pub task_class: String,
    /// The existing reducer's status, never a replacement outcome taxonomy.
    pub current_status: Option<MissionStatus>,
    pub latest_event_at: Option<DateTime<Utc>>,
    pub latest_event_seq: Option<u64>,
    pub observations: Vec<Observation>,
}

fn block_category(context: Option<BlockContext>) -> Category {
    match context {
        Some(BlockContext {
            owner: BlockOwner::Engine,
            cause: BlockCause::Authentication,
        }) => Category::EnvironmentPrerequisite,
        Some(BlockContext {
            owner: BlockOwner::Operator,
            cause: BlockCause::Operator,
        }) => Category::HumanPolicyBoundary,
        Some(BlockContext {
            owner: BlockOwner::Engine,
            cause:
                BlockCause::Grant
                | BlockCause::SecretScan
                | BlockCause::UntrustedValidator
                | BlockCause::ValidatorTamper
                | BlockCause::ReviewerIndependence,
        }) => Category::HumanPolicyBoundary,
        // A workspace check or generic validation failure can be infrastructure
        // or defective work. Neither the owner nor its prose establishes which.
        _ => Category::Unknown,
    }
}

fn resolve(
    rows: &mut [Observation],
    pending: &mut BTreeMap<String, usize>,
    key: &str,
    seq: u64,
    state: ResolutionState,
) {
    if let Some(index) = pending.remove(key) {
        rows[index].state = state;
        rows[index].resolution_seq = Some(seq);
    }
}

/// Inputs already belong to one mission and are in log order. Unknown reducer
/// state makes attribution untrusted; the projection still exposes provenance.
pub(super) fn mission(
    mission_id: &str,
    events: &[&Event],
    status: Option<MissionStatus>,
    task_class: Option<&str>,
) -> MissionReasons {
    let mut rows = Vec::new();
    let mut pending = BTreeMap::new();
    let mut attempts = BTreeMap::new();
    let mut runs = BTreeMap::new();
    let mut permissions = BTreeMap::new();
    for event in events {
        let mut key = None;
        let mut row = match &event.kind {
            EventKind::WorkerSpawned { run_id, feature_id, milestone_id, role, .. } => {
                runs.insert(run_id.as_str(), (feature_id.clone(), milestone_id.clone(), *role));
                continue;
            }
            EventKind::MilestoneBlocked { milestone_id, reason, block_context } => {
                key = Some(format!("block:{milestone_id}"));
                let mut row = Observation::new(event, block_category(*block_context), reason);
                row.milestone_id = Some(milestone_id.clone());
                row.block_context = *block_context;
                row
            }
            EventKind::MilestoneUnblocked { milestone_id, .. } | EventKind::MilestoneCompleted { milestone_id, .. } => {
                resolve(&mut rows, &mut pending, &format!("block:{milestone_id}"), event.seq, ResolutionState::Resolved);
                continue;
            }
            EventKind::ValidationFinding { milestone_id, run_id, finding } => {
                let category = if run_id == crate::reducer::ENGINE_RUN_ID && finding.class == "out-of-contract-write" {
                    Category::HumanPolicyBoundary
                } else if runs.get(run_id.as_str()).is_some_and(|(_, _, role)| matches!(role, crate::types::Role::ValidatorScrutiny | crate::types::Role::ValidatorFunctional)) {
                    Category::ReportedDefect
                } else {
                    // In particular, a native command-assertion failure does
                    // not distinguish a broken implementation from setup.
                    Category::Unknown
                };
                let mut row = Observation::new(event, category, &format!("{}: {}", finding.subject, finding.evidence));
                row.milestone_id = Some(milestone_id.clone());
                row.run_id = Some(run_id.clone());
                row.stage = Some(protocol::Stage::MilestoneValidation);
                row
            }
            EventKind::ValidatorTamper { milestone_id, run_id, .. } => {
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, "Validator isolation tripwire recorded checkout or metadata drift.");
                row.milestone_id = Some(milestone_id.clone());
                row.run_id = Some(run_id.clone());
                row
            }
            EventKind::WorkerCompleted { run_id, result, .. } if *result != RunResult::Pass => {
                let mut row = Observation::new(event, Category::Unknown, "A non-passing worker result does not identify its cause.");
                row.run_id = Some(run_id.clone());
                row
            }
            EventKind::FeatureFailed { feature_id, reason, .. } => {
                let mut row = Observation::new(event, Category::Unknown, reason);
                row.feature_id = Some(feature_id.clone());
                row
            }
            EventKind::GateResult { verdict: crate::gate::GateVerdict::Fail, surface, gate, .. } => {
                let mut row = Observation::new(event, Category::Unknown, &format!("Non-passing gate {gate}; this event does not distinguish a defect from unavailable evidence or execution failure."));
                row.stage = Some(match surface {
                    crate::gate::GateSurface::Approval => protocol::Stage::PlanApproval,
                    crate::gate::GateSurface::FinalGate => protocol::Stage::FinalGate,
                });
                row
            }
            EventKind::GrantRequested { milestone_id, command, .. } => {
                key = Some("grant".into());
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, command);
                row.milestone_id = Some(milestone_id.clone());
                row
            }
            EventKind::GrantApproved { .. } => {
                resolve(&mut rows, &mut pending, "grant", event.seq, ResolutionState::Resolved);
                continue;
            }
            EventKind::GrantDenied { reason, .. } => {
                resolve(&mut rows, &mut pending, "grant", event.seq, ResolutionState::Resolved);
                Observation::new(event, Category::HumanPolicyBoundary, reason)
            }
            EventKind::PermissionRequested { request } => {
                permissions.insert(request.proposal.id.as_str(), request.binding.run_id.as_str());
                key = Some(format!("permission:{}", request.proposal.id));
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, request.proposal.prohibition.as_deref().unwrap_or("One-call permission requested; no decision recorded yet."));
                row.run_id = Some(request.binding.run_id.clone());
                row.permission_request_id = Some(request.proposal.id.clone());
                row.stage = Some(protocol::Stage::CommandPermission);
                row.deadline = Some(request.proposal.deadline);
                row
            }
            EventKind::PermissionResolved { resolution } => {
                resolve(&mut rows, &mut pending, &format!("permission:{}", resolution.request_id), event.seq, ResolutionState::Resolved);
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, &resolution.reason);
                row.actor = Some(resolution.actor.clone());
                row.permission_request_id = Some(resolution.request_id.clone());
                row.run_id = permissions.get(resolution.request_id.as_str()).map(|s| (*s).into());
                row.stage = Some(protocol::Stage::CommandPermission);
                row
            }
            EventKind::PermissionClosed { request_id, .. } => {
                resolve(&mut rows, &mut pending, &format!("permission:{request_id}"), event.seq, ResolutionState::Closed);
                continue;
            }
            EventKind::PlanRevisionProposed { instructions, .. } => {
                key = Some("revision".into());
                Observation::new(event, Category::HumanPolicyBoundary, instructions)
            }
            EventKind::PlanRevised { .. } | EventKind::PlanRevisionRejected { .. } => {
                resolve(&mut rows, &mut pending, "revision", event.seq, ResolutionState::Resolved);
                continue;
            }
            EventKind::QuestionOpened { question_id, text, run_id, feature_id, milestone_id, .. } => {
                key = Some(format!("question:{question_id}"));
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, text);
                row.run_id = run_id.clone(); row.feature_id = feature_id.clone(); row.milestone_id = milestone_id.clone();
                row
            }
            EventKind::QuestionAnswered { question_id, .. } | EventKind::QuestionCleared { question_id, .. } => {
                resolve(&mut rows, &mut pending, &format!("question:{question_id}"), event.seq,
                    if matches!(event.kind, EventKind::QuestionAnswered { .. }) { ResolutionState::Resolved } else { ResolutionState::Closed });
                continue;
            }
            EventKind::GateEvaluationRequested { evaluation } => {
                attempts.insert(evaluation.request.params.attempt_id.as_str(), evaluation.as_ref());
                continue;
            }
            EventKind::GateEvaluationFinished { evaluation } => {
                let request = attempts.get(evaluation.attempt_id.as_str());
                let (category, detail) = match &evaluation.outcome {
                    lifecycle::Outcome::Error { message } => (Category::Unknown, message.as_str()),
                    lifecycle::Outcome::Evaluated { result, .. } if result.status == protocol::Status::Escalate => (Category::HumanPolicyBoundary, result.rationale.as_str()),
                    lifecycle::Outcome::Evaluated { result, .. } if result.verdict == Some(protocol::Verdict::Fail) => {
                        let defect = request.is_some_and(|r| r.policy.kind == crate::pack::evaluator::Kind::Judgment)
                            && result.findings.as_ref().is_some_and(|f| !f.is_empty());
                        (if defect { Category::ReportedDefect } else { Category::Unknown }, result.rationale.as_str())
                    }
                    _ => continue,
                };
                let mut row = Observation::new(event, category, detail);
                row.attempt_id = Some(evaluation.attempt_id.as_str().into());
                row.stage = request.map(|r| r.request.params.stage);
                row
            }
            EventKind::GateResolutionRecorded { resolution } if resolution.disposition != lifecycle::Disposition::Proceed => {
                if resolution.disposition == lifecycle::Disposition::RequireHuman {
                    key = Some(format!("gate:{}", resolution.attempt_id.as_str()));
                }
                let mut row = Observation::new(event, Category::HumanPolicyBoundary, &resolution.rationale);
                row.attempt_id = Some(resolution.attempt_id.as_str().into());
                row.stage = attempts.get(resolution.attempt_id.as_str()).map(|r| r.request.params.stage);
                row.actor = resolution.consent.as_ref().map(|c| c.actor.clone());
                row
            }
            EventKind::GateResolutionConsumed { consumption } => {
                resolve(&mut rows, &mut pending, &format!("gate:{}", consumption.attempt_id.as_str()), event.seq, ResolutionState::Resolved);
                continue;
            }
            EventKind::GateEvaluationClosed { attempt_id, .. } => {
                resolve(&mut rows, &mut pending, &format!("gate:{}", attempt_id.as_str()), event.seq, ResolutionState::Closed);
                continue;
            }
            EventKind::MissionPaused {} | EventKind::UserMessage { interrupt: true, .. } => Observation::new(event, Category::Interrupted, "An explicit pause or interrupt was recorded; its underlying cause is not inferred."),
            EventKind::MissionAbandoned { reason } => Observation::new(event, Category::Cancelled, reason),
            EventKind::MissionFailed { reason } => Observation::new(event, Category::Unknown, reason),
            EventKind::MissionCompleted {} => {
                for index in std::mem::take(&mut pending).into_values() {
                    rows[index].state = ResolutionState::Closed;
                    rows[index].resolution_seq = Some(event.seq);
                }
                continue;
            }
            _ => continue,
        };
        if let Some((feature, milestone, _)) = row.run_id.as_deref().and_then(|id| runs.get(id)) {
            row.feature_id = row.feature_id.or_else(|| feature.clone());
            row.milestone_id = row.milestone_id.or_else(|| milestone.clone());
        }
        if let Some(key) = key {
            row.state = ResolutionState::Unresolved;
            if let Some(previous) = pending.insert(key, rows.len()) {
                rows[previous].state = ResolutionState::Superseded;
                rows[previous].resolution_seq = Some(event.seq);
            }
        }
        if matches!(
            event.kind,
            EventKind::MissionFailed { .. } | EventKind::MissionAbandoned { .. }
        ) {
            for index in std::mem::take(&mut pending).into_values() {
                rows[index].state = ResolutionState::Closed;
                rows[index].resolution_seq = Some(event.seq);
            }
        }
        rows.push(row);
    }
    if let Some(latest) = events.last() {
        for row in &mut rows {
            if row.state == ResolutionState::Unresolved
                && row.deadline.is_some_and(|d| d <= latest.ts)
            {
                row.state = ResolutionState::Expired;
            }
        }
    }
    if status.is_none() {
        for row in &mut rows {
            row.category = Category::Unknown;
        }
        if let Some(event) = events.last() {
            rows.push(Observation::new(event, Category::Unknown, "The existing reducer cannot establish mission state from this log; cause attribution is untrusted."));
        }
    }
    MissionReasons {
        mapping_version: MAPPING_VERSION,
        mission_id: mission_id.into(),
        task_class: task_class.unwrap_or(super::UNCLASSIFIED_TASK_CLASS).into(),
        current_status: status,
        latest_event_at: events.last().map(|e| e.ts),
        latest_event_seq: events.last().map(|e| e.seq),
        observations: rows,
    }
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Count {
    pub category: Category,
    pub missions: u64,
    pub observations: u64,
    pub share: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClassCounts {
    pub task_class: String,
    pub missions: u64,
    pub mixed_missions: u64,
    pub unresolved_missions: u64,
    pub counts: Vec<Count>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Report {
    pub mapping_version: u32,
    pub from: Option<DateTime<Utc>>,
    pub through: Option<DateTime<Utc>>,
    pub selection: String,
    pub missions: Vec<MissionReasons>,
    pub task_classes: Vec<ClassCounts>,
    pub unavailable_logs: Vec<String>,
}

/// Cohort by latest recorded activity; retain the full history of each selected
/// mission so a repair never erases an earlier cause or inflates the denominator.
pub fn report(
    mut missions: Vec<MissionReasons>,
    unavailable_logs: Vec<String>,
    window: Option<(u64, DateTime<Utc>)>,
) -> anyhow::Result<Report> {
    let (from, through) = match window {
        Some((days, now)) => {
            anyhow::ensure!(
                days <= super::MAX_MERGED_CHANGE_WINDOW_DAYS,
                "outcome reason window exceeds {} days",
                super::MAX_MERGED_CHANGE_WINDOW_DAYS
            );
            (
                Some(
                    now.checked_sub_signed(chrono::Duration::days(days as i64))
                        .ok_or_else(|| anyhow::anyhow!("outcome reason window underflow"))?,
                ),
                Some(now),
            )
        }
        None => (None, None),
    };
    missions.retain(|m| {
        window.is_none()
            || m.latest_event_at
                .is_some_and(|at| Some(at) >= from && Some(at) <= through)
    });
    missions.sort_by(|a, b| a.mission_id.cmp(&b.mission_id));
    let mut classes: BTreeMap<String, ClassCounts> = BTreeMap::new();
    for mission in &mut missions {
        if let Some(now) = through {
            for row in &mut mission.observations {
                if row.state == ResolutionState::Unresolved
                    && row.deadline.is_some_and(|d| d <= now)
                {
                    row.state = ResolutionState::Expired;
                }
            }
        }
        let class = classes
            .entry(mission.task_class.clone())
            .or_insert_with(|| ClassCounts {
                task_class: mission.task_class.clone(),
                missions: 0,
                mixed_missions: 0,
                unresolved_missions: 0,
                counts: vec![],
            });
        class.missions += 1;
        let categories: BTreeSet<_> = mission.observations.iter().map(|r| r.category).collect();
        class.mixed_missions += u64::from(categories.len() > 1);
        class.unresolved_missions += u64::from(
            mission
                .observations
                .iter()
                .any(|r| r.state == ResolutionState::Unresolved),
        );
        for category in categories {
            let index = class
                .counts
                .iter()
                .position(|c| c.category == category)
                .unwrap_or_else(|| {
                    class.counts.push(Count {
                        category,
                        missions: 0,
                        observations: 0,
                        share: None,
                    });
                    class.counts.len() - 1
                });
            class.counts[index].missions += 1;
            class.counts[index].observations += mission
                .observations
                .iter()
                .filter(|r| r.category == category)
                .count() as u64;
        }
    }
    let mut task_classes: Vec<_> = classes.into_values().collect();
    task_classes.sort_by_key(|c| {
        (
            c.task_class == super::UNCLASSIFIED_TASK_CLASS,
            c.task_class.clone(),
        )
    });
    for class in &mut task_classes {
        class.counts.sort_by_key(|c| c.category);
        for count in &mut class.counts {
            count.share = Some(count.missions as f64 / class.missions as f64);
        }
    }
    Ok(Report { mapping_version: MAPPING_VERSION, from, through,
        selection: "Missions whose latest recorded event is within the inclusive window; counts cover their full recorded history. Categories overlap. Unavailable logs are excluded; completion is not release or deployment.".into(),
        missions, task_classes, unavailable_logs })
}