Stop the assistant duplicating K&S tasks; fix relative weekday dates

↗ view on GitHub · Peter Dombkins · 2026-08-02 · 91b65bac

Creating a task then asking to "set the due date for this task" produced a
SECOND identical task, reported as a success. The tool description already
asked the model to check for duplicates first; it didn't. So the check is now
server-side in ksCreateTask: a same-title create on the same matter is refused
and the error carries the existing task's id, which is the thing the model
needed in order to call ks_update_task instead. allow_duplicate covers the
genuine case.

Also: confirmations now state the record id, KS_SYSTEM_PROMPT leads with
"amend, do not re-create", and the date block became todaySection() so the
AGENT runtime gets it too - buildRolePrompt never went through buildMessages,
so agent steps had no idea what day it was while creating tasks due "next
Friday". That instruction now also says a bare weekday means the next
occurrence, and the resolved date must be stated in full.
Repository pdombkins/rose_lawyer
Author Peter Dombkins <pdombkins@gmail.com>
Authored
Parents e7016d2f
Stats 7 files changed , +164 , -30
Part of Guardrails on AI-agent writes to K&S

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-91b65bac.md from inside the repo you want the change in.

⬇ Download capture-commit-91b65bac.md