Skip to content

Commit 4753ddd

Browse files
jangrau13claude
andcommitted
The same hole, in the two places it was left: retry unsafe and chaos for
Auditing the rest of `toYaml` for fields shaped like `kTime` — written conditionally, omitted at exactly the value the loader defaults to — turned up `unsafe`, and it is the worst one of the set. `unsafe: true` is what lets a retry stand on a method the `.proto` never declared idempotent. The loader does not care: it reads the flag and moves on. `Retry.check` is what refuses, and that runs when the scenario runs. So a writer that stopped emitting the flag would post a file the lab accepts, read back a draft that round-trips byte-identically, pass every check in this file, and fail only for whoever pressed play — with a message about idempotency for a line they never edited. Confirmed by mutation before fixing it: dropping `unsafe` left the whole suite green. It now reads "retry 1 unsafe: form said true, lab read false". Chaos was compared by length alone for the same reason and is now compared field by field. Its `for:` was in fact caught by the text comparison, because the loader's default of 1000 differs from what the drafts here use — that is luck rather than coverage, and it is not something to leave resting on a fixture's choice of numbers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 0a54d0f commit 4753ddd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎viewer/checks/author.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,28 @@ try {
312312
if (f.kind === 'degrade') same(`fault ${j} factor`, f.factor, g.factor);
313313
});
314314
same('chaos', draft.chaos.length, got.chaos.length);
315+
draft.chaos.forEach((c, j) => {
316+
const g = got.chaos[j];
317+
if (!g) return;
318+
same(`chaos ${j} kind`, c.kind, g.kind);
319+
same(`chaos ${j} every`, c.everyRefMs, g.everyRefMs);
320+
same(`chaos ${j} among`, c.among, g.among);
321+
if (c.kind !== 'kill') same(`chaos ${j} for`, c.forRefMs, g.forRefMs);
322+
if (c.kind === 'degrade') same(`chaos ${j} factor`, c.factor, g.factor);
323+
});
315324
same('retries', draft.retries.length, got.retries.length);
325+
draft.retries.forEach((r, j) => {
326+
const g = got.retries[j];
327+
if (!g) return;
328+
same(`retry ${j} method`, r.method, g.method);
329+
same(`retry ${j} attempts`, r.attempts, g.attempts);
330+
same(`retry ${j} backoff`, r.backoffRefMs, g.backoffRefMs);
331+
// The one with real teeth. `unsafe: true` is what lets a retry stand on a
332+
// method the .proto never declared idempotent; the loader is happy without
333+
// it and `Retry.check` refuses at *run* time, so losing it here would pass
334+
// every load-time check in this file and break only when someone ran it.
335+
same(`retry ${j} unsafe`, r.unsafe, g.unsafe);
336+
});
316337
if (off.length) {
317338
say(`${what}: the lab did not read back what the form wrote`);
318339
for (const o of off) console.log(` ${o}`);

0 commit comments

Comments
 (0)