M5a plan, task 04: chat-template tags built from pieces

Task 04's session read the given test and the check.rs skeleton, both
holding the tags the check refuses, and Ornith took them for its own
template. It lost track of the file and made no change. The tags are
now built with concat! and format! in check.rs and in the four given
tests that held them, and the spec describes them in words. The
rewritten tests pass against the reference, are rustfmt-clean, and
still catch the case-folding mutation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-25 16:41:44 -07:00
committed by kyle
co-authored by Claude Opus 5.5
parent b84b9af540
commit 8328e8f607
8 changed files with 45 additions and 15 deletions
+4 -1
View File
@@ -229,7 +229,10 @@ if it contains:
U+3164, U+2800, U+2028 and U+2029, which are invisible without being in that property or in
category `Cf` (`docs/research/2026-09-24-prompt-injection-memory.md`, section 2). The table
is fixed in the code, from Unicode 16 data;
3. chat-template markup: `<|` or `|>`, or `<think`, `</think`, `<tool_call`, `</tool_call`;
3. chat-template markup: a less-than sign followed by a vertical bar, or a vertical bar followed
by a greater-than sign; or the opening or closing tags of `think` and `tool_call` (written out
only in `check.rs`, and there built from pieces: a model reading the literal tags could take them
for its own);
4. one of these phrases, ignoring case and runs of spaces: `ignore previous instructions`,
`ignore all previous`, `disregard previous instructions`, `disregard all previous`,
`new instructions:`, `system prompt:`.