newt-core 0.8.0

Newt-Agent core types, errors, and the NeMoCode-style tier router
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
use super::*;

// ---- #719: read_file payload window/cap/pagination (pure, no fs) ----

#[test]
fn paginate_read_caps_a_large_file_to_the_default_window() {
    // A 15k-line file must NOT flood the model: default window is 2000 lines
    // with a footer to continue (regression for the 12.5k→168k saturation).
    let body: String = (1..=15_057)
        .map(|n| format!("line {n}"))
        .collect::<Vec<_>>()
        .join("\n");
    let out = paginate_read(&body, None, None, DEFAULT_MAX_OUTPUT_TOKENS);
    let lines: Vec<&str> = out.lines().collect();
    assert_eq!(lines[0], "line 1");
    assert_eq!(lines[1999], "line 2000");
    assert!(
        !out.contains("line 2001"),
        "window stops at 2000: {:?}",
        &out[..40]
    );
    assert!(out.contains("of 15057"), "footer names the total");
    assert!(
        out.contains("offset=2001"),
        "footer points at the next window"
    );
}

#[test]
fn paginate_read_offset_and_limit_return_just_that_window() {
    let body: String = (1..=100)
        .map(|n| format!("L{n}"))
        .collect::<Vec<_>>()
        .join("\n");
    let out = paginate_read(&body, Some(10), Some(5), DEFAULT_MAX_OUTPUT_TOKENS);
    assert!(out.starts_with("L10\nL11\nL12\nL13\nL14"), "{out:?}");
    assert!(out.contains("offset=15"), "continues at line 15: {out:?}");
}

#[test]
fn paginate_read_small_file_is_returned_verbatim_without_a_footer() {
    // Whole-file read that fits both caps → exact bytes, no footer.
    assert_eq!(
        paginate_read("a\nb\nc\n", None, None, DEFAULT_MAX_OUTPUT_TOKENS),
        "a\nb\nc\n"
    );
}

#[test]
fn paginate_read_char_backstop_tracks_the_token_budget() {
    // #726: the char backstop is now token-derived (budget × chars/token),
    // NOT a hardcoded 100k. Two lines, the first enormous: the line window
    // can't help; the token-derived char backstop must. With a 1000-token
    // budget the backstop is ~4000 chars.
    //
    // #2563 (round 2): round 1 emitted an over-budget single line WHOLE,
    // which is unbounded with offload off and re-spills forever with offload
    // on. Every page — including the single-oversized-line case — MUST stay
    // under the char cap; the model resumes mid-line via the footer's
    // `char_offset` (checked below), never by an unbounded whole-line page.
    let budget = 1_000;
    let max_chars = crate::tokens::TokenEstimation::default().chars_for_tokens(budget);
    let body = format!("{}\nshort second line", "x".repeat(50_000));
    let out = paginate_read(&body, None, None, budget);
    assert!(
        out.len() < max_chars + 300,
        "the oversized first line stays under the cap, not emitted whole: {} bytes",
        out.len()
    );
    assert!(out.contains("truncated"), "marks the truncation");
    assert!(
        out.contains("~1000 tokens"),
        "footer names the token budget: {out:?}"
    );
    assert!(
        out.contains("offset=1 char_offset="),
        "footer resumes MID-LINE via char_offset, not at the next line: {out:?}"
    );

    // A multi-line body that fits within one WHOLE line per page still tracks
    // the budget for the boundary it cuts on (the ordinary, non-oversized case).
    let many_lines = "y".repeat(30) + "\n";
    let wide_body = many_lines.repeat(500);
    let max_chars = crate::tokens::TokenEstimation::default().chars_for_tokens(budget);
    let wide_out = paginate_read(&wide_body, None, None, budget);
    assert!(
        wide_out.len() < max_chars + 300,
        "char-capped to the token budget (~{max_chars} chars): {} bytes",
        wide_out.len()
    );
}

#[test]
fn paginate_read_zero_budget_disables_the_char_backstop() {
    // #726: max_output_tokens == 0 means "no cap" — only the line window
    // applies, so a single huge line comes back verbatim.
    let body = "y".repeat(500_000);
    let out = paginate_read(&body, None, None, 0);
    assert_eq!(out, body, "zero budget = no char backstop");
}

#[test]
fn paginate_read_offset_past_end_is_a_clear_message() {
    let out = paginate_read("a\nb", Some(99), None, DEFAULT_MAX_OUTPUT_TOKENS);
    assert!(out.contains("past end"), "{out:?}");
}

// ---- #726: shared token-based model-facing output cap ----

#[test]
fn cap_model_output_passes_small_output_through_unchanged() {
    // Well under budget → exact bytes, no marker.
    let small = "hello\nworld\n";
    assert_eq!(cap_model_output(small, DEFAULT_MAX_OUTPUT_TOKENS), small);
}

#[test]
fn cap_model_output_preserves_existing_handle_for_short_view() {
    let store = content_spill::SessionSpillStore::new([20u8; 16]);
    let (handle, _) = content_spill::store_redacted_full(
        "first diagnostic\nlast diagnostic\n",
        Some("run_command".into()),
        &store,
    );
    let handle = handle.unwrap();
    let hint = content_spill::tool_output_retrieval_hint(&handle);
    for budget in [0, DEFAULT_MAX_OUTPUT_TOKENS] {
        let out = cap_model_output_with_handle("last diagnostic", budget, 100, Some(&handle));
        assert!(out.starts_with("last diagnostic"), "{out}");
        assert!(!out.contains("first diagnostic"), "{out}");
        assert!(
            out.contains(&hint),
            "short view lost its retained source: {out}"
        );
    }
}

#[test]
fn cap_model_output_truncates_over_budget_as_head_tail() {
    let big = format!("HEAD_MARKER\n{}\nTAIL_MARKER", "middle\n".repeat(20_000));
    let out = cap_model_output_with_handle(&big, 1_000, 100, None);
    assert!(out.len() < big.len(), "must shrink: {} bytes", out.len());
    assert!(out.contains("HEAD_MARKER"), "head dropped: {out:?}");
    assert!(out.contains("TAIL_MARKER"), "tail dropped: {out:?}");
    assert!(out.contains("head+tail shown"), "marker present: {out:?}");
    assert!(
        !out.contains(&"middle\n".repeat(1_000)),
        "middle should be elided"
    );
}

#[test]
fn cap_model_output_truncates_at_a_char_boundary() {
    // A multi-byte char straddling the cut must not be split — the body must
    // stay valid UTF-8 (no panic, no replacement char).
    let budget = 10; // ~40 chars
    let body = "é".repeat(1_000); // 2 bytes each
    let out = cap_model_output(&body, budget);
    assert!(out.is_char_boundary(out.len()), "valid boundary");
    assert!(
        out.chars()
            .all(|c| c == 'é' || !c.is_control() || c == '\n'),
        "no split char: {out:?}"
    );
}

#[test]
fn cap_model_output_zero_budget_is_no_cap() {
    let body = "z".repeat(500_000);
    assert_eq!(cap_model_output(&body, 0), body);
}

#[test]
fn token_to_char_math_uses_the_default_four_chars_per_token() {
    // The context ESTIMATOR is the default 4 chars/token. NOTE: the output
    // CAP no longer sizes at this ratio — it uses the conservative
    // `output_cap_chars_per_token` (default 3, ~30k chars for a 10k budget)
    // so dense output can't overrun its token budget. See
    // `output_cap_sizes_at_the_conservative_ratio_not_the_estimate`.
    let est = crate::tokens::TokenEstimation::default();
    assert_eq!(est.chars_for_tokens(DEFAULT_MAX_OUTPUT_TOKENS), 40_000);
}

#[test]
fn output_cap_sizes_at_the_conservative_ratio_not_the_estimate() {
    // The conservative cap ratio (default 3) sizes the char backstop, so a
    // 10k-token budget caps at ~30k chars — not the estimator's 40k. This is
    // what keeps dense output (which tokenizes denser than 4 c/t) at/under
    // its real token budget.
    let cap = crate::tokens::TokenEstimation::new(DEFAULT_OUTPUT_CAP_CHARS_PER_TOKEN);
    assert_eq!(cap.chars_for_tokens(DEFAULT_MAX_OUTPUT_TOKENS), 30_000);
    assert!(
        cap.chars_for_tokens(DEFAULT_MAX_OUTPUT_TOKENS)
            < crate::tokens::TokenEstimation::default().chars_for_tokens(DEFAULT_MAX_OUTPUT_TOKENS),
        "cap must be tighter than the estimate"
    );
}

#[test]
fn cap_model_output_caps_dense_body_the_estimate_would_pass() {
    // A body sized between the conservative cap (30k) and the estimator
    // backstop (40k): the old 4-c/t sizing would pass it VERBATIM; the
    // conservative 3-c/t sizing caps it. Relies on the default cap ratio (3)
    // — no global mutation (matches the max_output_tokens test convention).
    let body = "x".repeat(35_000);
    let out = cap_model_output(&body, DEFAULT_MAX_OUTPUT_TOKENS);
    assert!(
        out.len() < body.len(),
        "conservative cap must truncate a 35k-char body at a 10k-token budget \
             (old 4-c/t backstop of 40k would have passed it); got {} bytes",
        out.len()
    );
    assert!(
        out.contains("head+tail shown"),
        "cap marker present: {out:?}"
    );
}

