Spaces:
Sleeping
Sleeping
fix: guard dynamic evidence routing
Browse filesCodex-authored reviewed policy guard for known claims after community-learning test.
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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=
|
| 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 |
|