Skip to content

Fix sanitization moderation IDs - #3058

Merged
tisnik merged 1 commit into
lightspeed-core:release/0.7from
madaosik:backport/sanitization-moderation-id-0.7
Oct 29, 2026
Merged

tisnik merged 1 commit into
lightspeed-core:release/0.7from
madaosik:backport/sanitization-moderation-id-0.7

Conversation

@madaosik

Copy link
Copy Markdown

Summary

Ensure the pre-shield input sanitization path returns moderation IDs with the established modr- prefix.

Without this prefix, clients cannot identify sanitization refusals as moderation blocks, and a refused turn cannot participate in history-poisoning remediation flows.

Changes

  • Prefix sanitization-generated moderation IDs with modr-.
  • Add a regression assertion for the prefix.

Validation

  • uv run pytest -q tests/unit/utils/test_shields.py (21 passed)

When input sanitization blocks a request in run_shield_moderation_v2,
the ShieldModerationBlocked was using str(uuid.uuid4()) for moderation_id
instead of the established f'modr-{uuid4()}' convention.

LCORE uses the 'modr-' prefix to identify moderation-blocked responses
(see is_moderation_id() in suid.py). Existing capabilities
(QuestionValidity, PiiRedactionCapability) already follow this convention.
Without the prefix, callers cannot distinguish a shield block from a
regular response via the response ID.

Also adds an explicit assertion to the existing sanitization block test
to prevent regression.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@madaosik

madaosik commented Oct 28, 2026 •

Copy link
Copy Markdown
Author

@asimurka, @tisnik - this fix to return the modr- ID prefix for moderated content as per Lightspeed-stack's convention already got merged to main via #2862.

It didn't get to v0.7.2 via #3026 as the LCORE history handling fix in #3021 did, though.

Could you backport it as well, please, so that we are able to move to 0.7.2 in our staging? CC: @r0x0d, @samdoran

@tisnik
tisnik requested a review from asimurka October 28, 2026 19:06

@asimurka asimurka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisnik
tisnik merged commit 8c81955 into lightspeed-core:release/0.7 Oct 29, 2026
42 of 47 checks passed
@fullsend-ai-retro

fullsend-ai-retro Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 4:08 PM UTC · Completed 4:20 PM UTC

Commit: a2a1ad2 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.63

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #3058 — Fix sanitization moderation IDs (backport to release/0.7)

This was a straightforward manual backport of PR #2862 (merged to main on Oct 7) to the release/0.7 branch. The change is minimal — one line in src/utils/shields.py adding a modr- prefix to sanitization moderation IDs, plus a unit test assertion.

Timeline

Agent workflow

No agent review ran. CodeRabbit skipped (disabled for non-default branches). The fullsend Review job was explicitly skipped. Only the retro agent ran post-merge. No dispatch repo (lightspeed-core/.fullsend) exists — all fullsend workflows run directly on the source repo via fullsend.yaml. The agents repo could not be discovered from run logs since no code/review/fix agent executed.

Observations (all covered by existing issues)

  1. No automated review on release branches — Covered by fullsend-ai/fullsend#3679 (review agent should detect cherry-picks) and fullsend-ai/fullsend#1718 (stricter scope checks on backport PRs). This PR is additional evidence that backport PRs to release branches receive zero automated review.

  2. PR title missing JIRA prefix — The title "Fix sanitization moderation IDs" lacks the required JIRA prefix. #3069 proposes strengthening the title checker. This PR is additional evidence that the checker may not enforce on release branches.

Conclusion

The workflow went well — a simple, correct backport reviewed and approved by two domain experts. No new proposals filed; all identified observations are covered by existing open issues.

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.

3 participants