Add regression test for GreenAssertFailureSidecar segment-anchored test-path matching #475

Closed
opened 2026-08-21 20:24:58 +00:00 by jared · 5 comments
Owner

Context

Follow-up to #469. The fix at plugins/os-sdlc/lib/os_sdlc/green_assert_failure_sidecar.rb:52 (method under_test_path?) replaced String#include? with the segment-anchored regex %r{(^|/)#{Regexp.escape(@test_path)}(/|$)}, but plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb has no case that fails if it regresses. All existing cases pass bare paths like /repo/test/foo_test.rb:12 against test_path "test". The programmer role forbids test edits, so the #469 drive could not close the gap; the reviewer carried it as a non-blocking gap routed to test authorship. The equivalent regex is behaviorally pinned in write_guard_scope_test.rb (write_guard.rb:125).

Skeptic verdict: CREATE — concrete regression-coverage gap tied to a completed drive, not speculative.

Tasks

[ ] Add a case to GreenAssertFailureSidecarTest using the GreenAssertFailureSidecarCase helper: a production path under a tmpdir whose name contains the test_path substring (e.g. /repo/os-sdlc-test/foo.rb:5) must classify as shard/reserved, not "test"
[ ] Add a suffix row such as /repo/testdata/foo.rb:5 to pin the trailing (/|$) anchor

Acceptance criteria

[ ] Reverting green_assert_failure_sidecar.rb:52 to String#include? makes the suite red

Origin

  • Trigger: /os-sdlc:implement 469 drive, reviewer round 2 carried gap
  • Improvised this session: none
  • Chain: unpinned regex boundary ← programmer role forbids test edits (plugins/os-sdlc agent role contract) ← coding map v1 has no test-writer node — DESIGN (plugins/os-sdlc maps/coding.yaml)
  • Root candidate: this ticket
## Context Follow-up to #469. The fix at plugins/os-sdlc/lib/os_sdlc/green_assert_failure_sidecar.rb:52 (method under_test_path?) replaced String#include? with the segment-anchored regex %r{(^|/)#{Regexp.escape(@test_path)}(/|$)}, but plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb has no case that fails if it regresses. All existing cases pass bare paths like /repo/test/foo_test.rb:12 against test_path "test". The programmer role forbids test edits, so the #469 drive could not close the gap; the reviewer carried it as a non-blocking gap routed to test authorship. The equivalent regex is behaviorally pinned in write_guard_scope_test.rb (write_guard.rb:125). Skeptic verdict: CREATE — concrete regression-coverage gap tied to a completed drive, not speculative. ## Tasks [ ] Add a case to GreenAssertFailureSidecarTest using the GreenAssertFailureSidecarCase helper: a production path under a tmpdir whose name contains the test_path substring (e.g. /repo/os-sdlc-test/foo.rb:5) must classify as shard/reserved, not "test" [ ] Add a suffix row such as /repo/testdata/foo.rb:5 to pin the trailing (/|$) anchor ## Acceptance criteria [ ] Reverting green_assert_failure_sidecar.rb:52 to String#include? makes the suite red ## Origin - Trigger: /os-sdlc:implement 469 drive, reviewer round 2 carried gap - Improvised this session: none - Chain: unpinned regex boundary ← programmer role forbids test edits (plugins/os-sdlc agent role contract) ← coding map v1 has no test-writer node — DESIGN (plugins/os-sdlc maps/coding.yaml) - Root candidate: this ticket
Author
Owner

Body corrected 2026-08-23 from code-probe verification (agent a2842c9e01637ab98, claude-sonnet-5).

Change log:

  • Corrected green_assert_failure_sidecar.rb line citation from :50 to :52 (method under_test_path?), in both the Context section and the acceptance criterion.
  • Added the write_guard.rb:125 line reference for the equivalent pinned regex.

Reason: pure line-drift; the regression-coverage gap itself (no test case exercises a substring/segment-boundary match) is confirmed unchanged and still open.

Body corrected 2026-08-23 from code-probe verification (agent a2842c9e01637ab98, claude-sonnet-5). Change log: - Corrected green_assert_failure_sidecar.rb line citation from :50 to :52 (method under_test_path?), in both the Context section and the acceptance criterion. - Added the write_guard.rb:125 line reference for the equivalent pinned regex. Reason: pure line-drift; the regression-coverage gap itself (no test case exercises a substring/segment-boundary match) is confirmed unchanged and still open.
Author
Owner

This was generated by AI during triage.

Agent brief

Goal: pin the segment-anchored test-path regex in GreenAssertFailureSidecar#under_test_path? with regression tests.

Verified 2026-08-26: the regex now sits at plugins/os-sdlc/lib/os_sdlc/green_assert_failure_sidecar.rb:54 (ticket body says :52 — line drift only; anchor on the method name under_test_path?). The gap is still open: every case in plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb uses paths that pass under both String#include? and the regex, so a revert would not turn the suite red. The GreenAssertFailureSidecarCase helper exists at line 9 of that test file.

