Skip to content

merge(hooks): stop recording the session-mentions note as the user's words - #4

Merged
LittleCoinCoin merged 1 commit into
mainfrom
fix/user-words-trailing
Nov 24, 2026
Merged

LittleCoinCoin merged 1 commit into
mainfrom
fix/user-words-trailing

Conversation

@LittleCoinCoin

Copy link
Copy Markdown
Member

A prompt that @-mentions a session reaches the UserPromptSubmit hook with a <system-reminder> holding <session-mentions> appended after the typed text. user_words.py cut platform blocks only at the start of the prompt, so that note was stored in __statera__/user_words.md as if the user had typed it. It was found live on a Linux login node (__reports__/linux_live/00-findings_v0.md).

The fix cuts that one block, and only when it ends the prompt, starts a line and opens with the mention list in the exact form the app writes. Typed or pasted text that merely contains the tag is kept.

Checked beyond the selftest, against the 3,052 human-typed prompts in the local transcripts: exactly the 20 prompts that carry the note change, each loses only that block, and no other platform block is appended after typed text. Long adversarial inputs (megabyte prompts of repeated or unclosed blocks) stay linear.

Scope: one script, plugins/murmuration/scripts/user_words.py. The Rust binary does not handle user_words, no hook row or persisted contract changes, and one revert undoes it. That is the self-merge lane of CONTRIBUTING.md. The fix commit is a fix, so CI cuts a patch release after the merge.

🤖 Generated with Claude Code

… text

When a prompt @-mentions a session, the desktop app appends a
<system-reminder> holding <session-mentions> after the typed text.
user_words.py cut platform blocks only at the start, so the note was
stored as the user's words (seen live on banyan, 2026-10-29).

strip_trailing() cuts that block only when it ends the prompt, starts a
line and opens with the mention list in the exact form seen. Typed or
pasted text that contains the tag elsewhere is kept. Across all 9,663
local transcript user records this is the only trailing platform block,
and the cut changes exactly its 7 prompts. The pattern has no leading
\s*, which made it quadratic on long whitespace runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LittleCoinCoin
LittleCoinCoin merged commit 9ec919a into main Nov 24, 2026
15 checks passed
@LittleCoinCoin
LittleCoinCoin deleted the fix/user-words-trailing branch November 24, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant