DIV-45 commited on
Commit
015deb0
·
verified ·
1 Parent(s): 2441bab

fix: guard dynamic evidence routing

Browse files

Codex-authored reviewed policy guard for known claims after community-learning test.

Files changed (1) hide show
  1. src/packetcourt/investigator.py +8 -2
src/packetcourt/investigator.py CHANGED
@@ -42,7 +42,13 @@ def build_investigation(
42
  for claim in claim_names:
43
  routed_tool, source = route_claim(claim)
44
  router_model = source if source != "deterministic fallback" else router_model
45
- tool = routed_tool or policy_tool_for(claim)
 
 
 
 
 
 
46
  if tool in seen:
47
  continue
48
  seen.add(tool)
@@ -51,7 +57,7 @@ def build_investigation(
51
  tool=tool,
52
  reason=f"Required to audit the front claim: {claim}.",
53
  status="completed",
54
- source="fine-tuned router" if routed_tool else "policy fallback",
55
  )
56
  )
57
 
 
42
  for claim in claim_names:
43
  routed_tool, source = route_claim(claim)
44
  router_model = source if source != "deterministic fallback" else router_model
45
+ expected_tool = policy_tool_for(claim)
46
+ if claim in POLICY_TOOLS and routed_tool and routed_tool != expected_tool:
47
+ tool = expected_tool
48
+ step_source = "policy guard over fine-tuned router"
49
+ else:
50
+ tool = routed_tool or expected_tool
51
+ step_source = "fine-tuned router" if routed_tool else "policy fallback"
52
  if tool in seen:
53
  continue
54
  seen.add(tool)
 
57
  tool=tool,
58
  reason=f"Required to audit the front claim: {claim}.",
59
  status="completed",
60
+ source=step_source,
61
  )
62
  )
63