Ghostlight/crates
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 275b0f21e6 Require word boundaries at both ends of a located source span (PA.f67)
`SourceSpan::locate` in ghostlight-persona-projection was a raw substring
`find`: "I can" byte-exact matched inside "I cannot go" and was accepted as
the quoted span, even though it is not the word the model claims to be
quoting. "Speech is a verbatim span" only holds if the span's edges are word
edges.

`locate` now walks every occurrence of the quote (`match_indices`) and takes
the first one whose start and end each land on a word boundary: the edge of
the source, or a character that is not Unicode-alphanumeric
(`starts_on_word_boundary` / `ends_on_word_boundary`). A first occurrence
that fails either edge is skipped in favor of a later one.

The Interpreter (crates/ghostlight/src/controllers.rs) calls the same
function through `SourceRange`; `cargo test -p ghostlight --lib` still passes
at 603, so no existing test relied on a mid-word span.

Added five tests: a mid-word quote is refused, a whole-word quote is
accepted, a span equal to the whole source is accepted, a later
boundary-valid occurrence is found after an invalid first one (the first
occurrence fails only the start edge), and punctuation at a span's edges is
handled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 15:15:22 +02:00
..
ghostlight Pin the Persona checkpoint's request check and the forged-effect replay refusal (PA.f50, PA.f51) 2026-09-22 15:07:55 +02:00
ghostlight-dungeon Fix refusal text, split its actor-facing twin, and read a fault's disposition (PA.f56, PA.f57, PA.f60) 2026-09-22 13:05:04 +02:00
ghostlight-persona-projection Require word boundaries at both ends of a located source span (PA.f67) 2026-09-22 15:15:22 +02:00