Test Handoff::Document from strings, keep one CLI test per path #1406

Closed
opened 2026-10-26 20:15:37 +00:00 by jared · 2 comments
Owner

VERDICT: CREATE

Problem

After #1401, Handoff::Document parses text only. plugins/os/tests/handoff/complete_test.rb still checks byte preservation and the error paths through the disk with HandoffScenario. These tests are disk-bound and duplicate I/O setup. A blind judge noted this on 2026-10-26.

Reproduce

n/a: test restructure with no behavior change.

Approach

Move the pure-text cases to Handoff::Document unit tests built from strings: byte preservation of the rest of the text, already-completed error, missing completed_at line error. Keep one end-to-end CLI test per path (success, already completed, missing line, missing file).

Required work:

  1. Add a Document unit test file built from strings — check: present Handoff::Document.new in plugins/os/tests/handoff/**/*_test.rb

Acceptance criteria

  1. Given a text with a CRLF line and an in-body completed_at: line, when Document#complete runs, then only the frontmatter line changes.
  2. Given a text with completed_at already set, when complete runs, then it raises Handoff::Error naming the path.
  3. Given a text with no completed_at line, when Document.new runs, then it raises Handoff::Error naming the path.
  4. Given the CLI, when handoff complete runs on each of the four paths, then one end-to-end test per path still passes.

Owner sketch

class HandoffDocumentTest < Minitest::Test
end

Non-goals

No production code change.

Origin

  • Trigger: pattern-distance method validated by fast-batch-17 (main 80a39130)
  • Improvised this session: none
  • Chain: no automated pattern detection ← build-plan step 4/5 not built ← DESIGN (docs/system-design-format/pattern-matching.md section 8)
  • Root candidate: none found; searched Handoff::Document, complete_test, HandoffScenario, Document.new, handoff/document, Handoff::Store
  • Where: plugins/os/lib/handoff/document.rb; plugins/os/tests/handoff/complete_test.rb
  • Session: 4e988e4b-0efd-4090-9e80-c4ccd99e73b6
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-fast-batch-15/4e988e4b-0efd-4090-9e80-c4ccd99e73b6.jsonl
VERDICT: CREATE ## Problem After #1401, `Handoff::Document` parses text only. `plugins/os/tests/handoff/complete_test.rb` still checks byte preservation and the error paths through the disk with `HandoffScenario`. These tests are disk-bound and duplicate I/O setup. A blind judge noted this on 2026-10-26. ## Reproduce n/a: test restructure with no behavior change. ## Approach Move the pure-text cases to `Handoff::Document` unit tests built from strings: byte preservation of the rest of the text, already-completed error, missing `completed_at` line error. Keep one end-to-end CLI test per path (success, already completed, missing line, missing file). Required work: 1. Add a Document unit test file built from strings — check: present `Handoff::Document.new` in `plugins/os/tests/handoff/**/*_test.rb` ## Acceptance criteria 1. Given a text with a CRLF line and an in-body `completed_at:` line, when `Document#complete` runs, then only the frontmatter line changes. 2. Given a text with `completed_at` already set, when `complete` runs, then it raises `Handoff::Error` naming the path. 3. Given a text with no `completed_at` line, when `Document.new` runs, then it raises `Handoff::Error` naming the path. 4. Given the CLI, when `handoff complete` runs on each of the four paths, then one end-to-end test per path still passes. ## Owner sketch ```ruby class HandoffDocumentTest < Minitest::Test end ``` ## Non-goals No production code change. ## Origin - Trigger: pattern-distance method validated by fast-batch-17 (main 80a39130) - Improvised this session: none - Chain: no automated pattern detection ← build-plan step 4/5 not built ← DESIGN (docs/system-design-format/pattern-matching.md section 8) - Root candidate: none found; searched Handoff::Document, complete_test, HandoffScenario, Document.new, handoff/document, Handoff::Store - Where: plugins/os/lib/handoff/document.rb; plugins/os/tests/handoff/complete_test.rb - Session: 4e988e4b-0efd-4090-9e80-c4ccd99e73b6 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-fast-batch-15/4e988e4b-0efd-4090-9e80-c4ccd99e73b6.jsonl
Author
Owner

Work started on branch ticket-1406 through /os-sdlc:implement (map poodr-ticket-implementation). The ticket is test-only, so the run should escalate on unexpected_pass and reroute per the implement skill.

Work started on branch ticket-1406 through /os-sdlc:implement (map poodr-ticket-implementation). The ticket is test-only, so the run should escalate on unexpected_pass and reroute per the implement skill.
Author
Owner

Resolution

Done: Added plugins/os/tests/handoff/document_test.rb: three Handoff::Document tests built from strings (only the frontmatter completed_at line changes, with CRLF and in-body completed_at; already set raises naming the path; missing line raises on new naming the path). complete_test.rb keeps one CLI test per path (success, already completed, missing line, missing file); the success test no longer carries the CRLF/in-body detail.

Evidence: Commit ac8eb444. Implementation 181 rerouted to poodr-guard-implementation; mutation check proved the already-set test catches 'if completed_at && false'; the run then failed at test-reviewer on a map defect (#1416), so the orchestrator hand-finished: os suite 50 runs 179 assertions green, rubocop clean on both files, one design audit with two should-fix notes answered in the commit message.

Follow-ups: #1416 (guard-map test-reviewer settles error; captured with ticket-skeptic VERDICT: CREATE).

## Resolution **Done:** Added plugins/os/tests/handoff/document_test.rb: three Handoff::Document tests built from strings (only the frontmatter completed_at line changes, with CRLF and in-body completed_at; already set raises naming the path; missing line raises on new naming the path). complete_test.rb keeps one CLI test per path (success, already completed, missing line, missing file); the success test no longer carries the CRLF/in-body detail. **Evidence:** Commit ac8eb444. Implementation 181 rerouted to poodr-guard-implementation; mutation check proved the already-set test catches 'if completed_at && false'; the run then failed at test-reviewer on a map defect (#1416), so the orchestrator hand-finished: os suite 50 runs 179 assertions green, rubocop clean on both files, one design audit with two should-fix notes answered in the commit message. **Follow-ups:** #1416 (guard-map test-reviewer settles error; captured with ticket-skeptic VERDICT: CREATE).
jared closed this issue 2026-10-27 16:02:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1406
No description provided.