Skip to content

feat: add elapsed time and verdict count to live progress spinner - #30

Open
Karim-Ashraf1 wants to merge 1 commit into
sumamovva:mainfrom
Karim-Ashraf1:feat/live-progress-elapsed-time
Open

feat: add elapsed time and verdict count to live progress spinner#30
Karim-Ashraf1 wants to merge 1 commit into
sumamovva:mainfrom
Karim-Ashraf1:feat/live-progress-elapsed-time

Conversation

@Karim-Ashraf1

Copy link
Copy Markdown

Summary

Show live progress with elapsed time and verdict counts during probeagent attack, so users can see how far along a scan is instead of just a spinning indicator.

Changes

  • src/probeagent/core/engine.py: Moved on_progress callback to fire after each category completes (was before), and extended signature to pass accumulated results list for verdict counting
  • src/probeagent/cli.py: Added _format_elapsed() helper (formats seconds as M:SS), time.monotonic() timer at scan start, and verdict counting (Compromised/Resisted/Blocked) from results. Status line now shows: Attacking Credential Exfiltration (3/12) · 0:47 elapsed 2C 5R 0B
  • tests/test_cli.py: Added TestProgressCallback (verifies callback wiring and signature) and TestFormatElapsed (unit tests for M:SS formatting)

Test plan

  • pytest tests/ -q passes (497 passed, 2 skipped)
  • ruff check src/ tests/ clean (no new errors)
  • Manual verification: python -c "from probeagent.cli import _format_elapsed; print(_format_elapsed(125))" outputs 2:05

Related issues

Closes #16

Show real-time progress during `probeagent attack` with format:

  Attacking  Credential Exfiltration  (3/12) · 0:47 elapsed  2C 5R 0B

Changes:
- Move on_progress callback to fire after each category completes
- Add elapsed time counter (time.monotonic, formatted as M:SS)
- Add running verdict counts (Compromised/Resisted/Blocked)
- Keep progress on stderr so `-o json` output stays clean
- Add tests for callback wiring and format helper
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.

Show live progress + elapsed time during a scan

1 participant