agentleFS
CloudflareKnown publishercloudflare/workerd/src/tests/streams/strategies/AGENTS.md

workerd / strategies

AGENTS.md8.8k starsChanged 9 months agoApache-2.0View on GitHub

An informal specification of the two WHATWG queuing strategy classes as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/streams/readable.h) and the TypeScript implementation (src/per_isolate/webstreams/strategies.ts, behind typescript_implemented_streams) are covered. The WPT streams/queuing-strategies.any.js runs against both implementations; its 12 C++ expectedFailures in src/wpt/streams-test.ts correspond exactly to ledger entries #1–#6 below — the suite pins what the C++ side actually does where…

Trending

Quiet since August.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/workerd repository that our weekly crawl found: only 12 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about cloudflare/workerd

The biggest 5 of 12 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 12

Talked about on GitHub, Bluesky and Hacker News (12 times).

On GitHub · 6

1 more on GitHub

On Hacker News · 2

The file

Files
AGENTS.md

CountQueuingStrategy and ByteLengthQueuingStrategy

An informal specification of the two WHATWG queuing strategy classes as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/streams/readable.h) and the TypeScript implementation (src/per_isolate/webstreams/strategies.ts, behind typescript_implemented_streams) are covered.

The WPT streams/queuing-strategies.any.js runs against both implementations; its 12 C++ expectedFailures in src/wpt/streams-test.ts correspond exactly to ledger entries #1–#6 below — the suite pins what the C++ side actually does where WPT only records the failure.

Divergence ledger (C++ vs TypeScript)

#AreaC++TypeScriptPinned in
1size function identityminted fresh on every property accessone shared function per class, stablesizeFunctionIdentity
2size function shapename "", prototype present, constructablename "size", no prototype, not constructable (spec)sizeFunctionShape
3BLQS size .length01 (spec; CQS is 0 in both)sizeFunctionShape
4missing init dictionary messagejsg type-boundary TypeError ("not of type 'QueuingStrategyInit'.")"init must be an object"initDictionaryIsRequired
5init bag without highWaterMarkaccepted; highWaterMark is NaNTypeError "init.highWaterMark is required" (spec: required member)missingHighWaterMarkDiverges
6BLQS size byteLength acquisitioninternal slots for real BufferSources (shadowing getters ignored); undefined for null/undefined/non-objectsthe spec's property read: throws on nullish, honors shadowing gettersbyteLengthSizeNullishDiverges, byteLengthSizeShadowingGetterDiverges
7fractional highWaterMark in stream accountingtruncated to an integer by the stream (desiredSize 0 for HWM 0.5)fractional per specfractionalAndZeroHighWaterMarks

Parity worth noting: highWaterMark is an unrestricted double stored verbatim in both (NaN, ±Infinity, negatives, ToNumber coercions — highWaterMarkIsUnrestrictedDouble); plain objects with a byteLength property are counted by BOTH BLQS paths; detached buffers report 0; strategies drive Readable/Writable desiredSize accounting identically for integral HWMs; the class size functions work detached inside plain strategy bags.

Compatibility flags

The strategy classes consult no flags. The cpp cell pins streams_enable_constructors (the integration module builds standard streams), workers_api_getters_setters_on_prototype, and set_tostring_tag; generic unflagged placement/branding behaviors are guarded by the identity suite's legacy cell, so this suite carries no legacy cell. strategies-cpp-pedantic.wd-test runs the full module set with pedantic_wpt added, pinning the absence of pedantic effects.

Assertion catalogue

ModuleAsserts
api-surface.jsbranding; accessor placement + brand checks; no own instance props; hwm reflection incl. fractional; size identity (#1) and shape (#2, #3)
construction.jsinit required with per-impl message (#4); missing highWaterMark (#5); unrestricted-double storage + ToNumber coercion
size-semantics.jsCQS constant 1; BLQS on views/buffers/DataViews with offsets, detached (0), length-tracking resizable views; plain-object byteLength reads; nullish handling (#6); shadowing getter (#6)
integration.jsstrategies drive RS/WS desiredSize; detached class size fn in a plain bag; fractional HWM stream truncation (#7); zero HWM
reentrancy.jsplain-chunk byteLength getter runs inside the class size fn: throws propagate, re-entrant size calls work; size fns are receiver-agnostic; init-bag highWaterMark getter re-entering the constructor is safe (all parity). In-stream user-size-callback reentrancy is readable/writable-suite territory
which-impl.jsimplementation detection

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.