pepe-http 0.55.1 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,233 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
+ ## [0.56.0](https://github.com/omarmhaimdat/pepe/compare/v0.55.2...v0.56.0) - 2026-10-26
10
+
11
+ ### Added
12
+
13
+ - *(serve)* pepe over HTTP, with workers and schedules ([#236](https://github.com/omarmhaimdat/pepe/pull/236))
14
+
15
+ Stacked on #235, which brings the guardrails and the numbers onto
16
+ `master`. Retarget this to `master` once that merges, rather than
17
+ merging it into `fix/guardrails`.
18
+
19
+ This is the API from all three phases of the design
20
+ (`docs/design/serve.md`). The web UI isn't in it. The docs are
21
+ `docs/serve.md`, also built into the docs site.
22
+
23
+ ## What
24
+
25
+ - **`pepe serve`.** Every run is a child `pepe`, under the server's
26
+ guardrails, the project's `pepe.toml` and the machine's settings. pepe's
27
+ own `--dry-run` checks each request first, so the guardrails decide
28
+ exactly as they do on the command line.
29
+ - **Same arguments as MCP.** A request takes the MCP tools' arguments,
30
+ so a value is never read as a flag.
31
+ - **Not taken over the API:** `webhook`, `slack`, `otlp`, `svg`, and
32
+ files outside the project.
33
+ - **Locked down by default:**
34
+ - It listens on loopback only.
35
+ - A token is required, either made and printed, or read with its names
36
+ from `--token-file`.
37
+ - Off loopback, it refuses to start without `--allow-host` and all three
38
+ caps.
39
+ - `--max-runs` (default 1) and an audit log in
40
+ `.pepe/serve/audit.jsonl`.
41
+ - **Runs:**
42
+ - Start one, or `dry_run` for the plan.
43
+ - List runs, and read one's state and report.
44
+ - Watch it live as Server-Sent Events, resumable from `Last-Event-ID`.
45
+ - Get its report as `json`, `html`, `md`, `txt` or `csv`.
46
+ - Pause, resume, stop, and change concurrency. A ping can be stopped and
47
+ still gives its report.
48
+ - **Tests:** list, read, save (as JSON keys or TOML), delete, their
49
+ recorded runs (shared with `pepe history`), `compare` with an optional
50
+ gate, and the report schemas.
51
+ - **Schedules:** a saved test every so often, at most once a minute. A
52
+ schedule that comes due while the server is full is skipped and says so.
53
+ - **Workers:**
54
+ - **Joining:** `pepe worker --join URL --name eu-1` dials out over a
55
+ WebSocket, so it works from behind NAT. `src/ws.rs` gains the server
56
+ side.
57
+ - **Splitting:** `"workers": "all"` or a list of names shares the count,
58
+ concurrency and rate among them.
59
+ - **Guardrails:** each worker runs its share under its own guardrails.
60
+ - **Merging:** each share returns its report with the latency histogram
61
+ whole (hidden `--histogram`), and the server adds them bucket by bucket,
62
+ so the merged p99 is exact.
63
+ - **`--events FILE`:** any run as JSON lines (start, progress each
64
+ second, anomalies, steering, the report last). It hooks into the
65
+ existing webhook calls, so every mode has it, with a ping progress line
66
+ of its own.
67
+
68
+ ## Checked end to end
69
+
70
+ Against the benchmark server, with a server in a scratch project, two
71
+ workers and a `pepe.toml` allowing only 127.0.0.1:
72
+
73
+ | | |
74
+ | --- | --- |
75
+ | No token, wrong token | 401 |
76
+ | `localhost` under `allow-host = ["127.0.0.1"]` | 422, "localhost isn't
77
+ an allowed host" |
78
+ | `webhook` in a request; `"file": "/etc/passwd"` | 400 each |
79
+ | `--listen 0.0.0.0` with no `max-rate` | refuses to start, naming
80
+ `--max-rate` |
81
+ | A 3 s run at 200/s | 600 requests; events: start, progress ×4, report,
82
+ end; `Last-Event-ID: 3` resumes at 4 |
83
+ | Pause, resume, concurrency 2, stop | each a `steered` event; the
84
+ report says interrupted |
85
+ | A third run under `--max-runs 2` | 429 |
86
+ | A ping, then pause; then stop | 409 "can be stopped, not steered";
87
+ then stopped with its report |
88
+ | A test saved as JSON, run twice, compared | both recorded under
89
+ `.pepe/runs/`, compare says `same` |
90
+ | 40,000 requests at 8 on `"workers": "all"` | 20,000 each; merged 158k
91
+ req/s, `exact_percentiles: true` |
92
+ | `-c 8` on a worker started with `--max-concurrency 4` | its share
93
+ refused by its own guardrail |
94
+ | A worker killed mid-run | the run ends on the other share, failing,
95
+ naming the one that left |
96
+ | A schedule every 60 s | it ran as `schedule:s1` |
97
+
98
+ 455 tests pass and clippy is clean. New tests cover tokens, the
99
+ off-loopback rule, events, merging (two shares whose p99 only the merged
100
+ histogram gets right, checked against the run schema), schedules, the
101
+ handshake key (the RFC's example), splitting, and the join URL.
102
+
103
+ ## Costs and limits
104
+
105
+ - **Binary size:** 8.38 → 9.05 MB (+8%), for hyper's server, its body
106
+ types and this code.
107
+ - **Distributed runs** are plain runs only, for now (a URL, or a saved
108
+ test of one); the other modes run on the server.
109
+ - **Orphaned shares:** a worker's process killed outright leaves its
110
+ share's child running to the end of its count or time. Every run is
111
+ bounded, so it can't run forever.
112
+
113
+
114
+
115
+ ### Fixed
116
+
117
+ - the guardrails and the numbers, onto master ([#235](https://github.com/omarmhaimdat/pepe/pull/235))
118
+
119
+ #233 (guardrails) and #234 (numbers) were merged into their stacked
120
+ bases (`perf/generator` and `fix/guardrails`), not into `master`, so
121
+ neither is in `master` or a release yet. This brings both onto `master`,
122
+ with master merged in. Both were already reviewed in their own PRs.
123
+
124
+ It also carries one fix to #233:
125
+
126
+ - **The MCP `run` tool sent nothing.** #233 put a `--` before a tool
127
+ call's URL, so a value starting with a dash couldn't be read as a flag.
128
+ But after a `--`, a plain run reads a curl command (`--curl -- curl …`),
129
+ so the URL went there and the run had nothing to send.
130
+ - **The fix:** what isn't a flag goes as it is now, and one that starts
131
+ with a dash is refused. A new test parses each tool's command the way
132
+ pepe will.
133
+ - **Checked through `pepe mcp`:** the `run` tool sends its 50 requests,
134
+ and a target of `--allow-host=127.0.0.1` is refused.
135
+
136
+ 442 tests pass, clippy is clean.
137
+
138
+
139
+ ## [0.55.2](https://github.com/omarmhaimdat/pepe/compare/v0.55.1...v0.55.2) - 2026-10-24
140
+
141
+ ### Performance
142
+
143
+ - *(load)* flows on the direct path, and a run sends what it was asked to ([#230](https://github.com/omarmhaimdat/pepe/pull/230))
144
+
145
+ ## What
146
+
147
+ **Flows go direct.** A step is written to the wire when it is sent
148
+ (`direct::Route::of`), with its values filled in, over the worker's
149
+ connection to the step's origin. The worker keeps that connection from
150
+ step to step and from chain to chain. Proxies, credentials in the URL
151
+ and the rest of a redirect still go through reqwest.
152
+
153
+ Two steps, 100,000 chains at 64, best of three on the M4 Pro:
154
+
155
+ | | wall | CPU ms / 1k | peak RSS |
156
+ | --- | ---: | ---: | ---: |
157
+ | v0.55.0 | 3.38 s | 14.7 | 14.6 MB |
158
+ | this branch | 1.60 s | 7.1 | 6.2 MB |
159
+ | plain run, same 200k requests | 1.28 s | 5.6 | 6.5 MB |
160
+
161
+ **The engine sends what a run asks for.** Each fix below was reproduced
162
+ against a counting server, before and after:
163
+
164
+ | | v0.55.0 | this branch |
165
+ | --- | --- | --- |
166
+ | `-n 20 -c 4 -m POST` answered with a 307 | 24 POSTs to the start | 20
167
+ |
168
+ | `-n 4 -c 4 --rate 1` | ends after 7.0 s, reports 0.57 req/s | 3.0 s |
169
+ | `-z 3s -c 16 --rate 1` | ends after 18 s | 3.0 s |
170
+ | replay of a 5,000-URL log, `/hot` at 99.5% | `/hot` got 44.9% | 99.5%
171
+ |
172
+ | flow `-n 1 --warmup 1s` | 13,860 requests counted as measured | 2 |
173
+
174
+ - **Redirects:** `Sent::Redirected` carries the status and the
175
+ `Location`. reqwest takes it on from there with the method and body
176
+ reqwest's own policy would use: 301, 302 and 303 become a GET, 307 and
177
+ 308 keep the method and body. reqwest is no longer handed the original
178
+ request to send again. The hop goes through a client without the run's
179
+ headers, with those headers added per request, so `Authorization`,
180
+ `Cookie` and the like stay behind when the redirect leaves the origin.
181
+ - **Pacing:**
182
+ - A worker claims its request before it takes a schedule slot.
183
+ - A wait on a slot ends on a stop, or when a timed run reaches its
184
+ deadline. A counted run still sends every request it has claimed.
185
+ - The backlog reset no longer loses its compare-exchange to other
186
+ workers.
187
+ - **Schedule:** weights adding up to 4,096 or less are still an exact
188
+ cycle. Larger totals are spread over a golden-ratio sequence rather than
189
+ rounding every rare target up to a slot.
190
+ - **Flow warm-up:** every step of a chain begun in the warm-up is marked
191
+ as warm-up.
192
+ - **Drain:** at most 65,536 results are taken per drain, so a stop or a
193
+ frame never waits behind a backlog.
194
+ - **`bench/tui.py`:** finds the end of a run again on the v0.52 screens
195
+ (the title says HEALTHY now) and counts frames by bursts.
196
+
197
+ `bench/compare.sh` against v0.55.0, five rounds: every workload within
198
+ ±5% CPU, the stated noise. The signs flip between runs.
199
+
200
+ ## Tests
201
+
202
+ 429 pass, clippy is clean. New tests:
203
+
204
+ - a redirect is not sent twice
205
+ - a POST answered with a 307 or a 303 goes on as the status says, sent
206
+ once
207
+ - a flow keeps one connection per worker across steps and chains
208
+ - a paced run ends with its last request, and a timed one at its
209
+ deadline
210
+ - rare targets don't take the busy one's share
211
+
212
+ ## Not in this PR
213
+
214
+ Reviewing the engine turned up more, all reproduced on v0.55.0. They are
215
+ left for their own PRs:
216
+
217
+ - **Guardrails:**
218
+ - `--rate=1e-300` gets past every cap: 32,826 requests under
219
+ `--max-requests 20`.
220
+ - `--warmup` and flow steps aren't counted against `--max-requests`.
221
+ - Redirects aren't checked against `--allow-host`.
222
+ - `--load`, `rerun` and the Slack runner don't read `pepe.toml`.
223
+ - MCP tool arguments can add `--allow-host`.
224
+ - `pepe api` paths can change the host.
225
+ - A proxy's host isn't checked.
226
+ - Live concurrency changes go past `--max-concurrency`.
227
+ - **Numbers:**
228
+ - `pepe compare` calls a 2.4× p99 regression "same".
229
+ - `--rate` latency leaves out the time requests waited for a slot, and
230
+ the verdict says healthy.
231
+ - `pepe ramp` reports capacity `null` on a hard plateau.
232
+ - Ping's `--jsonl` and `--csv` drop and repeat samples.
233
+ - p99.9 is off by one rank.
234
+
235
+
9
236
  ## [0.55.1](https://github.com/omarmhaimdat/pepe/compare/v0.55.0...v0.55.1) - 2026-10-24
10
237
 
11
238
  ### Fixed