Skip to content

test(memory): add missing sanitize_guidelines tests for special-token and role-prefix patterns#1830

Merged
bug-ops merged 1 commit intomainfrom
test-memory-sanitize-guidelines
Mar 15, 2026
Merged

test(memory): add missing sanitize_guidelines tests for special-token and role-prefix patterns#1830
bug-ops merged 1 commit intomainfrom
test-memory-sanitize-guidelines

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 15, 2026

Summary

  • Add unit test for <|system|> special-token pattern being stripped by sanitize_guidelines
  • Add unit test for assistant: role prefix at line start being stripped
  • Add unit test for user: role prefix at line start being stripped

Closes #1807.

Test plan

  • cargo nextest run -p zeph-memory --features compression-guidelines -E 'test(sanitize)' — all 7 sanitize tests pass

… and role-prefix patterns

Closes #1807.

Three test cases were missing coverage for patterns already handled by
`sanitize_guidelines` regex rules:
- `<|system|>` special tokens (matched by the special-token regex)
- `assistant:` role prefix at line start
- `user:` role prefix at line start
@github-actions github-actions bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes tests Test-related changes size/S Small PR (11-50 lines) labels Mar 15, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 15:07
@bug-ops bug-ops merged commit c4bd2d2 into main Mar 15, 2026
15 checks passed
@bug-ops bug-ops deleted the test-memory-sanitize-guidelines branch March 15, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/S Small PR (11-50 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(memory): sanitize_guidelines missing tests for special-token and role-prefix patterns

1 participant