test: add non-ci strict #TBD regression coverage for handover gate (#358) #359

Merged
jihoson merged 1 commits from feature/issue-358-handover-nonci-tbd into feature/v3-session-policy-stream 2026-03-01 21:10:05 +09:00
Showing only changes of commit 999091e003 - Show all commits

View File

@@ -98,3 +98,31 @@ def test_non_ci_strict_enforces_date_branch_and_merge_gate(monkeypatch, tmp_path
assert any("must contain today's UTC date" in e for e in errors) assert any("must contain today's UTC date" in e for e in errors)
assert any("must target current branch" in e for e in errors) assert any("must target current branch" in e for e in errors)
assert any("merged_to_feature_branch=no" in e for e in errors) assert any("merged_to_feature_branch=no" in e for e in errors)
def test_non_ci_strict_still_blocks_tbd_next_ticket(monkeypatch, tmp_path) -> None:
module = _load_module()
handover = tmp_path / "session-handover.md"
handover.write_text(
"\n".join(
[
"### 2000-01-01 | session=test",
"- branch: feature/other-branch",
"- docs_checked: docs/workflow.md, docs/commands.md, docs/agent-constraints.md",
"- open_issues_reviewed: #1",
"- next_ticket: #TBD",
"- process_gate_checked: process_ticket=#1 merged_to_feature_branch=yes",
]
),
encoding="utf-8",
)
monkeypatch.setattr(module, "HANDOVER_LOG", handover)
errors: list[str] = []
module._check_handover_entry(
branch="feature/current-branch",
strict=True,
ci_mode=False,
errors=errors,
)
assert "latest handover entry must not use placeholder next_ticket (#TBD)" in errors