/// #898: the forge PR/MR-creation URL is extracted from git's push output
/// (GitHub and GitLab), and ordinary URLs do not false-positive.
#[test]
fn pr_creation_url_extracts_github_and_gitlab() {
    let github = "remote: Create a pull request for 'fix/foo' on GitHub by visiting:\n\
                      remote:      https://github.com/OWNER/REPO/pull/new/fix/foo\n";
    assert_eq!(
        pr_creation_url(github),
        Some("https://github.com/OWNER/REPO/pull/new/fix/foo")
    );
    let gitlab = "remote: To create a merge request for topic, visit:\n\
                      remote:   https://gitlab.com/g/p/-/merge_requests/new?x=topic\n";
    assert_eq!(
        pr_creation_url(gitlab),
        Some("https://gitlab.com/g/p/-/merge_requests/new?x=topic")
    );
    // No PR URL present → None (ordinary fetch/clone output, plain links).
    assert_eq!(pr_creation_url("Already up to date.\n"), None);
    assert_eq!(
        pr_creation_url("see https://github.com/OWNER/REPO/issues/1"),
        None
    );
}

/// #898: after a push whose output carries a PR-creation URL,
/// `shell_envelope_output` appends the `gh pr create` next-step hint (and the
/// URL survives), while ordinary command output is left untouched.
#[test]
fn shell_envelope_output_appends_pr_hint_on_push() {
    let push = serde_json::json!({
        "exit_code": 0,
        "stdout": "",
        "stderr": "remote: Create a pull request for 'fix/foo' on GitHub by visiting:\n\
                   remote:      https://github.com/OWNER/REPO/pull/new/fix/foo\n",
    });
    let out = shell_envelope_output(&push, 50, false, false, None, None);
    assert!(out.contains("gh pr create --fill"), "hint missing: {out}");
    assert!(
        out.contains("https://github.com/OWNER/REPO/pull/new/fix/foo"),
        "url dropped: {out}"
    );

    // Ordinary output: no hint, payload unchanged.
    let plain = serde_json::json!({ "exit_code": 0, "stdout": "hello\n", "stderr": "" });
    let out = shell_envelope_output(&plain, 50, false, false, None, None);
    assert!(!out.contains("gh pr create"), "spurious hint: {out}");
    assert_eq!(out, "hello\n");
}

#[test]
fn shell_envelope_output_spills_full_output_before_head_tail_cap() {
    let full = format!(
        "HEAD_ONLY_MARKER\n{}\nMIDDLE_ONLY_MARKER\n{}\nTAIL_ONLY_MARKER\n",
        "alpha\n".repeat(10_000),
        "omega\n".repeat(10_000)
    );
    let envelope = serde_json::json!({
        "exit_code": 0,
        "stdout": full,
        "stderr": "",
    });
    let store = content_spill::SessionSpillStore::new([7u8; 16]);
    let mut display = ToolDisplay::new(Vec::new(), false, 80, 3, false);
    display.call("run_command", "large-output-command");
    let out = shell_envelope_output(&envelope, 50, false, true, Some(&store), Some(&mut display));
    display.result(&out);

    assert!(out.contains("HEAD_ONLY_MARKER"), "head dropped: {out}");
    assert!(out.contains("TAIL_ONLY_MARKER"), "tail dropped: {out}");
    // The teaser now names a `spill:<cid>` content handle (not a literal s0); it
    // must parse as a canonical CID and resolve in the store to the full payload.
    let handle = out
        .split("spill:")
        .nth(1)
        .and_then(|s| s.split('"').next())
        .expect("teaser names a spill handle");
    let cid = content_spill::SpillCid::parse(handle).expect("handle is a canonical CID");
    let arguments = serde_json::json!({"address": format!("spill:{handle}")});
    assert!(
        out.contains(&format!(
            "memory_fetch tool with JSON arguments {arguments}"
        )),
        "retrieval tool and address parameter missing: {out}"
    );
    assert!(
        out.contains("\"grep\":\"<pattern>\""),
        "search affordance missing: {out}"
    );
    let stored = store.fetch(&cid).expect("full output stored").redacted_text;
    assert!(
        stored.contains("MIDDLE_ONLY_MARKER"),
        "spilled payload was capped before storage"
    );
    assert!(stored.ends_with("TAIL_ONLY_MARKER\n"));
    let rendered = String::from_utf8(display.into_inner()).unwrap();
    assert!(
        rendered.contains("▓ TAIL_ONLY_MARKER\n…\n"),
        "operator spill lost the raw shell tail: {rendered}"
    );
    assert!(
        !rendered.contains("memory_fetch tool"),
        "operator saw the model teaser instead of raw shell output: {rendered}"
    );
}

