Preserve closed Railiance item bindings during routine sync
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
8735a3549b
commit
cb60a00ee1
3 changed files with 90 additions and 1 deletions
|
|
@ -61,3 +61,42 @@ def test_historical_collision_still_blocks(tmp_path):
|
|||
with pytest.raises(ValueError, match='collisions='):
|
||||
ensure_missing_work_record_identifiers(tmp_path)
|
||||
assert live.read_bytes() == before
|
||||
|
||||
|
||||
def _railiance_item(root: Path, *, parent="RAILIANCE-WP-0004", status="finished",
|
||||
task_status="done", task_id="RAILIANCE-WP-0004-I01",
|
||||
binding="44444444-4444-4444-8444-444444444444") -> Path:
|
||||
path = root / "workplans" / "archived" / "railiance.md"
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(
|
||||
f'---\nid: {parent}\nstatus: {status}\n'
|
||||
'state_hub_workstream_id: "33333333-3333-4333-8333-333333333333"\n---\n'
|
||||
f'\n```task\nid: {task_id}\nstatus: {task_status}\n'
|
||||
f'state_hub_task_id: "{binding}"\n```\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
return path
|
||||
|
||||
|
||||
def test_railiance_historical_item_labels_preserve_uuid(tmp_path: Path) -> None:
|
||||
path = _railiance_item(tmp_path)
|
||||
before = path.read_bytes()
|
||||
result = ensure_missing_work_record_identifiers(tmp_path, execute=False)
|
||||
assert result["assignments"] == []
|
||||
assert result["files_changed"] == []
|
||||
assert path.read_bytes() == before
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kwargs", [
|
||||
{"status": "active"},
|
||||
{"task_status": "todo"},
|
||||
{"parent": "RAILIANCE-WP-0005", "task_id": "RAILIANCE-WP-0005-I01"},
|
||||
{"binding": ""},
|
||||
{"binding": "not-a-uuid"},
|
||||
{"task_id": "RAILIANCE-WP-0004-I08"},
|
||||
{"task_id": "OTHER-WP-0004-I01"},
|
||||
])
|
||||
def test_railiance_item_label_preservation_is_bounded(tmp_path: Path, kwargs) -> None:
|
||||
_railiance_item(tmp_path, **kwargs)
|
||||
with pytest.raises(ValueError, match="identities are not safe"):
|
||||
ensure_missing_work_record_identifiers(tmp_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue