noqt commited on
Commit
92cd7cd
·
1 Parent(s): b47532c

fix: deny approval inheritance to complete descendants

Browse files
src/lumi_eggcracker/supervisor.py CHANGED
@@ -744,6 +744,7 @@ class Supervisor:
744
  *,
745
  profile: str | None = None,
746
  scope: tuple[_EvidenceCandidate, ...] = (),
 
747
  ) -> bool:
748
  """Authorize a partial topology worker anchored by the exact launch.
749
 
@@ -751,10 +752,12 @@ class Supervisor:
751
  time was not present at the pre-exec gate. A bounded split-topology
752
  match may use the root-owned launch provenance only while the exact
753
  approved anchor is itself a live member of that same detection scope.
754
- An independently complete descendant is evaluated in its own scope and
755
- cannot inherit approval merely by sharing the delegated cgroup. Direct
756
- profiles never receive this closure.
757
  """
 
 
758
  if profile not in {"content.gguf-ollama", "content.safetensors-vllm"}:
759
  return False
760
  if provenance is None or snapshot.uid != self.policy["workload_uid"]:
@@ -1816,6 +1819,7 @@ class Supervisor:
1816
  scope_provenance,
1817
  profile=detected.profile,
1818
  scope=scope,
 
1819
  )
1820
  # An active local lockdown turns an exact protected
1821
  # recurrence into an enforcement candidate even when a stale
 
744
  *,
745
  profile: str | None = None,
746
  scope: tuple[_EvidenceCandidate, ...] = (),
747
+ independently_complete: bool,
748
  ) -> bool:
749
  """Authorize a partial topology worker anchored by the exact launch.
750
 
 
752
  time was not present at the pre-exec gate. A bounded split-topology
753
  match may use the root-owned launch provenance only while the exact
754
  approved anchor is itself a live member of that same detection scope.
755
+ An independently complete descendant can never receive this closure,
756
+ even while the approved anchor is live in the same related component.
757
+ Direct profiles never receive this closure.
758
  """
759
+ if independently_complete:
760
+ return False
761
  if profile not in {"content.gguf-ollama", "content.safetensors-vllm"}:
762
  return False
763
  if provenance is None or snapshot.uid != self.policy["workload_uid"]:
 
1819
  scope_provenance,
1820
  profile=detected.profile,
1821
  scope=scope,
1822
+ independently_complete=candidate.fast_match is not None,
1823
  )
1824
  # An active local lockdown turns an exact protected
1825
  # recurrence into an enforcement candidate even when a stale
tests/test_supervisor.py CHANGED
@@ -232,6 +232,7 @@ class SupervisorTests(unittest.TestCase):
232
  provenance,
233
  profile="content.gguf-llama",
234
  scope=(anchor_candidate, child_candidate),
 
235
  )
236
  )
237
  self.assertTrue(
@@ -240,6 +241,7 @@ class SupervisorTests(unittest.TestCase):
240
  provenance,
241
  profile="content.gguf-ollama",
242
  scope=(anchor_candidate, child_candidate),
 
243
  )
244
  )
245
  self.assertFalse(
@@ -248,6 +250,16 @@ class SupervisorTests(unittest.TestCase):
248
  provenance,
249
  profile="content.gguf-ollama",
250
  scope=(child_candidate,),
 
 
 
 
 
 
 
 
 
 
251
  )
252
  )
253
 
 
232
  provenance,
233
  profile="content.gguf-llama",
234
  scope=(anchor_candidate, child_candidate),
235
+ independently_complete=False,
236
  )
237
  )
238
  self.assertTrue(
 
241
  provenance,
242
  profile="content.gguf-ollama",
243
  scope=(anchor_candidate, child_candidate),
244
+ independently_complete=False,
245
  )
246
  )
247
  self.assertFalse(
 
250
  provenance,
251
  profile="content.gguf-ollama",
252
  scope=(child_candidate,),
253
+ independently_complete=False,
254
+ )
255
+ )
256
+ self.assertFalse(
257
+ supervisor._authorizes_protected_scope(
258
+ child,
259
+ provenance,
260
+ profile="content.gguf-ollama",
261
+ scope=(anchor_candidate, child_candidate),
262
+ independently_complete=True,
263
  )
264
  )
265