|
| 1 | +--- |
| 2 | +id: dso-bdk5 |
| 3 | +status: in_progress |
| 4 | +deps: [] |
| 5 | +links: [] |
| 6 | +created: 2026-03-23T17:34:42Z |
| 7 | +type: task |
| 8 | +priority: 1 |
| 9 | +assignee: Joe Oakhart |
| 10 | +parent: dso-k4sw |
| 11 | +--- |
| 12 | +# RED tests for CLI-native ticket health guards |
| 13 | + |
| 14 | + |
| 15 | +## Notes |
| 16 | + |
| 17 | +**2026-03-23T17:35:13Z** |
| 18 | + |
| 19 | +## Description |
| 20 | +TDD RED task. Write failing tests that assert the post-implementation state BEFORE guard logic is added. |
| 21 | + |
| 22 | +## Files to Create/Edit |
| 23 | +1. tests/scripts/test-ticket-health-guards.sh (CREATE) — tests for shared helpers only: |
| 24 | + - test_ticket_read_status_returns_current_status |
| 25 | + - test_ticket_find_open_children_lists_children |
| 26 | + |
| 27 | +2. tests/scripts/test-ticket-transition.sh (EDIT — append RED tests): |
| 28 | + - test_transition_bug_close_requires_reason |
| 29 | + - test_transition_bug_close_with_reason_succeeds |
| 30 | + - test_transition_close_blocked_with_open_children |
| 31 | + |
| 32 | +3. tests/scripts/test-ticket-create.sh (EDIT — append RED test): |
| 33 | + - test_create_with_closed_parent_blocked |
| 34 | + |
| 35 | +4. tests/scripts/test-ticket-link.sh (EDIT — append RED tests): |
| 36 | + - test_link_depends_on_closed_target_blocked |
| 37 | + - test_link_relates_to_closed_target_allowed |
| 38 | + |
| 39 | +## .test-index |
| 40 | +APPEND to existing ticket-lib.sh entry (do NOT replace): |
| 41 | + plugins/dso/scripts/ticket-lib.sh: <existing entries>, tests/scripts/test-ticket-health-guards.sh [test_ticket_read_status_returns_current_status] |
| 42 | + |
| 43 | +All tests must FAIL (RED) before T2-T5 run. |
| 44 | + |
| 45 | +## ACCEPTANCE CRITERIA |
| 46 | + |
| 47 | +- [ ] tests/scripts/test-ticket-health-guards.sh exists |
| 48 | + Verify: test -f tests/scripts/test-ticket-health-guards.sh |
| 49 | +- [ ] test-ticket-health-guards.sh contains at least 2 test functions |
| 50 | + Verify: grep -c "^test_" tests/scripts/test-ticket-health-guards.sh | awk '{exit ($1 < 2)}' |
| 51 | +- [ ] test-ticket-transition.sh contains RED guard tests |
| 52 | + Verify: grep -q "test_transition_bug_close_requires_reason" tests/scripts/test-ticket-transition.sh |
| 53 | +- [ ] test-ticket-create.sh contains RED guard test |
| 54 | + Verify: grep -q "test_create_with_closed_parent_blocked" tests/scripts/test-ticket-create.sh |
| 55 | +- [ ] test-ticket-link.sh contains RED guard tests |
| 56 | + Verify: grep -q "test_link_depends_on_closed_target_blocked" tests/scripts/test-ticket-link.sh |
| 57 | +- [ ] .test-index entry appended for ticket-lib.sh with RED marker |
| 58 | + Verify: grep -q "test-ticket-health-guards" .test-index |
| 59 | + |
| 60 | + |
| 61 | +**2026-03-23T17:38:45Z** |
| 62 | + |
| 63 | +CHECKPOINT 1/6: Task context loaded ✓ |
| 64 | + |
| 65 | +**2026-03-23T17:39:13Z** |
| 66 | + |
| 67 | +CHECKPOINT 2/6: Code patterns understood ✓ |
| 68 | + |
| 69 | +**2026-03-23T17:41:10Z** |
| 70 | + |
| 71 | +CHECKPOINT 3/6: Tests written ✓ |
| 72 | + |
| 73 | +**2026-03-23T17:41:11Z** |
| 74 | + |
| 75 | +CHECKPOINT 4/6: Implementation complete ✓ (TDD RED task — tests ARE the implementation) |
| 76 | + |
| 77 | +**2026-03-23T17:41:35Z** |
| 78 | + |
| 79 | +CHECKPOINT 5/6: Validation passed ✓ — all 4 files syntactically valid; health-guards runs RED (0 passed, 2 failed) |
| 80 | + |
| 81 | +**2026-03-23T17:41:40Z** |
| 82 | + |
| 83 | +CHECKPOINT 6/6: Done ✓ — All 6 acceptance criteria met. Files created/modified: tests/scripts/test-ticket-health-guards.sh (new), tests/scripts/test-ticket-transition.sh (appended tests 12-14), tests/scripts/test-ticket-create.sh (appended test 7), tests/scripts/test-ticket-link.sh (appended tests 10-11), .test-index (appended RED marker for ticket-lib.sh entry) |
0 commit comments