pmat 3.17.0

PMAT - Zero-config AI context generation and code quality toolkit (CLI, MCP, HTTP)
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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
// Roadmap unit tests
//
// Included by roadmap.rs — shares parent scope, no `use` imports needed.

#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_roadmap_creation() {
        let roadmap = Roadmap::new(Some("paiml/pmat".to_string()));
        assert_eq!(roadmap.roadmap_version, "1.0");
        assert!(roadmap.github_enabled);
        assert_eq!(roadmap.github_repo, Some("paiml/pmat".to_string()));
        assert_eq!(roadmap.roadmap.len(), 0);
    }

    #[test]
    fn test_roadmap_item_creation() {
        let item = RoadmapItem::new("TEST-001".to_string(), "Test Item".to_string());
        assert_eq!(item.id, "TEST-001");
        assert_eq!(item.title, "Test Item");
        assert_eq!(item.status, ItemStatus::Planned);
        assert_eq!(item.priority, Priority::Medium);
        assert!(item.github_issue.is_none());
    }

    #[test]
    fn test_github_issue_creation() {
        let item = RoadmapItem::from_github_issue(42, "GitHub Issue".to_string());
        assert_eq!(item.id, "GH-42");
        assert_eq!(item.github_issue, Some(42));
        assert_eq!(item.title, "GitHub Issue");
    }

    #[test]
    fn test_upsert_item() {
        let mut roadmap = Roadmap::new(None);
        let item = RoadmapItem::new("TEST-001".to_string(), "Test".to_string());

        roadmap.upsert_item(item.clone());
        assert_eq!(roadmap.roadmap.len(), 1);

        // Update existing
        let mut updated = item.clone();
        updated.status = ItemStatus::Completed;
        roadmap.upsert_item(updated);
        assert_eq!(roadmap.roadmap.len(), 1);
        assert_eq!(roadmap.roadmap[0].status, ItemStatus::Completed);
    }

    #[test]
    fn test_yaml_only_items_empty_roadmap() {
        let roadmap = Roadmap::new(None);
        assert!(roadmap.yaml_only_items().is_empty());
    }

    #[test]
    fn test_yaml_only_items_filters_github_synced() {
        let mut roadmap = Roadmap::new(None);
        roadmap.upsert_item(RoadmapItem::new(
            "YAML-1".to_string(),
            "Pure yaml".to_string(),
        ));
        roadmap.upsert_item(RoadmapItem::from_github_issue(
            42,
            "Synced".to_string(),
        ));
        roadmap.upsert_item(RoadmapItem::new(
            "YAML-2".to_string(),
            "Another yaml".to_string(),
        ));

        let yaml_only = roadmap.yaml_only_items();
        assert_eq!(yaml_only.len(), 2);
        assert!(yaml_only.iter().all(|i| i.github_issue.is_none()));
        let ids: Vec<&str> = yaml_only.iter().map(|i| i.id.as_str()).collect();
        assert!(ids.contains(&"YAML-1"));
        assert!(ids.contains(&"YAML-2"));
    }

    #[test]
    fn test_epic_items_empty_roadmap() {
        let roadmap = Roadmap::new(None);
        assert!(roadmap.epic_items().is_empty());
    }

    #[test]
    fn test_epic_items_filters_by_type() {
        let mut roadmap = Roadmap::new(None);
        let mut epic = RoadmapItem::new("EPIC-1".to_string(), "Big effort".to_string());
        epic.item_type = ItemType::Epic;
        let task = RoadmapItem::new("TASK-1".to_string(), "Small task".to_string());
        let mut epic2 = RoadmapItem::new("EPIC-2".to_string(), "Another epic".to_string());
        epic2.item_type = ItemType::Epic;

        roadmap.upsert_item(epic);
        roadmap.upsert_item(task);
        roadmap.upsert_item(epic2);

        let epics = roadmap.epic_items();
        assert_eq!(epics.len(), 2);
        assert!(epics.iter().all(|i| i.item_type == ItemType::Epic));
    }

    #[test]
    fn test_epic_items_no_epics() {
        let mut roadmap = Roadmap::new(None);
        roadmap.upsert_item(RoadmapItem::new(
            "TASK-1".to_string(),
            "Just a task".to_string(),
        ));
        assert!(roadmap.epic_items().is_empty());
    }

    /// Test fuzzy ID matching for improved UX
    #[test]
    fn test_fuzzy_id_matching() {
        let mut roadmap = Roadmap::new(None);

        // Add test items
        roadmap.upsert_item(RoadmapItem::new(
            "Continue unwrap elimination: 27 more unwraps to reach 60-unwrap milestone (EXTREME TDD)".to_string(),
            "Unwrap work".to_string(),
        ));
        roadmap.upsert_item(RoadmapItem::new(
            "Fix critical bugs in parser".to_string(),
            "Parser fixes".to_string(),
        ));

        // Test 1: Exact match (case-sensitive)
        assert!(roadmap
            .find_item("Continue unwrap elimination: 27 more unwraps to reach 60-unwrap milestone (EXTREME TDD)")
            .is_some());

        // Test 2: Case-insensitive exact match
        assert!(roadmap
            .find_item("continue unwrap elimination: 27 more unwraps to reach 60-unwrap milestone (extreme tdd)")
            .is_some());

        // Test 3: Partial match (prefix)
        let found = roadmap.find_item("Continue unwrap");
        assert!(found.is_some());
        assert_eq!(found.unwrap().title, "Unwrap work");

        // Test 4: Contains match (not at start)
        let found = roadmap.find_item("unwrap elimination");
        assert!(found.is_some());
        assert_eq!(found.unwrap().title, "Unwrap work");

        // Test 5: Single word match
        let found = roadmap.find_item("unwrap");
        assert!(found.is_some());
        assert_eq!(found.unwrap().title, "Unwrap work");

        // Test 6: Case-insensitive partial
        let found = roadmap.find_item("UNWRAP");
        assert!(found.is_some());
        assert_eq!(found.unwrap().title, "Unwrap work");

        // Test 7: Different item
        let found = roadmap.find_item("parser");
        assert!(found.is_some());
        assert_eq!(found.unwrap().title, "Parser fixes");

        // Test 8: No match
        assert!(roadmap.find_item("nonexistent").is_none());
    }

    #[test]
    fn test_trueno_db_yaml_format_with_extra_fields() {
        // This test verifies the fix for issue #84
        // trueno-db's roadmap has extra fields: description, phase, implementation, references
        // These should be silently ignored to support backward compatibility
        let yaml = r#"
roadmap_version: '1.0'
github_enabled: true
github_repo: paiml/trueno-db
roadmap:
  - id: CORE-001
    title: "Arrow storage backend with morsel-based paging"
    description: |
      Implement Arrow/Parquet storage with 128MB morsel-based paging.
    status: completed
    priority: high
    phase: 1
    labels: [storage, poka-yoke, phase-1]
    acceptance_criteria:
      - Parquet reader with Arrow columnar format
      - 128MB morsel chunks
    implementation:
      - StorageEngine::load_parquet() with Arrow/Parquet integration
      - MORSEL_SIZE_BYTES = 128MB
    references:
      - "Funke et al. (2018): GPU paging for out-of-core workloads"
"#;

        // After removing #[serde(deny_unknown_fields)], parsing should succeed
        // Extra fields (description, phase, implementation, references) are silently ignored
        let result: Result<Roadmap, _> = serde_yaml_ng::from_str(yaml);

        assert!(
            result.is_ok(),
            "Expected parsing to succeed with extra fields silently ignored"
        );

        let roadmap = result.unwrap();
        assert_eq!(roadmap.github_repo, Some("paiml/trueno-db".to_string()));
        assert_eq!(roadmap.roadmap.len(), 1);

        let item = &roadmap.roadmap[0];
        assert_eq!(item.id, "CORE-001");
        assert_eq!(item.title, "Arrow storage backend with morsel-based paging");
        assert_eq!(item.status, ItemStatus::Completed);
        assert_eq!(item.priority, Priority::High);
        assert_eq!(item.labels, vec!["storage", "poka-yoke", "phase-1"]);
        assert_eq!(item.acceptance_criteria.len(), 2);
    }

    #[test]
    fn test_completion_percentage() {
        let mut item = RoadmapItem::new("TEST-001".to_string(), "Test".to_string());

        // Planned status
        assert_eq!(item.completion_percentage(), 0);

        // In progress
        item.status = ItemStatus::InProgress;
        assert_eq!(item.completion_percentage(), 50);

        // Review
        item.status = ItemStatus::Review;
        assert_eq!(item.completion_percentage(), 90);

        // Completed
        item.status = ItemStatus::Completed;
        assert_eq!(item.completion_percentage(), 100);
    }

    /// roadmap_impl.rs:153 — subtasks branch wins over phases / criteria
    /// / status arms when populated. Tests the non-empty-subtasks code path
    /// (existing tests only cover the leaf-status branch).
    #[test]
    fn test_completion_percentage_subtasks_branch() {
        let mut item = RoadmapItem::new("EPIC-1".to_string(), "Epic".to_string());
        item.subtasks = vec![
            Subtask {
                id: "S1".to_string(),
                github_issue: None,
                title: "S1".to_string(),
                status: ItemStatus::Completed,
                completion: 100,
            },
            Subtask {
                id: "S2".to_string(),
                github_issue: None,
                title: "S2".to_string(),
                status: ItemStatus::InProgress,
                completion: 50,
            },
        ];
        // (100 + 50) / 2 = 75.
        assert_eq!(item.completion_percentage(), 75);
    }

    /// roadmap_impl.rs:157 — phases branch wins over criteria / status arms
    /// when subtasks empty but phases populated.
    #[test]
    fn test_completion_percentage_phases_branch() {
        let mut item = RoadmapItem::new("MULTI-1".to_string(), "Multi".to_string());
        item.phases = vec![
            Phase {
                name: "P1".to_string(),
                status: ItemStatus::Completed,
                estimated_effort: None,
                completion: 80,
            },
            Phase {
                name: "P2".to_string(),
                status: ItemStatus::InProgress,
                estimated_effort: None,
                completion: 20,
            },
        ];
        // (80 + 20) / 2 = 50.
        assert_eq!(item.completion_percentage(), 50);
    }

    #[test]
    fn test_find_item() {
        let mut roadmap = Roadmap::new(None);
        let item1 = RoadmapItem::new("TEST-001".to_string(), "Test 1".to_string());
        let item2 = RoadmapItem::new("TEST-002".to_string(), "Test 2".to_string());

        roadmap.upsert_item(item1);
        roadmap.upsert_item(item2);

        assert!(roadmap.find_item("TEST-001").is_some());
        assert!(roadmap.find_item("TEST-999").is_none());
    }

    #[test]
    fn test_find_by_github_issue() {
        let mut roadmap = Roadmap::new(None);
        let item = RoadmapItem::from_github_issue(42, "GitHub Issue".to_string());

        roadmap.upsert_item(item);

        assert!(roadmap.find_item_by_github_issue(42).is_some());
        assert!(roadmap.find_item_by_github_issue(999).is_none());
    }

    #[test]
    fn test_github_enabled_native_bool() {
        let yaml = "roadmap_version: '1.0'\ngithub_enabled: true\nroadmap: []\n";
        let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).unwrap();
        assert!(roadmap.github_enabled);

        let yaml = "roadmap_version: '1.0'\ngithub_enabled: false\nroadmap: []\n";
        let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).unwrap();
        assert!(!roadmap.github_enabled);
    }

    #[test]
    fn test_github_enabled_quoted_string() {
        let yaml = "roadmap_version: '1.0'\ngithub_enabled: \"true\"\nroadmap: []\n";
        let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).unwrap();
        assert!(roadmap.github_enabled);

        let yaml = "roadmap_version: '1.0'\ngithub_enabled: \"false\"\nroadmap: []\n";
        let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).unwrap();
        assert!(!roadmap.github_enabled);
    }

    #[test]
    fn test_github_enabled_missing_defaults_true() {
        let yaml = "roadmap_version: '1.0'\nroadmap: []\n";
        let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).unwrap();
        assert!(roadmap.github_enabled);
    }

    /// deserialize_bool_lenient rejects invalid string values. Exercises the
    /// `_ => Err(...)` arm inside visit_str — uncovered until now.
    #[test]
    fn test_github_enabled_invalid_string_rejected() {
        let yaml = "roadmap_version: '1.0'\ngithub_enabled: \"yes\"\nroadmap: []\n";
        let err = serde_yaml_ng::from_str::<Roadmap>(yaml)
            .expect_err("invalid bool string must fail");
        let msg = err.to_string();
        assert!(
            msg.contains("expected true/false") && msg.contains("yes"),
            "error should name the invalid value, got: {msg}"
        );
    }

    /// deserialize_bool_lenient rejects non-bool, non-string values (e.g. integer).
    /// Exercises the visitor's `expecting` message surfaced by serde when no
    /// visit_* method matches.
    #[test]
    fn test_github_enabled_integer_rejected() {
        let yaml = "roadmap_version: '1.0'\ngithub_enabled: 1\nroadmap: []\n";
        let err = serde_yaml_ng::from_str::<Roadmap>(yaml)
            .expect_err("integer must not satisfy lenient bool deserializer");
        let msg = err.to_string();
        assert!(
            msg.contains("boolean") || msg.contains("true/false"),
            "error should reference expected type, got: {msg}"
        );
    }

    // Part A: YAML Parsing Resilience - Status Alias Tests
    mod status_alias_tests {
        use super::*;

        #[test]
        fn test_completed_aliases() {
            assert_eq!(
                ItemStatus::from_string("completed").unwrap(),
                ItemStatus::Completed
            );
            assert_eq!(
                ItemStatus::from_string("done").unwrap(),
                ItemStatus::Completed
            );
            assert_eq!(
                ItemStatus::from_string("finished").unwrap(),
                ItemStatus::Completed
            );
            assert_eq!(
                ItemStatus::from_string("closed").unwrap(),
                ItemStatus::Completed
            );
            // Case insensitive
            assert_eq!(
                ItemStatus::from_string("DONE").unwrap(),
                ItemStatus::Completed
            );
            assert_eq!(
                ItemStatus::from_string("Done").unwrap(),
                ItemStatus::Completed
            );
        }

        #[test]
        fn test_inprogress_aliases() {
            assert_eq!(
                ItemStatus::from_string("inprogress").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("in_progress").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("in-progress").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("wip").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("active").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("started").unwrap(),
                ItemStatus::InProgress
            );
            assert_eq!(
                ItemStatus::from_string("WIP").unwrap(),
                ItemStatus::InProgress
            );
        }

        #[test]
        fn test_planned_aliases() {
            assert_eq!(
                ItemStatus::from_string("planned").unwrap(),
                ItemStatus::Planned
            );
            assert_eq!(
                ItemStatus::from_string("todo").unwrap(),
                ItemStatus::Planned
            );
            assert_eq!(
                ItemStatus::from_string("open").unwrap(),
                ItemStatus::Planned
            );
            assert_eq!(
                ItemStatus::from_string("pending").unwrap(),
                ItemStatus::Planned
            );
            assert_eq!(ItemStatus::from_string("new").unwrap(), ItemStatus::Planned);
        }

        #[test]
        fn test_blocked_aliases() {
            assert_eq!(
                ItemStatus::from_string("blocked").unwrap(),
                ItemStatus::Blocked
            );
            assert_eq!(
                ItemStatus::from_string("stuck").unwrap(),
                ItemStatus::Blocked
            );
            assert_eq!(
                ItemStatus::from_string("waiting").unwrap(),
                ItemStatus::Blocked
            );
            assert_eq!(
                ItemStatus::from_string("on-hold").unwrap(),
                ItemStatus::Blocked
            );
            assert_eq!(
                ItemStatus::from_string("on_hold").unwrap(),
                ItemStatus::Blocked
            );
        }

        #[test]
        fn test_review_aliases() {
            assert_eq!(
                ItemStatus::from_string("review").unwrap(),
                ItemStatus::Review
            );
            assert_eq!(
                ItemStatus::from_string("reviewing").unwrap(),
                ItemStatus::Review
            );
            assert_eq!(ItemStatus::from_string("pr").unwrap(), ItemStatus::Review);
            assert_eq!(
                ItemStatus::from_string("pending-review").unwrap(),
                ItemStatus::Review
            );
        }

        #[test]
        fn test_cancelled_aliases() {
            assert_eq!(
                ItemStatus::from_string("cancelled").unwrap(),
                ItemStatus::Cancelled
            );
            assert_eq!(
                ItemStatus::from_string("canceled").unwrap(),
                ItemStatus::Cancelled
            );
            assert_eq!(
                ItemStatus::from_string("dropped").unwrap(),
                ItemStatus::Cancelled
            );
            assert_eq!(
                ItemStatus::from_string("wontfix").unwrap(),
                ItemStatus::Cancelled
            );
        }

        #[test]
        fn test_invalid_status_with_suggestion() {
            let err = ItemStatus::from_string("compl").unwrap_err();
            assert!(err.contains("did you mean"));
            assert!(err.contains("completed"));

            let err = ItemStatus::from_string("progres").unwrap_err();
            assert!(err.contains("did you mean"));
        }

        /// roadmap_status.rs:164-165 — `a_len == 0` early-return arm returns
        /// `b_len`. from_string normalizes input to lowercase-no-hyphens and
        /// feeds it as `a` to levenshtein_distance against each valid_status.
        /// An empty input string produces normalized == "", triggering the
        /// a_len-zero arm against every valid_status candidate.
        #[test]
        fn test_empty_status_string_triggers_levenshtein_empty_a_arm() {
            let err = ItemStatus::from_string("").unwrap_err();
            assert!(err.contains("unknown status"));
            // Suggestion is present: min_by_key picks one valid_status; the
            // a_len==0 arm returned b_len for every candidate, so all ties
            // collapse to the first — "completed" (longest list entry still
            // present). Just verify the suggestion scaffold rendered.
            assert!(
                err.contains("did you mean"),
                "empty input must still produce a suggestion, got {err:?}"
            );
        }

        /// roadmap_status.rs:167-168 — `b_len == 0` arm. from_string never
        /// passes an empty valid_status to levenshtein_distance, so this arm
        /// is unreachable via the public API. Call the private helper
        /// directly to cover the arm. Private fn is visible through the
        /// include! parent scope.
        #[test]
        fn test_levenshtein_distance_empty_b_returns_a_len() {
            assert_eq!(levenshtein_distance("hello", ""), 5);
            assert_eq!(levenshtein_distance("", ""), 0);
            assert_eq!(levenshtein_distance("", "world"), 5);
        }

        #[test]
        fn test_yaml_parsing_with_aliases() {
            let yaml = r#"
roadmap_version: '1.0'
github_enabled: true
roadmap:
  - id: TEST-001
    title: "Test with done status"
    status: done
    priority: high
  - id: TEST-002
    title: "Test with wip status"
    status: wip
    priority: medium
  - id: TEST-003
    title: "Test with stuck status"
    status: stuck
    priority: low
"#;
            let roadmap: Roadmap = serde_yaml_ng::from_str(yaml).expect("Should parse with aliases");
            assert_eq!(roadmap.roadmap.len(), 3);
            assert_eq!(roadmap.roadmap[0].status, ItemStatus::Completed);
            assert_eq!(roadmap.roadmap[1].status, ItemStatus::InProgress);
            assert_eq!(roadmap.roadmap[2].status, ItemStatus::Blocked);
        }
    }

    /// roadmap_impl.rs:152 — `completion_percentage` leaf-status branches.
    /// Fires the ItemStatus match arms that run only when the item has no
    /// subtasks, no phases, and no acceptance_criteria (the "leaf" path).
    #[test]
    fn test_completion_percentage_leaf_status_arms() {
        let mut item = RoadmapItem::new("LEAF-001".to_string(), "leaf".to_string());
        // Freshly constructed — subtasks, phases, acceptance_criteria all empty.
        item.status = ItemStatus::Planned;
        assert_eq!(item.completion_percentage(), 0, "Planned → 0");
        item.status = ItemStatus::InProgress;
        assert_eq!(item.completion_percentage(), 50, "InProgress → 50");
        item.status = ItemStatus::Review;
        assert_eq!(item.completion_percentage(), 90, "Review → 90");
        item.status = ItemStatus::Completed;
        assert_eq!(item.completion_percentage(), 100, "Completed → 100");
        item.status = ItemStatus::Cancelled;
        assert_eq!(item.completion_percentage(), 0, "Cancelled → 0");
        item.status = ItemStatus::Blocked;
        assert_eq!(item.completion_percentage(), 0, "Blocked → 0");
    }

    /// roadmap_impl.rs:161 — acceptance_criteria non-empty, subtasks & phases
    /// empty. Falls through to the `0` placeholder branch.
    #[test]
    fn test_completion_percentage_acceptance_criteria_returns_zero() {
        let mut item = RoadmapItem::new("AC-001".to_string(), "ac".to_string());
        item.acceptance_criteria = vec!["criterion 1".to_string(), "criterion 2".to_string()];
        // Status shouldn't affect this branch — the AC branch returns 0 unconditionally.
        item.status = ItemStatus::Completed;
        assert_eq!(item.completion_percentage(), 0);
    }
}