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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user