fix(runtime): exclude stale process resources during authority intersection

Catch ResourceIdentityError during intersection so that normal process exit
or background job termination does not crash child authority creation.
Stale or unverifiable observations are conservatively excluded from the
resulting authority while maintaining identity verification and preventing
PID reuse or renewal.
This commit is contained in:
Alexandre Teixeira
2026-10-02 18:54:09 +01:00
parent 525ae76df3
commit ab89e3274a
4 changed files with 145 additions and 7 deletions
+2 -2
View File
@@ -75,8 +75,8 @@ def test_child_cannot_renew_replaced_parent_process(monkeypatch):
monkeypatch.setattr(process_ownership, "verify", lambda pid, token: process_ownership.FOREIGN if token == "boot:start" else process_ownership.OWNED)
parent = RequestAuthority("parent", "alice", "thread", "", process_resources=(old,))
child = replace(parent, request_id="child", process_resources=(fresh,))
with pytest.raises(ResourceIdentityError):
parent.intersect(child)
result = parent.intersect(child)
assert result.process_resources == ()
def test_legacy_authority_cannot_reconstruct_creation_scope(tmp_path):