Steps:

  1. Add a case with a substring directory path, e.g. /repo/os-sdlc-test/foo.rb:5 with test_path "test" — must NOT classify as test.
  2. Add a prefix case, e.g. /repo/testdata/foo.rb:5 — must NOT classify as test, pinning the trailing (/|$) anchor.
  3. Confirm the acceptance criterion: temporarily revert line 54 to String#include?; the suite must go red on the new cases; restore the regex.

Scope: test file only; no production changes.

> *This was generated by AI during triage.* ## Agent brief **Goal:** pin the segment-anchored test-path regex in `GreenAssertFailureSidecar#under_test_path?` with regression tests. **Verified 2026-08-26:** the regex now sits at `plugins/os-sdlc/lib/os_sdlc/green_assert_failure_sidecar.rb:54` (ticket body says :52 — line drift only; anchor on the method name `under_test_path?`). The gap is still open: every case in `plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb` uses paths that pass under both `String#include?` and the regex, so a revert would not turn the suite red. The `GreenAssertFailureSidecarCase` helper exists at line 9 of that test file. **Steps:** 1. Add a case with a substring directory path, e.g. `/repo/os-sdlc-test/foo.rb:5` with `test_path "test"` — must NOT classify as `test`. 2. Add a prefix case, e.g. `/repo/testdata/foo.rb:5` — must NOT classify as `test`, pinning the trailing `(/|$)` anchor. 3. Confirm the acceptance criterion: temporarily revert line 54 to `String#include?`; the suite must go red on the new cases; restore the regex. **Scope:** test file only; no production changes.
Author
Owner

This was generated by AI during triage.

Work started on branch worktree-ticket-475 via /os-sdlc:implement.

> *This was generated by AI during triage.* Work started on branch worktree-ticket-475 via /os-sdlc:implement.
Author
Owner

This was generated by AI during triage.

Pipeline run failed: implementation_failed, reason bound_exhausted:test-writer/fail (implementation 1, branch worktree-ticket-475).

Failed step: test-writer node, poodr-implementation map.
Gate details: all gate runs (dispatches 5–7, step_results 1–4) exited 0 — the full suite stayed green with the new regression cases in place. The test-writer gate requires the new test to be red for the intended reason; a green result follows the node's fail edge, and three rounds exhausted the bound.

Diagnosis: structural mismatch, not a defect in the tests. This ticket pins already-shipped behavior (the segment-anchored regex from #469), so a correct regression test passes immediately; red is only reachable by reverting production code, which the test-writer role forbids. The 18-line diff to plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb is preserved on the branch. The acceptance criterion (revert to String#include? goes red) still needs a one-off verification outside the map.

> *This was generated by AI during triage.* Pipeline run failed: `implementation_failed`, reason `bound_exhausted:test-writer/fail` (implementation 1, branch worktree-ticket-475). **Failed step:** test-writer node, poodr-implementation map. **Gate details:** all gate runs (dispatches 5–7, step_results 1–4) exited 0 — the full suite stayed green with the new regression cases in place. The test-writer gate requires the new test to be red for the intended reason; a green result follows the node's fail edge, and three rounds exhausted the bound. **Diagnosis:** structural mismatch, not a defect in the tests. This ticket pins already-shipped behavior (the segment-anchored regex from #469), so a correct regression test passes immediately; red is only reachable by reverting production code, which the test-writer role forbids. The 18-line diff to plugins/os-sdlc/tests/green_assert_failure_sidecar_test.rb is preserved on the branch. The acceptance criterion (revert to String#include? goes red) still needs a one-off verification outside the map.
Author
Owner

Resolution

Done: Regression test added pinning the segment-anchored test-path match in GreenAssertFailureSidecar; production fix itself had already shipped in adc7d24

Evidence: Commit 2a88f9c merged to main (fast-forward). Red-proof: with the pre-adc7d24 include? regex restored, the new test fails (2 failures); with the fix, full suite 1223 runs, 0 failures

Follow-ups: Pipeline routing gaps found during this run (no escalate verdict for persistent unexpected-pass on expect:red gates; triage stages never check git log for the ticket's own prior commits) — deliberately not captured yet, pending user decision

## Resolution **Done:** Regression test added pinning the segment-anchored test-path match in GreenAssertFailureSidecar; production fix itself had already shipped in adc7d24 **Evidence:** Commit 2a88f9c merged to main (fast-forward). Red-proof: with the pre-adc7d24 include? regex restored, the new test fails (2 failures); with the fix, full suite 1223 runs, 0 failures **Follow-ups:** Pipeline routing gaps found during this run (no escalate verdict for persistent unexpected-pass on expect:red gates; triage stages never check git log for the ticket's own prior commits) — deliberately not captured yet, pending user decision
jared closed this issue 2026-08-27 12:46:34 +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#475
No description provided.