round_tests must skip test files deleted in the current round #823

Closed
opened 2026-09-29 14:03:22 +00:00 by jared · 2 comments
Owner

Problem

The round_tests brief fact crashes when a red round deletes a test file after a programmer dispatch has passed. git diff --name-only lists deleted paths, and Project::Changes#test_paths passes them to Git::Repo#modified_since?. That method calls File.mtime on each path, and File.mtime raises on a missing file. The test-reviewer brief is then never built, and the run stops. A ticket with ## Retired tests makes the test-writer delete test files, so this can happen on the behavior-verifier fail edge that #811 fixed.

Reproduce

n/a: needs a red round after a passed programmer dispatch that deletes a test file; acceptance criterion 1 states the setup.

Approach

# plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb
def modified_since?(path, time)
  full = File.join(@root.to_s, path)
  File.exist?(full) && File.mtime(full) > time
end

A deleted test cannot be red, so round_tests must not name it. Mapped test paths are not affected, because Codebase#tests_for returns only existing candidates.

Required work:

  1. Git::Repo#modified_since? returns false for a path that does not exist.

Rejected: rescue Errno::ENOENT in modified_since? — exception for control flow; the missing file is an expected state.

Acceptance criteria

  1. Given a passed programmer dispatch and a red round that deletes an earlier test file and writes a new test file, when the round_tests fact is built, then it names the new test file, does not name the deleted file, and does not raise.

Owner sketch

module OsSdlc
  module Git
    class Repo
      def modified_since?(path, time)
    end
  end
end

Origin

  • Trigger: /os-sdlc:implement 811, implementation 75
  • Improvised this session: none
  • Chain: test-reviewer brief not built ← Errno::ENOENT from File.mtime ← Git::Repo#modified_since? reads deleted git-diff paths (behavior-verifier 750 and contract-auditor 752 GAP items) ← DESIGN (plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb, added in 11339a12)
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb Git::Repo#modified_since?
  • Session: 496340f6-0a0a-43ff-8404-0453d7b6aeb4
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/496340f6-0a0a-43ff-8404-0453d7b6aeb4.jsonl

VERDICT: CREATE — user approved filing this follow-up of #811 on 2026-09-29.

## Problem The `round_tests` brief fact crashes when a red round deletes a test file after a programmer dispatch has passed. `git diff --name-only` lists deleted paths, and `Project::Changes#test_paths` passes them to `Git::Repo#modified_since?`. That method calls `File.mtime` on each path, and `File.mtime` raises on a missing file. The test-reviewer brief is then never built, and the run stops. A ticket with `## Retired tests` makes the test-writer delete test files, so this can happen on the behavior-verifier fail edge that #811 fixed. ## Reproduce n/a: needs a red round after a passed programmer dispatch that deletes a test file; acceptance criterion 1 states the setup. ## Approach ```ruby # plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb def modified_since?(path, time) full = File.join(@root.to_s, path) File.exist?(full) && File.mtime(full) > time end ``` A deleted test cannot be red, so `round_tests` must not name it. Mapped test paths are not affected, because `Codebase#tests_for` returns only existing candidates. Required work: 1. `Git::Repo#modified_since?` returns false for a path that does not exist. Rejected: `rescue Errno::ENOENT` in `modified_since?` — exception for control flow; the missing file is an expected state. ## Acceptance criteria 1. Given a passed programmer dispatch and a red round that deletes an earlier test file and writes a new test file, when the `round_tests` fact is built, then it names the new test file, does not name the deleted file, and does not raise. ## Owner sketch ```ruby module OsSdlc module Git class Repo def modified_since?(path, time) end end end ``` ## Origin - Trigger: /os-sdlc:implement 811, implementation 75 - Improvised this session: none - Chain: test-reviewer brief not built ← `Errno::ENOENT` from `File.mtime` ← `Git::Repo#modified_since?` reads deleted git-diff paths (behavior-verifier 750 and contract-auditor 752 GAP items) ← DESIGN (plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb, added in 11339a12) - Root candidate: this ticket - Where: plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb `Git::Repo#modified_since?` - Session: 496340f6-0a0a-43ff-8404-0453d7b6aeb4 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/496340f6-0a0a-43ff-8404-0453d7b6aeb4.jsonl VERDICT: CREATE — user approved filing this follow-up of #811 on 2026-09-29.
Author
Owner

Work started on branch ticket-takedown (worktree .claude/worktrees/ticket-takedown), via /os-sdlc:implement.

Work started on branch ticket-takedown (worktree .claude/worktrees/ticket-takedown), via /os-sdlc:implement.
Author
Owner

Resolution

Done: Git::Repo#modified_since? returns false for a missing path; round_tests no longer raises on test files deleted in the current round

Evidence: branch ticket-takedown commit 40a523d8 (history row f95388d1); implementation 76: 8 dispatches, all pass, suite-check green; regression test test_round_that_deletes_an_earlier_test_names_only_the_new_test

Follow-ups: none: auditors noted Changes#test_diff passes deleted paths to Repo#diff; a diff of a deleted tracked path shows the deletion, which the reviewer needs for retired tests, so it is not a defect

## Resolution **Done:** Git::Repo#modified_since? returns false for a missing path; round_tests no longer raises on test files deleted in the current round **Evidence:** branch ticket-takedown commit 40a523d8 (history row f95388d1); implementation 76: 8 dispatches, all pass, suite-check green; regression test test_round_that_deletes_an_earlier_test_names_only_the_new_test **Follow-ups:** none: auditors noted Changes#test_diff passes deleted paths to Repo#diff; a diff of a deleted tracked path shows the deletion, which the reviewer needs for retired tests, so it is not a defect
jared closed this issue 2026-09-29 14:09:04 +00:00
jared referenced this issue from a commit 2026-09-29 16:46:31 +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#823
No description provided.