#[test]
fn shell_envelope_selected_view_retains_exact_full_stream_text() {
    let stdout = "stdout α\r\nfirst diagnostic\n";
    let stderr = "stderr β\r\nlast diagnostic\n";
    let envelope = serde_json::json!({"exit_code": 7, "stdout": stdout, "stderr": stderr});
    let store = content_spill::SessionSpillStore::new([21u8; 16]);
    let mut handles = Vec::new();
    for trim in [OutputTrim::Head(1), OutputTrim::Tail(1)] {
        let view = trim.apply(stdout, stderr);
        let out = shell::shell_envelope_output_with_view(
            &envelope,
            Some(&view),
            20,
            false,
            true,
            Some(&store),
            None,
        );
        assert!(
            out.starts_with(&format!("error: command exited 7\n{view}")),
            "{out}"
        );
        let handle = out
            .split("spill:")
            .nth(1)
            .and_then(|rest| rest.split('"').next())
            .expect("selected view retains its full source");
        let cid = content_spill::SpillCid::parse(handle).unwrap();
        assert_eq!(
            store.fetch(&cid).unwrap().redacted_text,
            format!("{stdout}{stderr}")
        );
        handles.push(handle.to_owned());
    }
    assert_eq!(
        handles[0], handles[1],
        "a different view is not a different source"
    );
}

#[test]
fn shell_envelope_capture_truncation_survives_output_caps_and_retrieval() {
    for (stdout_truncated, stderr_truncated, streams) in [
        (true, false, "stdout"),
        (false, true, "stderr"),
        (true, true, "stdout and stderr"),
    ] {
        let store = content_spill::SessionSpillStore::new([22u8; 16]);
        let envelope = serde_json::json!({
            "exit_code": 0,
            "stdout": "captured line\n".repeat(10_000),
            "stderr": "last captured diagnostic\n",
            "stdout_truncated": stdout_truncated,
            "stderr_truncated": stderr_truncated,
        });
        let out = shell_envelope_output(&envelope, 20, false, true, Some(&store), None);
        let notice = format!("{streams} capture truncated; omitted bytes are unavailable");
        assert!(
            out.contains(&notice),
            "capture loss must be explicit: {out}"
        );
        let handle = out
            .split("spill:")
            .nth(1)
            .and_then(|rest| rest.split('"').next())
            .expect("large capture has a retained-output handle");
        let cid = content_spill::SpillCid::parse(handle).unwrap();
        let retained = store.fetch(&cid).unwrap().redacted_text;
        assert!(
            retained.contains(&notice),
            "re-reading must preserve capture loss"
        );
        assert!(retained.contains("last captured diagnostic"));
    }
}

#[test]
fn shell_envelope_capture_notice_survives_a_tiny_tail_budget() {
    // Output settings are process-wide; isolate this configuration from the
    // ordinary parallel test suite instead of racing its default budgets.
    let output = std::process::Command::new(std::env::current_exe().unwrap())
        .args([
            "--exact",
            "agentic::tools::tests::output_bounds::capture_notice_tiny_tail_child",
            "--ignored",
            "--nocapture",
        ])
        .output()
        .unwrap();
    assert!(
        output.status.success(),
        "isolated output-cap test failed: {}\n{}",
        String::from_utf8_lossy(&output.stdout),
        String::from_utf8_lossy(&output.stderr)
    );
    assert!(
        String::from_utf8_lossy(&output.stdout).contains("1 passed"),
        "the exact child test must run"
    );
}

#[test]
#[ignore = "runs in an isolated child because output settings are process-wide"]
fn capture_notice_tiny_tail_child() {
    output_budget::set_max_output_tokens(2);
    output_budget::set_output_head_tokens(0);
    let store = content_spill::SessionSpillStore::new([23u8; 16]);
    let envelope = serde_json::json!({
        "exit_code": 0,
        "stdout": format!("{}tail42", "captured line\n".repeat(100)),
        "stderr": "",
        "stdout_truncated": true,
    });
    let out = shell_envelope_output(&envelope, 20, false, true, Some(&store), None);
    assert!(out.contains("tail42"), "tail selection survives: {out}");
    assert!(
        out.contains("spill:"),
        "retained source is discoverable: {out}"
    );
    assert!(
        out.ends_with("[stdout capture truncated; omitted bytes are unavailable]"),
        "capture loss survives even when the cap drops its original prefix: {out}"
    );
}

