- 2308
/// stream of progress nobody is awake to read. - 2309
#[test] - 2310
fn an_unattended_run_holds_its_chatter_for_the_digest() { - 2311
let quiet = posture(Cadence::Digest, Urgency::Quiet); - 2312
assert_eq!( - 2313
quiet.disposition(DeliveryKind::Progress), - 2314
Disposition::HoldForDigest - 2315
); - 2316
assert_eq!( - 2317
quiet.disposition(DeliveryKind::Assistant), - 2318
Disposition::HoldForDigest - 2319
); - 2320
} - 2321
- 2322
/// A held approval gate is a stopped run. Batching it would turn a - 2323
/// question into a hang, so it always goes out. - 2324
#[test] - 2325
fn an_approval_always_goes_out_whatever_the_cadence() { - 2326
for cadence in [Cadence::Live, Cadence::OnCompletion, Cadence::Digest] { - 2327
for urgency in [Urgency::Interrupt, Urgency::Notify, Urgency::Quiet] { - 2328
assert_eq!( - 2329
posture(cadence, urgency).disposition(DeliveryKind::Approval), - 2330
Disposition::Send, - 2331
"{cadence:?}/{urgency:?} batched an approval" - 2332
); - 2333
} - 2334
} - 2335
} - 2336
- 2337
/// An irreversible step's confirmation must not wait until morning. - 2338
#[test] - 2339
fn interrupt_urgency_overrides_every_cadence() { - 2340
let urgent = posture(Cadence::Digest, Urgency::Interrupt); - 2341
assert_eq!( - 2342
urgent.disposition(DeliveryKind::Assistant), - 2343
Disposition::Send - 2344
); - 2345
assert_eq!( - 2346
urgent.disposition(DeliveryKind::Progress), - 2347
Disposition::Send - 2348
); - 2349
} - 2350
- 2351
/// Alerts are already the exception path; a digest must not swallow one. - 2352
#[test] - 2353
fn an_alert_is_never_held_for_a_digest() { - 2354
assert_eq!( - 2355
posture(Cadence::Digest, Urgency::Quiet).disposition(DeliveryKind::Alert), - 2356
Disposition::Send - 2357
); - 2358
} - 2359
- 2360
/// On-completion holds the chatter and sends the answer. - 2361
#[test] - 2362
fn on_completion_holds_progress_but_not_the_result() { - 2363
let posture = posture(Cadence::OnCompletion, Urgency::Notify); - 2364
assert_eq!( - 2365
posture.disposition(DeliveryKind::Progress), - 2366
Disposition::HoldUntilComplete - 2367
); - 2368
assert_eq!( - 2369
posture.disposition(DeliveryKind::Assistant), - 2370
Disposition::Send - 2371
); - 2372
} - 2373
- 2374
/// The default reproduces the behaviour before any of this existed. - 2375
#[test] - 2376
fn the_default_posture_sends_everything() { - 2377
let default = DeliveryPosture::default(); - 2378
for kind in [ - 2379
DeliveryKind::Assistant, - 2380
DeliveryKind::Progress, - 2381
DeliveryKind::Alert, - 2382
DeliveryKind::Approval, - 2383
DeliveryKind::ToolResult, - 2384
] { - 2385
assert_eq!(default.disposition(kind), Disposition::Send); - 2386
} - 2387
} - 2388
} - 2389
Indexing the workspace…
Vakyartha documentation is discovering safe artifacts, anchors, and source references.