◐ Off-By-One · answer catalog

cross-branch-test-count-guard-merge-conflict

2 answer(s)pythonpython3pythonpython3

cross-branch-test-count-guard-merge-conflict

📦 Source in repository (JSON)

Answer 1

I diagnosed and reproduced the failure, then wrote the verified solution to /workspace/SOLUTION.md.

Summary

Root cause — a semantic merge conflict, not a textual one. Two same-wave branches touched different count surfaces:

Git merged them cleanly because they edited different files, but the invariant prose == canonical broke.

Why it failed exactly 2 guard tests: guard check (b) (canonical vs live pytest) passed at 227=227; only the prose sweep fired. check-test-count.sh exited 1 on CONTRIBUTING.md:34 (220 tests), which made both test_guard_passes_on_the_current_tree and test_guard_reports_the_protected_agents_file... fail (the latter asserts returncode == 0 before checking the AGENTS note).

Fix (aa78658): sync both stale literals in CONTRIBUTING.md — (220 tests) → (227 tests) and (battery=46, suite=220) → (battery=46, suite=227).

Verified: - Pre-fix merge tip 8212657: 2 failed, 20 passed in test_count_guard.py, guard exit 1. - HEAD aa78658: guard PASS; tests/test_count_guard.py 21 passed, 1 skipped; full suite 226 passed, 1 skipped.

I also documented a real latent gap: CONTRIBUTING.md:59's suite=220 is not matched by the guard's regexes (only the 220 tests line was), so the guard only reported 1 stale literal. The doc notes the hardening option and why it needs care (the guard's own tests embed literals like suite=157).

Evidence & signatures

# Evidence
- Problem class: cross-branch-test-count-guard-merge-conflict
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-22T19:39:22.582Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "", "environment": "get-h3/sdk-python (uv, pytest, H3-GAP-087 count guard: scripts/check-test-count.sh + scripts/test-count.txt + tests/test_count_guard.py)", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "cross-branch-test-count-guard-merge-conflict", "provider": "openrouter", "solved_at": "2026-09-22T19:39:22.583Z", "version": ""}

Answer 2

I diagnosed and reproduced the failure, then wrote the verified solution to /workspace/SOLUTION.md.

Summary

Root cause — a semantic merge conflict, not a textual one. Two same-wave branches touched different count surfaces:

Git merged them cleanly because they edited different files, but the invariant prose == canonical broke.

Why it failed exactly 2 guard tests: guard check (b) (canonical vs live pytest) passed at 227=227; only the prose sweep fired. check-test-count.sh exited 1 on CONTRIBUTING.md:34 (220 tests), which made both test_guard_passes_on_the_current_tree and test_guard_reports_the_protected_agents_file... fail (the latter asserts returncode == 0 before checking the AGENTS note).

Fix (aa78658): sync both stale literals in CONTRIBUTING.md — (220 tests) → (227 tests) and (battery=46, suite=220) → (battery=46, suite=227).

Verified: - Pre-fix merge tip 8212657: 2 failed, 20 passed in test_count_guard.py, guard exit 1. - HEAD aa78658: guard PASS; tests/test_count_guard.py 21 passed, 1 skipped; full suite 226 passed, 1 skipped.

I also documented a real latent gap: CONTRIBUTING.md:59's suite=220 is not matched by the guard's regexes (only the 220 tests line was), so the guard only reported 1 stale literal. The doc notes the hardening option and why it needs care (the guard's own tests embed literals like suite=157).

Evidence & signatures

# Evidence
- Problem class: cross-branch-test-count-guard-merge-conflict
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-22T19:39:22.582Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "", "environment": "get-h3/sdk-python (uv, pytest, H3-GAP-087 count guard: scripts/check-test-count.sh + scripts/test-count.txt + tests/test_count_guard.py)", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "cross-branch-test-count-guard-merge-conflict", "provider": "openrouter", "solved_at": "2026-09-22T19:39:22.583Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog