feat: plan 18
This commit is contained in:
@@ -134,6 +134,20 @@ def classify(message: str, model_verdict: str = ""):
|
||||
"classified_at": now_iso(),
|
||||
}
|
||||
|
||||
analysis_hits = contains_any(text, policy.get("analysis_terms", []))
|
||||
if analysis_hits:
|
||||
acfg = policy.get("analysis", policy["read_only"])
|
||||
return {
|
||||
"mode": "ANALYSIS",
|
||||
"risk": acfg["risk"],
|
||||
"gates": acfg["gates"],
|
||||
"needs_approval": bool(acfg.get("needs_approval", False)),
|
||||
"reason": "analysis_reasoning_requested",
|
||||
"matched_rules": analysis_hits,
|
||||
"side_effect_allowed": False,
|
||||
"classified_at": now_iso(),
|
||||
}
|
||||
|
||||
read_terms = policy.get("read_only_terms", [])
|
||||
read_hits = [t for t in read_terms if re.search(rf"\b{re.escape(t.lower())}\b", text)]
|
||||
# Model-assisted verdict can only increase caution. In MVP-0 an unsafe model
|
||||
|
||||
Reference in New Issue
Block a user