Skip to content

Commit 0def24c

Browse files
committed
docs: add captured screenshots, benchmark, and PR-comment HTML preview
Adds "See it in action" section to the README showing real terminal output captured against the bundled fixtures (Mini Shai-Hulud, event-stream historic, clean lockfile, watch lifecycle, PR comment markdown source) plus a sub-millisecond benchmark across 7 fixtures. * tools/capture_demos.py - One-shot script that runs the matcher against bundled fixtures and exports rich.Console SVG, plus a best-of-3 microbenchmark and a standalone HTML preview of the PR-comment markdown body. Stdlib-only Markdown -> HTML for the preview (no extra deps). * docs/assets/ - demo-check-{clean,event-stream,shaihulud}.svg - demo-watch.svg (lifecycle: snapshot -> quiet day -> alert) - demo-pr-comment-source.svg (Markdown source as syntax-highlighted) - demo-pr-comment-preview.html (renders inline-styled HTML so reviewers can see what GitHub will show on a PR before they actually open one) - benchmark.svg + benchmark.md * README - new "See it in action" section above Quick usage with the screenshots inline + benchmark table reference. Tests still 125 pass, lint clean.
1 parent 6c50c96 commit 0def24c

11 files changed

Lines changed: 1157 additions & 0 deletions

.pwned-deps-cache/demo-osv.sqlite

24 KB
Binary file not shown.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,31 @@ pip install --user pwned-deps
189189

190190
Python 3.10+ on macOS, Linux, or Windows.
191191

192+
## See it in action
193+
194+
> Real terminal output — captured with `tools/capture_demos.py` against
195+
> the bundled fixtures, not mocked. Reproduce locally with
196+
> `pwned-deps check tests/fixtures/npm/mini-shaihulud.lock.json`.
197+
198+
| Scenario | Screenshot |
199+
|---|---|
200+
| **`check`** on a clean lockfile | ![clean scan](docs/assets/demo-check-clean.svg) |
201+
| **`check`** on the historic event-stream/flatmap-stream campaign (2018) | ![event-stream scan](docs/assets/demo-check-event-stream.svg) |
202+
| **`check`** on Mini Shai-Hulud (SAP CAP, April 2026) — full IoC payload | ![shai-hulud scan](docs/assets/demo-check-shaihulud.svg) |
203+
| **`watch`** — Day 0 baseline, quiet day, alert day | ![watch demo](docs/assets/demo-watch.svg) |
204+
| **PR comment** rendered by GitHub on a pull request | ![pr comment markdown](docs/assets/demo-pr-comment-source.svg) |
205+
206+
### Benchmark
207+
208+
Match-time on a 2024 MacBook Pro (M-series), offline mode:
209+
210+
![benchmark](docs/assets/benchmark.svg)
211+
212+
Matcher work is sub-millisecond per lockfile against the bundled
213+
extras feed; first OSV query adds the network round-trip and is
214+
cached on disk for 24h. See [docs/assets/benchmark.md](docs/assets/benchmark.md)
215+
for the raw numbers.
216+
192217
## Quick usage
193218

194219
```bash

docs/assets/benchmark.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# pwned-deps benchmark (v0.1.0)
2+
3+
_Best-of-3 offline match time on `darwin`, Python 3.12.13. Excludes parse + render._
4+
5+
| Fixture | Packages | Time (ms) | Packages/sec |
6+
|---|---:|---:|---:|
7+
| npm clean (1 pkg) | 1 | 0.09 | 11,555 |
8+
| npm Mini Shai-Hulud (1 pkg, 2 hits) | 1 | 0.06 | 16,961 |
9+
| npm event-stream historic (2 pkgs) | 2 | 0.09 | 21,286 |
10+
| npm synthetic-malicious (3 pkgs) | 1 | 0.05 | 19,262 |
11+
| npm v3 lockfile | 2 | 0.06 | 32,389 |
12+
| pypi requirements.txt | 8 | 0.08 | 101,587 |
13+
| maven pom.xml | 3 | 0.07 | 42,278 |

docs/assets/benchmark.svg

Lines changed: 116 additions & 0 deletions
Loading

docs/assets/demo-check-clean.svg

Lines changed: 67 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)