test(viewer): lock in 2 more "act of <X>" survive-cases for the chronicle inter-beat strip - #909
Conversation
…nicle inter-beat strip (#890)
|
Warning Review limit reached
More reviews will be available in 1 hour, 29 minutes, and 24 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
What
Adds two confirmed real-prose strings to the survive-case list in
test_real_prose_mentioning_a_beat_or_transition_survives(
viewer/tests/test_chronicle_dedup_opening.py):At the start of the act, the curtain rose on a darkened stage.The beginning of the act of treason was a single forged letter.Both must pass through
sanitizeNarrationunchanged.Why
The
_BEAT_TRANSITIONregex added in #890 strips inter-beat transition meta-text("End of beat.", "Beginning the next beat.") from the player-facing chronicle. Two of
its arms (
<end/close/beginning/start> of the <struct>and<begin/start> the <struct>)could over-strip legitimate fiction containing the
act of <X>idiom(act of mercy / war / treason / contrition) — the worst-offender class, since story
quality is the project's north star.
The production fix is already shipped in #890 itself (commit a422b57): the two arms
use
_STRUCT_FWD = "(?:beat|scene)"(droppingact/chapter/part) and a terminal\s*[.!?]?\s*$anchor. Verified under Node: all six confirmed false-positive sentencessurvive the current regex, while the pre-fix form strips all six — and the engine seam
notes ("End of beat.", "Beginning the next beat.") still strip correctly.
The test file already covered 4 of the 6 confirmed strings (1 verbatim + 3 close
variants + a bonus "part of the story" case). This PR adds the remaining 2 so every
confirmed string is locked in as a regression guard. These have teeth: they fail against
the pre-fix regex, pass against the shipped one.
Test
Test-only, additive (6 lines). No production change.