unsloth/studio
danielhanchen 7dbe18ab51 studio: line-anchor trailing-plan list items and ship a backend pytest
While drafting backend/tests/test_trailing_plan.py for the changes
landed in b4e0985, the new tests surfaced a deeper false-positive the
earlier regex tightening missed.

For input "Let me explain:\n1. The function returns 42.\n\nThat's the
answer." the previous `(?:\s*(?:[-*•]|\d+\.)\s+[^\n]+\n?)+` allowed the
regex engine to backtrack and treat the in-prose "42." substring as a
second list-item marker: iter 1 consumed "1. The function returns 4"
and iter 2 consumed "2.\n\nThat's the answer." (with `\s+` greedily
crossing the empty-line break). The pattern then satisfied `\s*\Z` and
the buffer fired a spurious `Continue.` retry on what was already a
fully-formed answer.

Tighten the per-item boundary:

  - `[ \t]*` before the marker (no newlines): forces the marker to sit
    at the start of its own line. A mid-prose "42." cannot satisfy this
    because the engine cannot rewind past the preceding `\n` without
    invalidating the previous iteration's `[^\n]+\n` close.
  - `[ \t]+` between the marker and content: blocks an `\s+`-driven
    cross-newline reach into a closing paragraph.
  - `(?:\n|\Z)` at end of item: a real line break OR end of buffer.
    Preserves the "list at EOB with no trailing newline" case while
    eliminating the backtrack route.

Land backend/tests/test_trailing_plan.py at the same time, covering:

  - `_TRAILING_PLAN_INTENT` "let me know" closer exclusion (cycle-3 fix).
  - `_TRAILING_PLAN_LIST` correctly fires on genuine trailing lists
    (dash, asterisk, unicode bullet, numeric).
  - `_TRAILING_PLAN_LIST` does NOT fire on list + closing paragraph,
    list + closing sentence, list embedded mid-text, or the "42."
    in-prose digit case.
  - `_TRAILING_PLAN_COLON` fires on bare trailing intent-colons only.
  - `_trailing_plan_hit` composite cases.
  - The 600-char window slicing.

31 cases, all pass. Pins the regex behaviour against future regressions
inside the repo (the prior pin script lived only in the probing
workspace, not the studio tree).
2026-05-19 04:35:39 +00:00
..
backend studio: line-anchor trailing-plan list items and ship a backend pytest 2026-05-19 04:35:39 +00:00
frontend studio: engage draft-mtp on vision MTP GGUFs (drop incorrect vision gate) (#5560) 2026-05-18 08:42:55 -07:00
src-tauri studio: expose launcher capability bits on unauth /api/health (#5486) 2026-05-17 21:29:24 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py tests/studio: lock in Windows GPU detection fix (#5106) with a synthetic CI test (#5376) 2026-05-18 00:06:01 -07:00
install_python_stack.py studio: skip flash-attn install on Blackwell GPUs (sm_100+) (#5420) 2026-05-14 18:13:50 +04:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
setup.sh Route CPU-only Linux x86_64 to ggml-org/llama.cpp prebuilts (#5302) 2026-05-05 23:22:22 -07:00
Unsloth_Studio_Colab.ipynb studio: add --local to setup.sh + overlay unsloth-zoo from git main (#5252) 2026-05-02 08:51:56 +04:00