fix(planner): surface dropped weight entries in PUT /realism/config response

_parse_weights was silently dropping content_class values that don't
belong on their target list with no operator feedback. Changed it to
return (weights, dropped), apply_payload to collect and return all
dropped names, and put_config to include dropped_entries in the
response when non-empty.
This commit is contained in:
2026-04-30 21:18:41 -04:00
parent 8a40f6ced0
commit a8c69155ff
2 changed files with 33 additions and 18 deletions

View File

@@ -104,7 +104,7 @@ async def put_config(
raise HTTPException(status_code=400, detail="body must be an object")
try:
planner.apply_payload(body)
dropped = planner.apply_payload(body)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@@ -120,4 +120,7 @@ async def put_config(
user.get("username", user.get("uuid")),
snapshot["canary_probability"],
)
return snapshot
response: dict[str, Any] = dict(snapshot)
if dropped:
response["dropped_entries"] = dropped
return response