You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] wiki_refine_draft writes an empty lead, title, sections or frontmatter over the draft #585
ADR-1068 refuses a wiki_refine_draft call when title, lead, sections and frontmatter are all absent. The test is is None, so an empty value passes it and is written:
lead: "" replaces the draft's lead with an empty string. draft_curator._lead_is_placeholder then reads the draft as a placeholder and subtracts 0.25 from its score, so a call that refined nothing degrades the draft.
frontmatter: {} replaces the draft's frontmatter, dropping the updated stamp the synthesizer wrote (core/draft_synthesizer.py).
title: " " writes a blank title; evaluate_draft scores an empty title at −0.3.
sections: [] reaches the kind-contract validation, which refuses it for any kind with a required section. A kind with no required section would have its sections replaced by an empty list.
Each of those also writes a refined_llm memo saying a model refined the draft.
Measured by the review of PR #584 (#584 (comment)), which drove the three shapes against a real SQLite draft: lead: "" and frontmatter: {} returned updated: true and wrote a memo.
Expected behavior
A refinement carries a value. A field present in the call but empty (an empty or whitespace-only string, an empty list, an empty object) is refused by name, and the call writes neither the draft nor a memo. A call where every content field is absent stays refused as ADR-1068 says.
Blanking a field is not a refinement; nothing in Path B asks for it. wiki_write and wiki_purge are how a page's content is replaced or removed.
Evidence required to close
Tests driving lead: "", title: " ", sections: [], frontmatter: {}, and a mixed call (a real lead plus an empty title), each asserting the draft row and the memo count are unchanged and the response names the offending field.
Activity
fix(wiki): refuse a draft refinement whose value is empty (#585) (#586)