fix(registrar): register newly closed workplans

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a023c0-a0a3-7c03-b395-5a0d2757214d
This commit is contained in:
tegwick 2026-08-22 12:57:59 +02:00
parent 833fa6e746
commit 69adfff48d
2 changed files with 31 additions and 5 deletions

View file

@ -51,13 +51,30 @@ def test_requires_explicit_primary_confirmation(tmp_path: Path) -> None:
assert result.error and result.error["code"] == "confirmation_required"
def test_closed_records_are_not_registrar_work(tmp_path: Path) -> None:
def test_unlinked_closed_workplan_is_registrar_work(tmp_path: Path) -> None:
repo = _fixture(tmp_path)
workplan = repo / "workplans" / "DEMO-WP-0001.md"
workplan.write_text(
workplan.read_text(encoding="utf-8").replace("status: active", "status: finished"),
encoding="utf-8",
)
assert rr._missing_identifiers(repo) == {
"workplans": ["DEMO-WP-0001"],
"tasks": ["DEMO-WP-0001-T01"],
"intakes": [],
"decisions": [],
}
def test_linked_closed_workplan_does_not_reopen_historical_task_gaps(tmp_path: Path) -> None:
repo = _fixture(tmp_path)
workplan = repo / "workplans" / "DEMO-WP-0001.md"
text = workplan.read_text(encoding="utf-8")
text = text.replace(
"status: active\n---",
'status: finished\nstate_hub_workstream_id: "11111111-1111-4111-8111-111111111111"\n---',
)
workplan.write_text(text, encoding="utf-8")
assert rr._missing_identifiers(repo) == {
"workplans": [],
"tasks": [],