Skip to content

feat: stream Guard scan progress over WebSocket#907

Open
Pcmhacker-piro wants to merge 1 commit into
SdSarthak:mainfrom
Pcmhacker-piro:fix/guard-stream-progress
Open

feat: stream Guard scan progress over WebSocket#907
Pcmhacker-piro wants to merge 1 commit into
SdSarthak:mainfrom
Pcmhacker-piro:fix/guard-stream-progress

Conversation

@Pcmhacker-piro
Copy link
Copy Markdown

@Pcmhacker-piro Pcmhacker-piro commented Jun 1, 2026

Summary

Closes #87

Adds a WS /api/v1/guard/stream endpoint that emits regex, classifier, decision, and final scan events as the Guard pipeline progresses. Updates the Guard Scanner UI to consume the
WebSocket stream, show live layer output during scans, and keep the existing final result/export behavior.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Tests
  • Infra / CI

Checklist

  • I have read CONTRIBUTING.md
  • My code follows the project style
  • I have added/updated tests where relevant
  • Tests/lint pass locally (if available)
  • I have not committed .env or any secrets
  • I have updated documentation if needed

Screenshots (if UI change)

CHANGED FILES

  • backend/app/api/v1/guard.py
  • backend/app/modules/guard/llm_guard.py
  • backend/tests/test_guard_api.py
  • frontend/src/pages/GuardConsole.tsx
  • frontend/src/services/api.ts
  • frontend/vite.config.ts

COMMITS

  • 801ecdb feat: stream guard scan progress

TESTING PERFORMED

  • npm ci
  • npm run lint passed
  • pytest tests/test_guard_api.py::test_guard_stream_sends_pipeline_events passed
  • python3 -m py_compile app/api/v1/guard.py app/modules/guard/llm_guard.py tests/test_guard_api.py passed
  • git diff --check passed
  • npm run build attempted; blocked by existing unrelated src/pages/RagChat.tsx type error.
  • pytest tests/test_guard_api.py attempted; existing tests fail locally because transformers no longer exports AdamW.

FINAL STATUS

  • Branch Name: fix/guard-stream-progress
  • Commit Hash: 801ecdb
  • PR Created: Yes
  • Ready for Review: Yes

@Pcmhacker-piro
Copy link
Copy Markdown
Author

@SdSarthak

Hi, the checks have passed. Could you please review and approve the pending workflows when you have a chance? Thank you!

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.

Add WebSocket endpoint for real-time Guard scan progress streaming

1 participant