pdombkins puts guardrails around Rose's K&S writes

The fork makes its AI assistant safer when it creates or updates work in K&S matters.

workflowintegration

Once an AI assistant can write into a matter system, a plausible-sounding mistake can become an operational one. pdombkins has tightened that handoff around the problems that tend to matter in practice: duplicate tasks, incorrect due dates and unclear confirmation of what actually changed.

  • Written actions now come back as a plain-language confirmation with a link to the affected matter.
  • Duplicate-task checks account for reworded titles, not just exact matches.
  • Relative dates such as weekdays are handled through fixed lookups rather than the model's own date calculations.
  • Internal Rose links now keep users inside the application instead of opening a new tab.

This is a useful pattern for legal teams considering AI agents that can act in a system of record: make every write visible, repeat-resistant and date-safe.

So what Legal-ops leads and product teams giving AI authority to create matter work should look closely at this approach.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

5 commits from pdombkins/rose_lawyer, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
7f7588eb fix(assistant): confirm K&S writes in prose, with a link, and supply today's date Peter Dombkins 2026-08-02 ↗ GitHub
commit body
After creating a task the assistant ended its turn with a step count and a
reasoning trace, so a successful write looked identical to a failed one.

The system prompt also contained no date at all, which is why the transcript
shows six steps spent triangulating 'today' from task due dates before
guessing at 'next Friday'. contextBuilders now supplies the date in
Australia/Sydney and tells the model not to infer it from scenario data.

All 13 K&S write functions now return { link, confirmation } - link is
/workspace/dashboard/matter/<id>, the Rose shell path rather than /firm, which
would drop the user out of the sidebar. KS_SYSTEM_PROMPT requires the final
answer to state what changed outside the reasoning, quote the specifics back,
use the returned link verbatim, and report failures as failures.
91b65bac Stop the assistant duplicating K&S tasks; fix relative weekday dates Peter Dombkins 2026-08-02 ↗ GitHub
commit body
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.
23140608 Make the duplicate-task guard survive the model rewording the title Peter Dombkins 2026-08-02 ↗ GitHub
commit body
The exact-title check shipped an hour ago was defeated on the first retry: asked
again for "Doument review", the model silently corrected the typo to "Document
review", which no longer matched, and a duplicate was created anyway. Tidying
input is normal model behaviour, so the comparison now normalises case,
punctuation and spacing and compares by edit distance across every task on the
matter. 0.85 blocks typo fixes, plurals and punctuation changes; "Document
review" vs "Document Review and Organization" scores 0.469 and still passes.

Same run also set a due date the request never mentioned, carried over from an
earlier turn, so KS_SYSTEM_PROMPT now leads with "write only what was asked for
in the current request". Confirmations render dates as "Friday, 14 August 2026"
- the server cannot know which Friday was meant, but naming the weekday makes
an off-by-a-week visible instead of hiding it in an ISO string.
5ad66527 Give the model a date lookup table instead of date arithmetic Peter Dombkins 2026-08-02 ↗ GitHub
commit body
Told the rule twice, it still wrote 14 August for "next Friday" asked on a
Sunday. So stop asking it to calculate: todaySection() now emits the next
occurrence of every weekday, pre-computed, and says to read the table. Verified
it rolls correctly when today is itself a Friday.

Same run also pushed the estimate from 10 to 20 by adding the requested hours
to the existing ones, and overwrote a due date the request never mentioned.
Both fields now say so explicitly in the update schema: the estimate REPLACES
rather than accumulates, and due_date must be omitted unless the current
request asks for it to change.
23d1752d Navigate Rose-internal links in the app, not a new tab Peter Dombkins 2026-08-02 ↗ GitHub
commit body
Every markdown link in an assistant message rendered with target="_blank",
including relative ones. So the K&S matter link the assistant now returns after
every write opened a new tab and reloaded the entire app, dropping the user out
of the shell - the precise thing /workspace was built to avoid.

Relative hrefs now go through next/link: same tab, client-side, sidebar intact.
External links keep _blank and noopener.

Checked while investigating a reported truncation of that link: the stored
messages are complete, closing bracket and all, and nothing in the renderer
clamps. The truncation was in copying out of the browser.

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-942.md from inside the repo you want the changes in.

⬇ Download capture-thread-942.md