Skip to content

fix: collapse all line terminators in digest_line - #128

Open
goktugozkanmd wants to merge 1 commit into
AI-Safety-Institute:mainfrom
goktugozkanmd:fix/digest-line-terminators
Open

goktugozkanmd wants to merge 1 commit into
AI-Safety-Institute:mainfrom
goktugozkanmd:fix/digest-line-terminators

Conversation

@goktugozkanmd

Copy link
Copy Markdown

Closes #89

Summary

  • Added _flatten() (" ".join(text.split())) in src/transect/scanners/digests.py and applied it across digest_line() (reasoning, text, bare (tools: ...) names, target replies, and delegations) and _call_part() (tool names, arguments, and outputs) so non-LF line terminators (\r, \x0b, \x0c, U+0085, U+2028, U+2029) and newlines in bare tool names cannot split a single turn into extra lines.
  • Bumped package version 0.7.0 -> 0.7.1 in pyproject.toml and uv.lock per CONTRIBUTING.md.
  • Added regression tests in tests/test_digests.py covering all 8 line terminators across every digest field and the bare (tools: ...) branch.

Verification

  • pytest -q tests/test_digests.py: 32 passed (23 before -> 32 after).
  • pytest -q across scanner, phase, Petri, batching, turn-axis, and sub-agent test suites: 250 passed, 2 skipped.
  • ruff check src tests and ruff format --check src tests: clean (98 files formatted).
  • mypy src/transect/scanners/digests.py and pyright src/transect/scanners/digests.py: 0 errors.

@alexandraabbas alexandraabbas self-assigned this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

digest_line only flattens LF, so other line terminators forge turns

2 participants