#[test]
fn shell_envelope_without_streams_commits_the_exit_result() {
    let envelope = serde_json::json!({
        "exit_code": 3,
        "stdout": "",
        "stderr": "",
    });
    let mut display = ToolDisplay::new(Vec::new(), false, 80, 3, false);
    display.call("run_command", "exit 3");
    let out = shell_envelope_output(&envelope, 50, false, false, None, Some(&mut display));
    display.result(&out);

    // #1969: a NONZERO exit is now marked as a failure, because the ledger's
    // `ok` bit is `tool_result_ok`'s prefix test and `(exit 3)` read as a
    // success. The bare `(exit N)` rendering survives for exit 0, which is
    // the case it was written for.
    assert_eq!(out, "error: command exited 3");
    assert_eq!(
        String::from_utf8(display.into_inner()).unwrap(),
        "⚙  run_command: exit 3\n▒ error: command exited 3\n…\n"
    );
}

// ---- read_file never produces a spill handle (live 2026-09-23) ----
//
// read_file's page cap (~30k chars) exceeded the model-facing spill cap (16k),
// so every large-file read reached the model as a teaser + `spill:` handle:
// "the tool truncated the payload … and only the spill address was returned,
// not the actual text" (ornith-1.5-35b, refactoring newt-core/src/agentic/mod.rs).
// A page the model can continue with `offset=N` beats a handle it must redeem.

#[test]
fn a_char_capped_page_ends_on_a_whole_line_and_names_the_exact_resume_offset() {
    let body: String = (1..=3_000)
        .map(|n| format!("line {n:05} {}", "y".repeat(30)))
        .collect::<Vec<_>>()
        .join("\n");
    let out = paginate_read(&body, None, None, 1_000);
    let (page, footer) = out
        .rsplit_once("\n\n[")
        .expect("a truncated page has a footer");
    let last = page.lines().last().unwrap();
    assert!(last.ends_with(&"y".repeat(30)), "no half line: {last:?}");
    let shown: usize = last[5..10].parse().unwrap();
    assert!(
        footer.contains(&format!("offset={}", shown + 1)),
        "resume exactly after line {shown}: {footer}"
    );
}

#[test]
fn with_offload_on_a_read_file_page_stays_under_the_spill_cap() {
    let body = (1..=5_000)
        .map(|n| format!("line {n} {}", "z".repeat(40)))
        .collect::<Vec<_>>()
        .join("\n");
    let cap = crate::agentic::content_spill::TOOL_RESULT_SPILL_CAP;
    let on = read_file_page("", &body, None, None, None, true);
    assert!(
        on.chars().count() <= cap,
        "{} chars would spill",
        on.chars().count()
    );
    assert!(on.contains("offset="), "says how to continue");
    // Offload off: nothing would spill, so the ordinary (larger) cap applies.
    let off = read_file_page("", &body, None, None, None, false);
    assert!(
        off.chars().count() > cap,
        "offload off keeps the full budget"
    );
}

/// Stage 1: capture raw check evidence before trimming the model-facing view.
#[test]
fn observed_report_envelope_tap_precedes_output_trimming() {
    use crate::agentic::observed_report::{Capture, Presentation, State};
    let dir = tempfile::tempdir().unwrap();
    let capture = std::sync::Mutex::new(Capture::default());
    let mut display = ToolDisplay::new(Vec::new(), false, 80, 20, false);
    let mut view = Presentation {
        inner: &mut display,
        capture: Some(&capture),
    };
    view.execution_command("cargo test", dir.path().to_str().unwrap());
    let stdout = "test result: ok. 1 passed; 0 failed\n".repeat(12);
    let envelope =
        serde_json::json!({"exit_code":101,"stdout":stdout,"stderr":"error: one target failed"});
    shell::shell_envelope_output_with_view(
        &envelope,
        Some("short display"),
        1,
        false,
        false,
        None,
        Some(&mut view),
    );
    let mut state = State::default();
    state.bind(dir.path(), &crate::Scope::All);
    state.observe(
        dir.path(),
        &crate::Scope::All,
        &capture.lock().unwrap(),
        Some(crate::ExecOutcome::Failed),
        None,
    );
    let text = state.render(dir.path(), &crate::Scope::All, "done");
    assert!(text.contains("Failed; exit 101"), "{text}");
    assert!(text.contains("Result excerpt incomplete"), "{text}");
    assert!(text.contains("error: one target failed"), "{text}");
}