Skip to content

Commit 2c72d63

Browse files
lesnik512claude
andauthored
docs(demos): drop redundant sustained scenario from single-client retry demo (#112)
Retry can't help the caller on a sustained outage, so its counters read plain ✗82 vs httpware ✗81 — "no difference" at a glance, against the suite's one-number-that-pops design, and its stop overclaimed a "fails fast" that never showed (budget-exhausted requests count as ✗, not fast-fail). Keep only the Brief blip scenario (clear ✗6 vs ✗0 win); the herd view below now owns the sustained/amplification story with numbers that pop (~18x vs ~3x). Preserve the "retry rescues blips, not outages" point as one line of the herd intro. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 48c0492 commit 2c72d63

2 files changed

Lines changed: 47 additions & 17 deletions

File tree

docs/demos/retry.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ a dead backend can't be amplified.
77

88
<div class="hw-demo" id="retry-demo"></div>
99

10-
<p>That was <b>one</b> client. The real danger of blind retries shows up at scale — when <b>many</b> clients retry the same outage at once.</p>
10+
<p>That was <b>one</b> client recovering from a blip. The real danger of blind retries shows up at <b>scale</b> — when many clients hit a real outage at once.</p>
1111

1212
<div class="hw-demo" id="retry-herd"></div>
1313

@@ -20,22 +20,8 @@ document.addEventListener('DOMContentLoaded', function () {
2020
? { ok: false, ms: 0.05, label: 'blip' } : { ok: true, ms: 0.05 },
2121
chainB: { retry: { maxAttempts: 3, baseDelay: 0.1, maxDelay: 5.0 },
2222
budget: { ttl: 10.0, minRetriesPerSec: 10.0, percentCanRetry: 0.2 } } },
23-
{ id: 'sustained', label: 'Sustained outage', dur: 12.5,
24-
fault: (now) => (now >= 2.0 && now < 9.0)
25-
? { ok: false, ms: 0.05, label: 'DOWN' } : { ok: true, ms: 0.05 },
26-
chainB: { retry: { maxAttempts: 3, baseDelay: 0.1, maxDelay: 5.0 },
27-
budget: { ttl: 10.0, minRetriesPerSec: 10.0, percentCanRetry: 0.2 } } },
2823
],
29-
buildStops: (scenario) => scenario.id === 'sustained' ? [
30-
{ when: (s) => s.now >= 1.2, spot: ['ifA', 'ifB'], title: 'A backend blip appears',
31-
body: 'Both clients hit the same transient errors. Watch how each responds.' },
32-
{ when: (s) => s.now >= 2.4, spot: ['ifB'], title: 'httpware retries the blip',
33-
body: 'The plain client surfaces the error immediately. httpware retries with backoff — most of these recover on attempt 2 or 3, invisibly to the caller.' },
34-
{ when: (s) => s.mw.budgetExhausted, spot: ['ifB'], title: 'The budget refuses to amplify',
35-
body: 'On a SUSTAINED outage, blind retries would multiply load. The budget is spent — httpware STOPS retrying and fails fast, protecting the dying backend instead of hammering it.' },
36-
{ when: (s) => s.now >= 10.0, spot: ['ifA', 'ifB'], title: 'Blip: recovered. Outage: contained',
37-
body: 'Retry rescues transient errors without turning a real outage into a storm. That cap is the whole reason the budget exists.' },
38-
] : [
24+
buildStops: () => [
3925
{ when: (s) => s.now >= 1.2, spot: ['badWrapA', 'badWrapB'], title: 'A backend blip appears',
4026
body: 'Both clients are about to hit the same transient errors. Keep your eye on the ✗ failed counts — they start equal at zero.' },
4127
{ when: (s) => s.now >= 2.4, spot: ['badWrapA', 'badWrapB'], title: 'Plain surfaces every error; httpware retries',
@@ -47,7 +33,7 @@ document.addEventListener('DOMContentLoaded', function () {
4733

4834
HttpwareDemo.mountHerd('#retry-herd', {
4935
clients: 20,
50-
intro: 'A real backend rarely dies cleanly — it <b>flaps</b>: fails, recovers, fails again. These strips show <b>backend call-rate over time</b> for twenty clients through three dips. Press play and watch the shape.',
36+
intro: 'Retry rescues a transient blip (above) — but it can’t fix an <i>outage</i>: retried or not, the caller sees the same failures. There the danger isn’t caller failures, it’s <b>amplification</b>. A real backend rarely dies cleanly — it <b>flaps</b>: fails, recovers, fails again. These strips show <b>backend call-rate over time</b> for twenty clients through three dips. Press play and watch the shape.',
5137
scenario: { id: 'storm', dur: 12.5,
5238
fault: (now) => {
5339
const down = (now >= 2.0 && now < 4.0) || (now >= 5.5 && now < 7.5) || (now >= 9.0 && now < 11.0);
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
summary: Dropped the redundant "Sustained outage" scenario from the single-client retry demo (retry can't help the caller on a sustained outage, so its counters read ~equal and misled) and moved the myth-bust into the herd intro, which now owns the outage story with numbers that pop.
3+
---
4+
5+
# Change: Drop the single-client retry demo's sustained-outage scenario
6+
7+
**Lane:** lightweight — docs demo only, one file (`docs/demos/retry.md`), no capability contract moves.
8+
9+
## Goal
10+
11+
The single-client retry demo's "Sustained outage" scenario shows plain ✗82 vs
12+
httpware ✗81 — near-identical, because retry genuinely cannot rescue a caller
13+
from a *sustained* outage (the backend is down the whole time). That is correct
14+
model behavior, but it makes the scenario read as "no difference", against the
15+
suite's design where every scenario spotlights a number that pops. Its stop copy
16+
also overclaimed ("httpware STOPS retrying and **fails fast**") while the
17+
fast-failed counter stays 0 — a budget-exhausted request still hits the backend
18+
once and is counted as ✗, not a fast-fail.
19+
20+
## Approach
21+
22+
Remove the sustained scenario from the single-client demo, leaving only the
23+
"Brief blip" scenario, where retry's caller-visible win is self-evident (plain
24+
✗6 vs httpware ✗0). The sustained/amplification story now lives — with numbers
25+
that pop (naive ~18× vs httpware ~3×) — in the herd view directly below, added
26+
in `2026-07-19.02`. Preserve the "retry rescues blips, not outages" myth-bust as
27+
one line of the herd intro rather than a whole flat scenario, and align the
28+
bridging prose (the single-client demo now shows a blip, not an outage).
29+
30+
`buildStops` loses its `scenario.id === 'sustained'` branch and becomes the
31+
single blip stop-list.
32+
33+
## Files
34+
35+
- `docs/demos/retry.md` — remove the `sustained` scenario + its stop branch;
36+
simplify `buildStops`; add the myth-bust to the herd `intro`; retune the
37+
bridging `<p>`.
38+
39+
## Verification
40+
41+
- [ ] `just docs-build --strict` clean; `just check-planning` OK.
42+
- [ ] jsdom harnesses green: `verify-demos.js` (retry single-client tour still
43+
completes with the one blip scenario), `verify-herd.js`, `verify-real-page.js`.
44+
- [ ] `node --check docs/demos/engine.js` (unchanged, sanity).

0 commit comments

Comments
 (0)