Loading…
Reference in a new issue
No description provided.
Delete branch "fix/609-610-wiki-suggestions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two changes to how a session's wiki suggestions are produced.
#609 — every suggestion was written twice
lore_consolidate_proposalswaits for its match tasks by callingself.retry(). That publishes a retry message and raisescelery.exceptions.Retry, which is anExceptionsubclass — so the task's outer handler caught it and_retry_unless_permanentcalledtask.retry()again, with the same30 · 2ⁿcountdown. Two identical deliveries then ran together, both saw every match row present, and both wrote.create_bot_lore_proposalsdeletes before inserting, but under READ COMMITTED neither delete sees the other's uncommitted rows.Measured before the fix: dev's replay session and one prod session each held 12 suggestions stored twice.
_retry_unless_permanentnow re-raisesRetryuntouched. Fixed in the shared helper rather than in the one task: all four lore tasks route through it, and any of them gaining aself.retry()later would reproduce the bug.readywith no cache rows left" as "a twin finished this" and returns.#610 — suggestions waited for no one
They were generated once, automatically, from the first transcription, and never again. They read the stored summary plus the raw transcript, never the verified events — so nothing a GM corrected could reach them. On the session used for pipeline testing, that left "Ironroot Hold" proposed as a real settlement after the GM's slip had been corrected in the events, alongside table chatter as lore.
The owner's decision, recorded on #610: suggestions should not exist until the GM has signed off on the content.
approve_session_contentqueues it, only whenlore_generation_status is None, so approve → withdraw → re-approve doesn't pay for a second extraction. A broker failure there is recorded and logged, never raised — approval is what the GM actually asked for.on_session_summary_available(..., first_time=False)is the one funnel every summary change passes through — regenerate, restore and hand-edit — so a newclear_wiki_suggestionstask fires there. It deletes the still-pending bot suggestions and resets the lore state to NULL, which returns the button to "Suggest wiki updates".proposed_by_botto False, so it cannot match the delete.Found while building, beyond the brief
process_audiosetlore_generation_status = pendingeagerly, which worked only because the fan-out queued the generation in the same breath. With generation gone from the fan-out, that would have left every newly transcribed session claiming queued work that nothing would ever pick up — the #413 failure shape, self-inflicted. Removed, along with the enqueue-failure handling that existed to catch it.Known gap, narrow and deliberate
A GM who regenerates while an extraction is still running gets the status reset, but the in-flight run still finishes and writes suggestions from the pre-correction text. That is no worse than today's behaviour, and closing it properly wants a generation epoch rather than a bigger delete. Noted on #610.
Verification
ruff format --checkandruff check, pinned to CI's 0.4.4: clean.lore_generation_status, and the approve handler already refetches the session.🤖 Generated with Claude Code