Conversation
The 🗣️ closer's name slot must resolve to the DA identity file's name at render time. When substitution fails, the raw placeholder reaches the user undetected — FormatGate had no rule for it and DriftReminder's pre-write contract didn't measure it. Adds a closer-line-only check to both: FormatGate records a da-placeholder violation, DriftReminder reports it in the next turn's contract. Closer-line only on purpose: quoting the placeholder in prose (e.g. discussing the format itself) is legitimate and a whole-message scan would false-positive on it. Co-Authored-By: Claude Code <noreply@anthropic.com>
Owner
|
Ported the intent (both hooks had been restructured since): FormatGate now flags a literal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The 🗣️ closer's name slot must resolve to the DA identity file's name at render time. When substitution fails, the raw
<DA>placeholder reaches the user undetected —FormatGatehad no rule for it andDriftReminder's pre-write contract didn't measure it.This adds the check to both hooks:
FormatGate.hook.ts(Stop, observation-only) records a newda-placeholderviolation toformat-gate.jsonl.DriftReminder.hook.ts(UserPromptSubmit, pre-write) reports it in the next turn'sFORMAT CONTRACTline, so the model is told before it writes.Why closer-line only, and why last visible line
The check is anchored to the last visible line (the real closer), never to "last line containing the emoji". Two reasons it can't be looser:
FormatGatealready does, keeps the two hooks consistent.The check also requires the last line to actually contain the emoji before it treats a
<DA>there as a leak, so a response with no closer at all isn't misattributed.Verification
All four cases exercised against the new
measure():🗣️ <DA>: …as final line)🗣️ <NAME>: …)No
~/.claudepaths, names, or identity data in the diff; the{{PRINCIPAL_NAME}}scaffold is preserved.