Set up daily WSJF closure gates

This commit is contained in:
2026-06-07 11:00:03 +02:00
parent 418eb4ffda
commit 4e8ccbb344
9 changed files with 431 additions and 4 deletions

View File

@@ -115,6 +115,42 @@ def test_state_hub_progress_sink_posts(monkeypatch) -> None:
assert posts[0]["json"]["detail"]["review_required"] is False
def test_state_hub_progress_includes_prior_working_memory_path(
monkeypatch,
tmp_path,
) -> None:
posts: list[dict[str, Any]] = []
def fake_get(url: str, **kwargs: Any) -> DummyResponse:
return DummyResponse([])
def fake_post(url: str, **kwargs: Any) -> DummyResponse:
posts.append({"url": url, **kwargs})
return DummyResponse({"id": "progress-1"})
monkeypatch.setattr(httpx, "get", fake_get)
monkeypatch.setattr(httpx, "post", fake_post)
result = persist_reports(_payload([
{
"type": "working-memory",
"path": str(tmp_path),
"timezone": "Europe/Berlin",
},
{
"type": "state-hub-progress",
"state_hub_url": "http://state-hub.test",
"event_type": "daily_triage",
},
]))
assert [entry["status"] for entry in result] == ["written", "posted"]
assert posts[0]["json"]["detail"]["working_memory_path"] == str(
tmp_path / "daily-triage-2026-05-19-12345678.md"
)
assert posts[0]["json"]["detail"]["working_memory_status"] == "written"
def test_state_hub_progress_sink_is_idempotent(monkeypatch) -> None:
def fake_get(url: str, **kwargs: Any) -> DummyResponse:
return DummyResponse([