task_id
stringlengths
17
33
repo
stringclasses
2 values
lang
stringclasses
2 values
category
stringclasses
1 value
difficulty
int64
3
5
instruction
stringlengths
286
2.04k
files
stringlengths
20.1k
37.2k
tests
stringlengths
1.25k
14.4k
gold
stringclasses
2 values
fail_to_pass
listlengths
3
24
pass_to_pass
listlengths
0
33
n_tests
int64
6
48
router-api-review-findings
router
typescript
logic
5
Three findings from this week's API review. They are independent; all three need fixing. 1. /items/0 does not address item zero. The path parameter comes through as the boolean false rather than the number 0. Only the exact strings "true" and "false" are meant to be booleans. 2. Route patterns that place a wild...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/coerce.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { coerce, coerceAll } from '../src/index.ts';\n\ntest('zero is the number zero', () => {\n assert.strictEqual(coerce('id', '0'), 0);\n});\n\ntest('only the exact string false is boolean false', () => {\n assert.st...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a leading slash is kept", "a missing leading slash is added", "a wildcard before other segments is refused", "a wildcard in the middle of a long pattern is refused", "coerceAll maps every entry", "empty string stays a string", "joinPath produces an absolute path", "trailing and repeated slashes are r...
[ "a bare trailing wildcard is accepted", "a trailing wildcard is accepted", "both spellings normalise identically", "empty parameter names are still refused", "non-numeric text stays text", "numbers stay numbers", "only the exact string false is boolean false", "ordinary patterns still parse", "the r...
20
router-duplicate-route-undetected
router
typescript
logic
3
Registering the same route twice is silently accepted. Two teams added a handler for the same path in different spellings -- one with a trailing slash -- and both registrations succeeded. Requests then go to whichever happened to win, which is not something we can reason about. A duplicate registration is meant to be ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/duplicate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Router, DuplicateRoute } from '../src/index.ts';\n\nconst H = async () => ({ status: 200, body: '' });\n\ntest('the same pattern twice is rejected', () => {\n const r = new Router();\n r.add('GET', '/a', H);\...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a missing leading slash is the same route", "a trailing slash is the same route", "repeated slashes are the same route" ]
[ "different parameter names are still distinct patterns", "different paths are fine", "the same path under a different method is fine", "the same pattern twice is rejected" ]
7
router-header-case-sensitive
router
typescript
logic
3
Header lookups miss depending on which client sent the request. Clients that send `content-type` are handled; clients that send `Content-Type` are treated as though the header were absent, and our content negotiation then falls back to a default. Both spellings mean the same thing over HTTP.
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('lookup ignores case', () => {\n const h = new Headers({ 'Content-Type': 'text/html' });\n assert.strictEqual(h.get('content-type'), 'text/html');\n assert.strictEqual...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "all() returns a copy", "append across cases accumulates on one field", "delete ignores case", "has ignores case", "lookup ignores case", "names are normalised", "setting twice in different cases replaces", "values keep their own case" ]
[]
8
router-headers-all-aliases
router
typescript
logic
4
Reading a header can change it. Our logging layer collects a request's Set-Cookie values and appends a redaction marker to the list it got back. Downstream, the request carries that marker as a real cookie value. Reading a header should not hand out a reference the caller can mutate.
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers-alias.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('mutating the result does not change the header', () => {\n const h = new Headers({ 'Set-Cookie': 'a=1' });\n h.all('set-cookie').push('REDACTED');\n assert.deep...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "get is unaffected by a mutated all()", "mutating the result does not change the header", "mutation does not leak across reads" ]
[ "absent header returns an empty list", "append still accumulates", "multiple values are still returned" ]
6
router-lru-recency-on-read
router
typescript
logic
4
Our hottest routes keep falling out of the route cache. The cache holds 128 entries and we serve far more distinct paths than that, but a handful of endpoints take almost all the traffic. Those popular endpoints miss constantly, while paths hit once at start-up survive for ages. Cache hit rate sits far below what the ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a repeatedly read key survives many insertions", "reading an entry protects it from eviction", "the least recently used key is evicted" ]
[ "capacity is enforced", "hit and miss counters still work", "overwriting a key keeps one entry", "reading does not change the size", "values are still returned correctly" ]
8
router-match-order-reversed
router
typescript
logic
4
The router picks the least specific route that matches. A request for /users/me is handled by /users/:id even though /users/me is registered, and /assets/logo.svg is picked up by the catch-all /assets/*path rather than by /assets/logo.svg. It looks like the ordering of candidate routes is upside down: the vaguest matc...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/match-order.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { RouteTable } from '../src/index.ts';\n\nfunction table(patterns: string[]) {\n const t = new RouteTable<string>();\n for (const p of patterns) t.add(p, p);\n return t;\n}\n\ntest('static wins over param', ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "matchAll is ordered most specific first", "param wins over wildcard", "params still extracted from the winner", "static wins over param", "static wins over wildcard" ]
[ "a single matching route still matches", "non-matching routes are absent" ]
7
router-middleware-reentrancy
router
typescript
logic
5
A bug in one of our middlewares corrupted a whole batch of requests before we noticed, and the router gave us no signal at all. The middleware in question awaited next(), then on a certain branch called next() a second time. Everything below it in the stack ran twice against the same request -- including a layer that ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/middleware.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { compose } from '../src/index.ts';\nimport type { Middleware } from '../src/index.ts';\n\nconst REQ = {} as any;\nconst OK = async () => ({ status: 200, body: 'ok' });\n\ntest('calling next twice is rejected', ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "calling next twice is rejected", "downstream runs only once per request", "final handler runs only once" ]
[ "a layer may short-circuit without calling next", "empty stack calls the final handler", "errors propagate", "ordinary stacks still work end to end" ]
7
router-negotiate-tiebreak
router
typescript
logic
5
Content negotiation ignores what the client asked for first. A client sending `Accept: text/html, application/json` -- no explicit qualities, so both are equally acceptable -- gets JSON back. Per the spec, when two acceptable types carry the same quality, the client's own ordering is the tie-break, so that request sho...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/negotiate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { selectType, parseAccept } from '../src/index.ts';\n\nconst OFFER = ['text/html', 'application/json'];\n\ntest('equal quality is broken by client order', () => {\n assert.strictEqual(selectType('text/html, appl...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "client order beats alphabetical order", "equal quality is broken by client order", "three-way tie takes the first listed" ]
[ "explicit equal q values also use client order", "higher quality still wins over order", "nothing acceptable yields undefined", "parseAccept still records order and quality", "wildcards still match", "zero quality is never selected" ]
9
router-negotiation-and-headers
router
typescript
logic
4
Two content-negotiation problems, likely separate causes. 1. Clients sending `Accept: text/html, application/json` with no explicit qualities get JSON. When two acceptable types carry equal quality, the client's own ordering is the tie-break. 2. Clients that spell the header `Content-Type` rather than `content-...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('lookup ignores case', () => {\n const h = new Headers({ 'Content-Type': 'text/html' });\n assert.strictEqual(h.get('content-type'), 'text/html');\n assert.strictEqual...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "all() returns a copy", "append across cases accumulates on one field", "client order beats alphabetical order", "delete ignores case", "equal quality is broken by client order", "has ignores case", "lookup ignores case", "names are normalised", "setting twice in different cases replaces", "three-...
[ "explicit equal q values also use client order", "higher quality still wins over order", "nothing acceptable yields undefined", "parseAccept still records order and quality", "wildcards still match", "zero quality is never selected" ]
17
router-query-repeats-lost
router
typescript
logic
4
Multi-select filters only ever apply the last value. Our UI sends `?tag=red&tag=blue&tag=green` when several tags are selected, and the API behaves as though only green were chosen. Single-value parameters are fine. Repeated keys should collect every value, in the order they were sent.
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/query.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { parseQuery, first } from '../src/index.ts';\n\ntest('repeated keys collect every value', () => {\n assert.deepStrictEqual(parseQuery('?tag=red&tag=blue&tag=green').tag,\n ['red', 'blue', 'g...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "duplicate identical values are all kept", "first() returns the leading value", "order is preserved", "repeated keys collect every value", "repeats mixed with singles" ]
[ "empty query is an empty object", "percent and plus decoding still work", "single values still work", "valueless keys are present and empty" ]
9
router-review2-01
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Registering the same route twice is silently accepted. Two teams added a handler for the same path in different spellings -- one with a trailing slash -- and both registrations succeeded. Reque...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a missing leading slash is the same route", "a repeatedly read key survives many insertions", "a trailing slash is the same route", "all() returns a copy", "append across cases accumulates on one field", "delete ignores case", "has ignores case", "lookup ignores case", "names are normalised", "re...
[ "capacity is enforced", "different parameter names are still distinct patterns", "different paths are fine", "hit and miss counters still work", "overwriting a key keeps one entry", "reading does not change the size", "the same path under a different method is fine", "the same pattern twice is rejecte...
23
router-review2-02
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Registering the same route twice is silently accepted. Two teams added a handler for the same path in different spellings -- one with a trailing slash -- and both registrations succeeded. Reque...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/duplicate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Router, DuplicateRoute } from '../src/index.ts';\n\nconst H = async () => ({ status: 200, body: '' });\n\ntest('the same pattern twice is rejected', () => {\n const r = new Router();\n r.add('GET', '/a', H);\...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a missing leading slash is the same route", "a trailing slash is the same route", "all() returns a copy", "get is unaffected by a mutated all()", "matchAll is ordered most specific first", "mutating the result does not change the header", "mutation does not leak across reads", "param wins over wildca...
[ "a single matching route still matches", "absent header returns an empty list", "append across cases accumulates on one field", "append still accumulates", "delete ignores case", "different parameter names are still distinct patterns", "different paths are fine", "has ignores case", "lookup ignores ...
28
router-review2-03
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Registering the same route twice is silently accepted. Two teams added a handler for the same path in different spellings -- one with a trailing slash -- and both registrations succeeded. Reque...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a missing leading slash is the same route", "a repeatedly read key survives many insertions", "a trailing slash is the same route", "matchAll is ordered most specific first", "param wins over wildcard", "params still extracted from the winner", "reading an entry protects it from eviction", "repeated ...
[ "a single matching route still matches", "capacity is enforced", "different parameter names are still distinct patterns", "different paths are fine", "hit and miss counters still work", "non-matching routes are absent", "overwriting a key keeps one entry", "reading does not change the size", "the sa...
22
router-review2-04
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Header lookups miss depending on which client sent the request. Clients that send `content-type` are handled; clients that send `Content-Type` are treated as though the header were absent, and ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a repeatedly read key survives many insertions", "all() returns a copy", "append across cases accumulates on one field", "calling next twice is rejected", "client order beats alphabetical order", "delete ignores case", "downstream runs only once per request", "equal quality is broken by client order"...
[ "a layer may short-circuit without calling next", "capacity is enforced", "empty stack calls the final handler", "errors propagate", "explicit equal q values also use client order", "higher quality still wins over order", "hit and miss counters still work", "nothing acceptable yields undefined", "or...
32
router-review2-05
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Header lookups miss depending on which client sent the request. Clients that send `content-type` are handled; clients that send `Content-Type` are treated as though the header were absent, and ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('lookup ignores case', () => {\n const h = new Headers({ 'Content-Type': 'text/html' });\n assert.strictEqual(h.get('content-type'), 'text/html');\n assert.strictEqual...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "all() returns a copy", "append across cases accumulates on one field", "calling next twice is rejected", "delete ignores case", "downstream runs only once per request", "duplicate identical values are all kept", "final handler runs only once", "first() returns the leading value", "has ignores case"...
[ "a layer may short-circuit without calling next", "a single matching route still matches", "empty query is an empty object", "empty stack calls the final handler", "errors propagate", "non-matching routes are absent", "ordinary stacks still work end to end", "percent and plus decoding still work", "...
31
router-review2-06
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Reading a header can change it. Our logging layer collects a request's Set-Cookie values and appends a redaction marker to the list it got back. Downstream, the request carries that marker as a...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a repeatedly read key survives many insertions", "client order beats alphabetical order", "duplicate identical values are all kept", "equal quality is broken by client order", "first() returns the leading value", "get is unaffected by a mutated all()", "mutating the result does not change the header", ...
[ "absent header returns an empty list", "append still accumulates", "capacity is enforced", "empty query is an empty object", "explicit equal q values also use client order", "higher quality still wins over order", "hit and miss counters still work", "multiple values are still returned", "nothing acc...
32
router-review2-07
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Reading a header can change it. Our logging layer collects a request's Set-Cookie values and appends a redaction marker to the list it got back. Downstream, the request carries that marker as a...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers-alias.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('mutating the result does not change the header', () => {\n const h = new Headers({ 'Set-Cookie': 'a=1' });\n h.all('set-cookie').push('REDACTED');\n assert.deep...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "get is unaffected by a mutated all()", "matchAll is ordered most specific first", "mutating the result does not change the header", "mutation does not leak across reads", "param wins over wildcard", "params still extracted from the winner", "static wins over param", "static wins over wildcard" ]
[ "a single matching route still matches", "absent header returns an empty list", "append still accumulates", "multiple values are still returned", "non-matching routes are absent" ]
13
router-review2-08
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. The router picks the least specific route that matches. A request for /users/me is handled by /users/:id even though /users/me is registered, and /assets/logo.svg is picked up by the catch-all ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/match-order.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { RouteTable } from '../src/index.ts';\n\nfunction table(patterns: string[]) {\n const t = new RouteTable<string>();\n for (const p of patterns) t.add(p, p);\n return t;\n}\n\ntest('static wins over param', ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "calling next twice is rejected", "downstream runs only once per request", "final handler runs only once", "matchAll is ordered most specific first", "param wins over wildcard", "params still extracted from the winner", "static wins over param", "static wins over wildcard" ]
[ "a layer may short-circuit without calling next", "a single matching route still matches", "empty stack calls the final handler", "errors propagate", "non-matching routes are absent", "ordinary stacks still work end to end" ]
14
router-review2-09
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. A bug in one of our middlewares corrupted a whole batch of requests before we noticed, and the router gave us no signal at all. The middleware in question awaited next(), then on a certain bran...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/middleware.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { compose } from '../src/index.ts';\nimport type { Middleware } from '../src/index.ts';\n\nconst REQ = {} as any;\nconst OK = async () => ({ status: 200, body: 'ok' });\n\ntest('calling next twice is rejected', ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "calling next twice is rejected", "client order beats alphabetical order", "downstream runs only once per request", "equal quality is broken by client order", "final handler runs only once", "three-way tie takes the first listed" ]
[ "a layer may short-circuit without calling next", "empty stack calls the final handler", "errors propagate", "explicit equal q values also use client order", "higher quality still wins over order", "nothing acceptable yields undefined", "ordinary stacks still work end to end", "parseAccept still recor...
16
router-review2-10
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. A bug in one of our middlewares corrupted a whole batch of requests before we noticed, and the router gave us no signal at all. The middleware in question awaited next(), then on a certain bran...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/middleware.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { compose } from '../src/index.ts';\nimport type { Middleware } from '../src/index.ts';\n\nconst REQ = {} as any;\nconst OK = async () => ({ status: 200, body: 'ok' });\n\ntest('calling next twice is rejected', ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "calling next twice is rejected", "downstream runs only once per request", "duplicate identical values are all kept", "final handler runs only once", "first() returns the leading value", "order is preserved", "repeated keys collect every value", "repeats mixed with singles" ]
[ "a layer may short-circuit without calling next", "empty query is an empty object", "empty stack calls the final handler", "errors propagate", "ordinary stacks still work end to end", "percent and plus decoding still work", "single values still work", "valueless keys are present and empty" ]
16
router-review2-11
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Content negotiation ignores what the client asked for first. A client sending `Accept: text/html, application/json` -- no explicit qualities, so both are equally acceptable -- gets JSON back. P...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/negotiate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { selectType, parseAccept } from '../src/index.ts';\n\nconst OFFER = ['text/html', 'application/json'];\n\ntest('equal quality is broken by client order', () => {\n assert.strictEqual(selectType('text/html, appl...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "client order beats alphabetical order", "duplicate identical values are all kept", "equal quality is broken by client order", "first() returns the leading value", "order is preserved", "repeated keys collect every value", "repeats mixed with singles", "three-way tie takes the first listed" ]
[ "empty query is an empty object", "explicit equal q values also use client order", "higher quality still wins over order", "nothing acceptable yields undefined", "parseAccept still records order and quality", "percent and plus decoding still work", "single values still work", "valueless keys are prese...
18
router-review2-12
router
typescript
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Content negotiation ignores what the client asked for first. A client sending `Accept: text/html, application/json` -- no explicit qualities, so both are equally acceptable -- gets JSON back. P...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/negotiate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { selectType, parseAccept } from '../src/index.ts';\n\nconst OFFER = ['text/html', 'application/json'];\n\ntest('equal quality is broken by client order', () => {\n assert.strictEqual(selectType('text/html, appl...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "client order beats alphabetical order", "compare is lexicographic, not a total", "earlier segments dominate when totals tie", "equal quality is broken by client order", "leftmost literal wins across three competitors", "three-way tie takes the first listed" ]
[ "exact match still preferred over everything", "explicit equal q values also use client order", "higher quality still wins over order", "nothing acceptable yields undefined", "parseAccept still records order and quality", "registration order is irrelevant", "specificity vector shape is unchanged", "st...
16
router-review3-04
router
typescript
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Registering the same route twice is silently accepted. Two teams added a handler for the same path in different spellings -- one with a trailing slash -- and both registrations succeeded. Reque...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a missing leading slash is the same route", "a repeatedly read key survives many insertions", "a trailing slash is the same route", "calling next twice is rejected", "compare is lexicographic, not a total", "downstream runs only once per request", "duplicate identical values are all kept", "earlier s...
[ "a layer may short-circuit without calling next", "capacity is enforced", "different parameter names are still distinct patterns", "different paths are fine", "empty query is an empty object", "empty stack calls the final handler", "errors propagate", "exact match still preferred over everything", "...
38
router-review3-07
router
typescript
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Header lookups miss depending on which client sent the request. Clients that send `content-type` are handled; clients that send `Content-Type` are treated as though the header were absent, and ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('lookup ignores case', () => {\n const h = new Headers({ 'Content-Type': 'text/html' });\n assert.strictEqual(h.get('content-type'), 'text/html');\n assert.strictEqual...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "all() returns a copy", "append across cases accumulates on one field", "client order beats alphabetical order", "compare is lexicographic, not a total", "delete ignores case", "duplicate identical values are all kept", "earlier segments dominate when totals tie", "equal quality is broken by client or...
[ "a single matching route still matches", "empty query is an empty object", "exact match still preferred over everything", "explicit equal q values also use client order", "higher quality still wins over order", "matchAll is ordered most specific first", "non-matching prefix still fails", "non-matching...
48
router-review3-10
router
typescript
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Reading a header can change it. Our logging layer collects a request's Set-Cookie values and appends a redaction marker to the list it got back. Downstream, the request carries that marker as a...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/headers-alias.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('mutating the result does not change the header', () => {\n const h = new Headers({ 'Set-Cookie': 'a=1' });\n h.all('set-cookie').push('REDACTED');\n assert.deep...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "duplicate identical values are all kept", "first() returns the leading value", "get is unaffected by a mutated all()", "mutating the result does not change the header", "mutation does not leak across reads", "named wildcard alongside params", "order is preserved", "repeated keys collect every value",...
[ "absent header returns an empty list", "append still accumulates", "empty query is an empty object", "multiple values are still returned", "non-matching prefix still fails", "param routes are unaffected", "percent and plus decoding still work", "single values still work", "static routes are unaffect...
23
router-review3-11
router
typescript
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Our hottest routes keep falling out of the route cache. The cache holds 128 entries and we serve far more distinct paths than that, but a handful of endpoints take almost all the traffic. Those...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a repeatedly read key survives many insertions", "client order beats alphabetical order", "equal quality is broken by client order", "matchAll is ordered most specific first", "param wins over wildcard", "params still extracted from the winner", "reading an entry protects it from eviction", "static w...
[ "a single matching route still matches", "capacity is enforced", "explicit equal q values also use client order", "higher quality still wins over order", "hit and miss counters still work", "non-matching routes are absent", "nothing acceptable yields undefined", "overwriting a key keeps one entry", ...
24
router-routing-regressions
router
typescript
logic
5
Three regressions in the router, from separate reports. All three need fixing. 1. Our static file route /assets/*path no longer serves anything in a subdirectory, and when a single-segment request does match, the captured parameter holds only that one segment. A wildcard should swallow the entire remainder of...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/cache.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { LruCache } from '../src/index.ts';\n\ntest('reading an entry protects it from eviction', () => {\n const c = new LruCache<string, number>(2);\n c.set('a', 1);\n c.set('b', 2);\n c.get('a');\n c.set('c', 3);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "a repeatedly read key survives many insertions", "duplicate identical values are all kept", "first() returns the leading value", "named wildcard alongside params", "order is preserved", "reading an entry protects it from eviction", "repeated keys collect every value", "repeats mixed with singles", ...
[ "capacity is enforced", "empty query is an empty object", "hit and miss counters still work", "non-matching prefix still fails", "overwriting a key keeps one entry", "param routes are unaffected", "percent and plus decoding still work", "reading does not change the size", "single values still work",...
25
router-specificity-by-sum
router
typescript
logic
5
The wrong handler runs when two routes could both match. We serve /files/report/:format and /files/:name/raw. A request for /files/report/raw is picked up by the second one, so it is treated as a raw fetch of a file called "report" rather than as the report endpoint. Swapping the order the two are registered in change...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/specificity.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { RouteTable, compareSpecificity, specificity, parsePattern } from '../src/index.ts';\n\nfunction table(patterns: string[]) {\n const t = new RouteTable<string>();\n for (const p of patterns) t.add(p, p);\n ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "compare is lexicographic, not a total", "earlier segments dominate when totals tie", "leftmost literal wins across three competitors" ]
[ "exact match still preferred over everything", "registration order is irrelevant", "specificity vector shape is unchanged", "static still beats param beats wildcard" ]
7
router-wildcard-remainder
router
typescript
logic
4
Our static file route stopped serving anything in a subdirectory. The route is /assets/*path. A request for /assets/logo.svg still works, but /assets/img/logo.svg returns no match at all, and when a single-segment request does match, the captured parameter is only that one segment. A wildcard is supposed to swallow t...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
{"tests/wildcard.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { RouteTable } from '../src/index.ts';\n\nfunction table() {\n const t = new RouteTable<string>();\n t.add('/assets/*path', 'assets');\n return t;\n}\n\ntest('wildcard captures a nested path', () => {\n const ...
{"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ...
[ "named wildcard alongside params", "wildcard captures a deep path", "wildcard captures a nested path", "wildcard matches an empty remainder" ]
[ "non-matching prefix still fails", "param routes are unaffected", "static routes are unaffected", "wildcard still captures a single segment" ]
8
scheduler-incident-triage
scheduler
python
logic
5
Three findings from last night's incident review. They are unrelated to each other; please fix all three. 1. A job started at the exact instant its maintenance window closed and overlapped the next slot's owner. Windows are documented as half-open, so a task may begin at a window's start but not at its end. 2. ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_backoff.py": "\nimport unittest\n\nfrom flow import RetryPolicy\n\n\nclass TestBackoffProgression(unittest.TestCase):\n def test_first_retry_waits_base_delay(self):\n self.assertEqual(RetryPolicy(max_attempts=5, base_delay=10.0,\n multiplier=2.0).delay_for(1), ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_backoff.TestBackoffProgression.test_first_retry_waits_base_delay", "tests.test_backoff.TestBackoffProgression.test_progression_doubles_from_base", "tests.test_metrics_counters.TestCountersAreKept.test_a_real_run_reports_counts", "tests.test_metrics_counters.TestCountersAreKept.test_counts_accumula...
[ "tests.test_backoff.TestBackoffProgression.test_clamped_at_max_delay", "tests.test_backoff.TestBackoffProgression.test_multiplier_of_one_is_constant", "tests.test_backoff.TestBackoffProgression.test_no_wait_before_the_first_attempt", "tests.test_metrics_counters.TestCountersAreKept.test_bump_still_works_direc...
16
scheduler-retry-subsystem-broken
scheduler
python
logic
5
Two problems with retries, reported together. 1. A task that has failed and is waiting to be retried never becomes eligible again, no matter how far the clock is advanced. The run simply stalls. 2. Separately, capacity is not returned when an attempt fails, so a pool drains over the life of a run until nothing ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_resource_lifecycle.py": "\nimport unittest\n\nfrom flow import (ResourcePool, ResourceRequest, RetryPolicy, Scheduler, Task,\n TaskGraph)\n\n\ndef scheduler(capacity=4, **kw):\n graph = TaskGraph([Task(\"job\", resources=(ResourceRequest(\"cpu\", 2),), **kw)])\n return Scheduler(grap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_resource_lifecycle.TestCapacityIsReturned.test_capacity_is_stable_across_many_retries", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_failure_returns_capacity", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_nothing_is_still_held_after_failure", "tests.test_resource_lifecy...
[ "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_capacity_is_held_while_running", "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_success_returns_capacity", "tests.test_retry.TestBackoffStillEnforced.test_exhausted_retries_end_as_failed", "tests.test_retry.TestBackoffStillEnforced.tes...
12
scheduler-scheduler-regressions
scheduler
python
logic
5
Three regressions reported against the scheduler this sprint. They have separate causes; please fix all three. 1. Reading the graph can corrupt it. A reporting tool that collects the dependents of each task into a set and annotates that set finds the graph's own structure changed afterwards, and subsequent sched...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
21
scheduler-triage2-01
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Capacity disappears whenever a task cannot be admitted. One of our tasks needs both a "cpu" unit and a "gpu" unit. When gpu capacity is exhausted the start attempt fails, which we expect and ha...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
15
scheduler-triage2-02
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Capacity disappears whenever a task cannot be admitted. One of our tasks needs both a "cpu" unit and a "gpu" unit. When gpu capacity is exhausted the start attempt fails, which we expect and ha...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
13
scheduler-triage2-03
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. The scheduler hands us more work than our resource pool can support. With a pool of 3 "cpu" units and two tasks that each request 2, a single call to next_batch comes back with both of them. St...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_batching.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, Scheduler, Task, TaskGraph\n\n\ndef sched(capacity, tasks, **kw):\n return Scheduler(TaskGraph(tasks), ResourcePool(capacity), **kw)\n\n\nclass TestBatchIsStartable(unittest.TestCase):\n def test_batch_fits_within_cap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_batching.TestBatchIsStartable.test_batch_fits_within_capacity", "tests.test_batching.TestBatchIsStartable.test_three_way_split", "tests.test_batching.TestBatchIsStartable.test_whole_batch_can_actually_start", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_combination_of_both_is_accep...
[ "tests.test_batching.TestBatchingOtherwiseUnchanged.test_everything_fits_when_capacity_is_ample", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_max_parallel_still_caps", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_priority_order_preserved", "tests.test_batching.TestBatchingOtherwiseUnc...
14
scheduler-triage2-04
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Runs containing a failure never finish. Our deploy graph is a chain: fetch -> build -> test -> package -> ship. When build fails, the run is left sitting there forever. Inspecting the state, te...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_cascade.py": "\nimport unittest\n\nfrom flow import ResourcePool, Scheduler, Task, TaskGraph\nfrom flow import state as st\n\n\ndef chain(*names):\n tasks = []\n previous = None\n for name in names:\n deps = frozenset({previous}) if previous else frozenset()\n tasks.append(Task(name,...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_cascade.TestFailurePropagatesFully.test_diamond_below_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_run_completes_after_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_whole_chain_below_a_failure_is_skipped", "tests.test_condition_scope.TestTransitiveNamesAreLegal...
[ "tests.test_cascade.TestUnrelatedWorkSurvives.test_independent_branch_is_untouched", "tests.test_cascade.TestUnrelatedWorkSurvives.test_successful_run_skips_nothing", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_downstream_task_is_rejected", "tests.test_condition_scope.TestOutOfScopeStillRejec...
12
scheduler-triage2-05
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Runs that use conditional tasks hang at the end. Our graph has an optional publish step gated on a condition. On runs where the condition comes out false the step is correctly never started -- ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_graph_isolation.py": "\nimport unittest\n\nfrom flow import Task, TaskGraph, UnknownTask\n\n\ndef diamond():\n return TaskGraph([Task(\"root\"),\n Task(\"left\", depends_on=frozenset({\"root\"})),\n Task(\"right\", depends_on=frozenset({\"root\"})),\n ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_graph_isolation.TestReadsDoNotMutate.test_descendants_unaffected_by_mutation", "tests.test_graph_isolation.TestReadsDoNotMutate.test_mutating_the_result_does_not_touch_the_graph", "tests.test_graph_isolation.TestReadsDoNotMutate.test_topological_order_is_unaffected", "tests.test_settle.TestFalseCo...
[ "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_dependents", "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_leaf_has_no_dependents", "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_topological_order_is_valid", "tests.test_graph_isolation.TestGraphStillReadsCorrectly....
15
scheduler-triage2-06
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Runs that use conditional tasks hang at the end. Our graph has an optional publish step gated on a condition. On runs where the condition comes out false the step is correctly never started -- ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_precedence.py": "\nimport unittest\n\nfrom flow import evaluate\n\n\ndef facts(**kw):\n return kw\n\n\nclass TestOperatorPrecedence(unittest.TestCase):\n \"\"\"`and` must bind tighter than `or`, as in Python.\"\"\"\n\n def test_or_of_and(self):\n self.assertTrue(evaluate(\"a or b and c\", f...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_precedence.TestExpressionBasicsIntact.test_parentheses_override", "tests.test_precedence.TestOperatorPrecedence.test_and_of_or", "tests.test_precedence.TestOperatorPrecedence.test_matches_python_over_every_assignment", "tests.test_precedence.TestOperatorPrecedence.test_or_of_and", "tests.test_pr...
[ "tests.test_precedence.TestExpressionBasicsIntact.test_bare_name", "tests.test_precedence.TestExpressionBasicsIntact.test_blank_condition_is_true", "tests.test_precedence.TestExpressionBasicsIntact.test_not_binds_tightest", "tests.test_settle.TestTrueConditionStillRuns.test_failed_upstream_still_skips", "te...
15
scheduler-triage2-07
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Our graph inspector corrupts the graph it inspects. The tool walks a workflow and, for reporting, collects the dependents of each task into a set it then adds a marker into. After running it, s...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_graph_isolation.py": "\nimport unittest\n\nfrom flow import Task, TaskGraph, UnknownTask\n\n\ndef diamond():\n return TaskGraph([Task(\"root\"),\n Task(\"left\", depends_on=frozenset({\"root\"})),\n Task(\"right\", depends_on=frozenset({\"root\"})),\n ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_graph_isolation.TestReadsDoNotMutate.test_descendants_unaffected_by_mutation", "tests.test_graph_isolation.TestReadsDoNotMutate.test_mutating_the_result_does_not_touch_the_graph", "tests.test_graph_isolation.TestReadsDoNotMutate.test_topological_order_is_unaffected", "tests.test_precedence.TestExp...
[ "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_dependents", "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_leaf_has_no_dependents", "tests.test_graph_isolation.TestGraphStillReadsCorrectly.test_topological_order_is_valid", "tests.test_graph_isolation.TestGraphStillReadsCorrectly....
16
scheduler-triage2-08
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Jobs deferred outside their maintenance window come back at the wrong time. We ask the calendar when a task may next start. With several windows configured and the current time sitting after th...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_next_open.py": "\nimport unittest\n\nfrom flow import Calendar, Window\n\n\ndef cal():\n return Calendar([Window(10.0, 20.0), Window(30.0, 40.0), Window(50.0, 60.0)])\n\n\nclass TestNextOpenLooksForward(unittest.TestCase):\n def test_between_windows_finds_the_following_one(self):\n self.assert...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_next_open.TestNextOpenLooksForward.test_after_every_window_returns_none", "tests.test_next_open.TestNextOpenLooksForward.test_after_the_second_window_finds_the_third", "tests.test_next_open.TestNextOpenLooksForward.test_between_windows_finds_the_following_one", "tests.test_next_open.TestNextOpenLo...
[ "tests.test_next_open.TestNextOpenLooksForward.test_before_all_windows_returns_the_first", "tests.test_next_open.TestNextOpenOtherwiseUnchanged.test_empty_calendar_returns_now", "tests.test_next_open.TestNextOpenOtherwiseUnchanged.test_exactly_at_a_start_returns_now", "tests.test_next_open.TestNextOpenOtherwi...
15
scheduler-triage2-09
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Jobs deferred outside their maintenance window come back at the wrong time. We ask the calendar when a task may next start. With several windows configured and the current time sitting after th...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_next_open.py": "\nimport unittest\n\nfrom flow import Calendar, Window\n\n\ndef cal():\n return Calendar([Window(10.0, 20.0), Window(30.0, 40.0), Window(50.0, 60.0)])\n\n\nclass TestNextOpenLooksForward(unittest.TestCase):\n def test_between_windows_finds_the_following_one(self):\n self.assert...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_next_open.TestNextOpenLooksForward.test_after_every_window_returns_none", "tests.test_next_open.TestNextOpenLooksForward.test_after_the_second_window_finds_the_third", "tests.test_next_open.TestNextOpenLooksForward.test_between_windows_finds_the_following_one", "tests.test_next_open.TestNextOpenLo...
[ "tests.test_next_open.TestNextOpenLooksForward.test_before_all_windows_returns_the_first", "tests.test_next_open.TestNextOpenOtherwiseUnchanged.test_empty_calendar_returns_now", "tests.test_next_open.TestNextOpenOtherwiseUnchanged.test_exactly_at_a_start_returns_now", "tests.test_next_open.TestNextOpenOtherwi...
15
scheduler-triage2-10
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Two runs of the same unchanged graph produce different schedules. We compare scheduler decisions between runs as part of our release checks, and tasks that share a priority come back in a diffe...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_ordering.py": "\nimport unittest\n\nfrom flow import ResourcePool, Scheduler, Task, TaskGraph\n\n\ndef batch(names):\n graph = TaskGraph([Task(n) for n in names])\n s = Scheduler(graph, ResourcePool({}))\n return s.next_batch(s.new_state())\n\n\nclass TestDeterministicOrdering(unittest.TestCase):\...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_ordering.TestDeterministicOrdering.test_sort_key_distinguishes_equal_priorities", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_capacity_is_stable_across_many_retries", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_failure_returns_capacity", "tests.test_resource_lifecycle...
[ "tests.test_ordering.TestDeterministicOrdering.test_equal_priority_sorts_by_id", "tests.test_ordering.TestDeterministicOrdering.test_insertion_order_does_not_matter", "tests.test_ordering.TestDeterministicOrdering.test_mixed_priorities_then_id", "tests.test_ordering.TestPriorityStillWins.test_higher_priority_...
12
scheduler-triage2-11
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Tasks are admitted that the pool cannot actually support. A task declaring it needs 3 units of "cpu" is admitted against a pool with only 1 free, and the run then fails when it tries to take th...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_requires.py": "\nimport unittest\n\nfrom flow import ResourceRequest, Task\n\n\ndef task(*reqs):\n return Task(\"t\", resources=tuple(ResourceRequest(n, a) for n, a in reqs))\n\n\nclass TestRequires(unittest.TestCase):\n def test_reports_the_declared_amount(self):\n self.assertEqual(task((\"cp...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_requires.TestRequires.test_large_amounts", "tests.test_requires.TestRequires.test_reports_the_declared_amount", "tests.test_requires.TestRequires.test_several_pools_report_independently", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_capacity_is_stable_across_many_retries", "tests.t...
[ "tests.test_requires.TestRequires.test_amount_of_one_still_reports_one", "tests.test_requires.TestRequiresEdges.test_no_resources_is_zero", "tests.test_requires.TestRequiresEdges.test_undeclared_resource_is_zero", "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_capacity_is_held_while_running", ...
12
scheduler-triage2-12
scheduler
python
logic
5
2 findings from this week's triage. They have separate causes and are not related to one another; all 2 need fixing. 1. Resuming a saved run stampedes our downstream API. When a task fails we back it off before retrying. If the process is restarted while several tasks are waiting out their backoff, every one of ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_resume.py": "\nimport unittest\n\nfrom flow import (ResourcePool, RetryPolicy, RunState, Scheduler, Task,\n TaskGraph, dump_state, load_state, round_trip)\n\n\nclass TestResumePreservesBackoff(unittest.TestCase):\n def test_ready_at_survives_a_round_trip(self):\n state = RunState...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_resume.TestResumePreservesBackoff.test_dump_includes_every_field_the_scheduler_reads", "tests.test_resume.TestResumePreservesBackoff.test_ready_at_survives_a_round_trip", "tests.test_resume.TestResumePreservesBackoff.test_reloaded_run_becomes_eligible_on_time", "tests.test_retry.TestRetryBecomesEl...
[ "tests.test_resume.TestPersistenceOtherwiseIntact.test_bad_version_is_rejected", "tests.test_resume.TestPersistenceOtherwiseIntact.test_results_survive", "tests.test_resume.TestPersistenceOtherwiseIntact.test_status_and_attempts_survive", "tests.test_resume.TestResumePreservesBackoff.test_reloaded_run_still_w...
13
scheduler-triage3-02
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Capacity disappears whenever a task cannot be admitted. One of our tasks needs both a "cpu" unit and a "gpu" unit. When gpu capacity is exhausted the start attempt fails, which we expect and ha...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
21
scheduler-triage3-03
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Capacity disappears whenever a task cannot be admitted. One of our tasks needs both a "cpu" unit and a "gpu" unit. When gpu capacity is exhausted the start attempt fails, which we expect and ha...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
38
scheduler-triage3-04
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Capacity disappears whenever a task cannot be admitted. One of our tasks needs both a "cpu" unit and a "gpu" unit. When gpu capacity is exhausted the start attempt fails, which we expect and ha...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_atomic_acquire.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, ResourceExhausted, UnknownResource\n\n\ndef pool():\n return ResourcePool({\"cpu\": 4, \"gpu\": 1})\n\n\nBOTH = (ResourceRequest(\"cpu\", 1), ResourceRequest(\"gpu\", 1))\n\n\nclass TestAcquireIsAllOrNothing(unitte...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_holds_nothing", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_failed_acquire_leaves_capacity_intact", "tests.test_atomic_acquire.TestAcquireIsAllOrNothing.test_repeated_failures_do_not_drain_the_pool", "tests.test_atomic_acqu...
[ "tests.test_atomic_acquire.TestAcquireStillWorks.test_exhaustion_is_still_reported", "tests.test_atomic_acquire.TestAcquireStillWorks.test_no_requests_is_a_noop", "tests.test_atomic_acquire.TestAcquireStillWorks.test_release_returns_capacity", "tests.test_atomic_acquire.TestAcquireStillWorks.test_successful_a...
43
scheduler-triage3-06
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. The scheduler hands us more work than our resource pool can support. With a pool of 3 "cpu" units and two tasks that each request 2, a single call to next_batch comes back with both of them. St...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_batching.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, Scheduler, Task, TaskGraph\n\n\ndef sched(capacity, tasks, **kw):\n return Scheduler(TaskGraph(tasks), ResourcePool(capacity), **kw)\n\n\nclass TestBatchIsStartable(unittest.TestCase):\n def test_batch_fits_within_cap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_batching.TestBatchIsStartable.test_batch_fits_within_capacity", "tests.test_batching.TestBatchIsStartable.test_three_way_split", "tests.test_batching.TestBatchIsStartable.test_whole_batch_can_actually_start", "tests.test_graph_isolation.TestReadsDoNotMutate.test_descendants_unaffected_by_mutation"...
[ "tests.test_batching.TestBatchingOtherwiseUnchanged.test_everything_fits_when_capacity_is_ample", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_max_parallel_still_caps", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_priority_order_preserved", "tests.test_batching.TestBatchingOtherwiseUnc...
47
scheduler-triage3-07
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. The scheduler hands us more work than our resource pool can support. With a pool of 3 "cpu" units and two tasks that each request 2, a single call to next_batch comes back with both of them. St...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_batching.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, Scheduler, Task, TaskGraph\n\n\ndef sched(capacity, tasks, **kw):\n return Scheduler(TaskGraph(tasks), ResourcePool(capacity), **kw)\n\n\nclass TestBatchIsStartable(unittest.TestCase):\n def test_batch_fits_within_cap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_batching.TestBatchIsStartable.test_batch_fits_within_capacity", "tests.test_batching.TestBatchIsStartable.test_three_way_split", "tests.test_batching.TestBatchIsStartable.test_whole_batch_can_actually_start", "tests.test_next_open.TestNextOpenLooksForward.test_after_every_window_returns_none", "...
[ "tests.test_batching.TestBatchingOtherwiseUnchanged.test_everything_fits_when_capacity_is_ample", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_max_parallel_still_caps", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_priority_order_preserved", "tests.test_batching.TestBatchingOtherwiseUnc...
35
scheduler-triage3-09
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. The scheduler hands us more work than our resource pool can support. With a pool of 3 "cpu" units and two tasks that each request 2, a single call to next_batch comes back with both of them. St...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_batching.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, Scheduler, Task, TaskGraph\n\n\ndef sched(capacity, tasks, **kw):\n return Scheduler(TaskGraph(tasks), ResourcePool(capacity), **kw)\n\n\nclass TestBatchIsStartable(unittest.TestCase):\n def test_batch_fits_within_cap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_batching.TestBatchIsStartable.test_batch_fits_within_capacity", "tests.test_batching.TestBatchIsStartable.test_three_way_split", "tests.test_batching.TestBatchIsStartable.test_whole_batch_can_actually_start", "tests.test_roots.TestRoots.test_a_chain_has_one_root", "tests.test_roots.TestRoots.tes...
[ "tests.test_batching.TestBatchingOtherwiseUnchanged.test_everything_fits_when_capacity_is_ample", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_max_parallel_still_caps", "tests.test_batching.TestBatchingOtherwiseUnchanged.test_priority_order_preserved", "tests.test_batching.TestBatchingOtherwiseUnc...
37
scheduler-triage3-11
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Runs containing a failure never finish. Our deploy graph is a chain: fetch -> build -> test -> package -> ship. When build fails, the run is left sitting there forever. Inspecting the state, te...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_cascade.py": "\nimport unittest\n\nfrom flow import ResourcePool, Scheduler, Task, TaskGraph\nfrom flow import state as st\n\n\ndef chain(*names):\n tasks = []\n previous = None\n for name in names:\n deps = frozenset({previous}) if previous else frozenset()\n tasks.append(Task(name,...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_cascade.TestFailurePropagatesFully.test_diamond_below_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_run_completes_after_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_whole_chain_below_a_failure_is_skipped", "tests.test_next_open.TestNextOpenLooksForward.test_aft...
[ "tests.test_cascade.TestUnrelatedWorkSurvives.test_independent_branch_is_untouched", "tests.test_cascade.TestUnrelatedWorkSurvives.test_successful_run_skips_nothing", "tests.test_next_open.TestNextOpenLooksForward.test_before_all_windows_returns_the_first", "tests.test_next_open.TestNextOpenOtherwiseUnchanged...
31
scheduler-triage3-12
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Runs containing a failure never finish. Our deploy graph is a chain: fetch -> build -> test -> package -> ship. When build fails, the run is left sitting there forever. Inspecting the state, te...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_cascade.py": "\nimport unittest\n\nfrom flow import ResourcePool, Scheduler, Task, TaskGraph\nfrom flow import state as st\n\n\ndef chain(*names):\n tasks = []\n previous = None\n for name in names:\n deps = frozenset({previous}) if previous else frozenset()\n tasks.append(Task(name,...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_cascade.TestFailurePropagatesFully.test_diamond_below_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_run_completes_after_a_failure", "tests.test_cascade.TestFailurePropagatesFully.test_whole_chain_below_a_failure_is_skipped", "tests.test_ordering.TestDeterministicOrdering.test_sor...
[ "tests.test_cascade.TestUnrelatedWorkSurvives.test_independent_branch_is_untouched", "tests.test_cascade.TestUnrelatedWorkSurvives.test_successful_run_skips_nothing", "tests.test_ordering.TestDeterministicOrdering.test_equal_priority_sorts_by_id", "tests.test_ordering.TestDeterministicOrdering.test_insertion_...
24
scheduler-triage3-14
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Runs that use conditional tasks hang at the end. Our graph has an optional publish step gated on a condition. On runs where the condition comes out false the step is correctly never started -- ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_condition_scope.py": "\nimport unittest\n\nfrom flow import Task, TaskGraph, validate_all\n\n\ndef chain_with_condition(condition):\n return TaskGraph([\n Task(\"a\"),\n Task(\"b\", depends_on=frozenset({\"a\"})),\n Task(\"c\", depends_on=frozenset({\"b\"}), condition=condition),\n ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_combination_of_both_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_deep_ancestor_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_grandparent_is_accepted", "tests.test_graph_isolation.TestReadsDo...
[ "tests.test_condition_scope.TestOutOfScopeStillRejected.test_downstream_task_is_rejected", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_no_condition_is_fine", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_unrelated_task_is_rejected", "tests.test_condition_scope.TestTransitiveNam...
39
scheduler-triage3-17
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Runs that use conditional tasks hang at the end. Our graph has an optional publish step gated on a condition. On runs where the condition comes out false the step is correctly never started -- ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_condition_scope.py": "\nimport unittest\n\nfrom flow import Task, TaskGraph, validate_all\n\n\ndef chain_with_condition(condition):\n return TaskGraph([\n Task(\"a\"),\n Task(\"b\", depends_on=frozenset({\"a\"})),\n Task(\"c\", depends_on=frozenset({\"b\"}), condition=condition),\n ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_combination_of_both_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_deep_ancestor_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_grandparent_is_accepted", "tests.test_next_open.TestNextOpenLooks...
[ "tests.test_condition_scope.TestOutOfScopeStillRejected.test_downstream_task_is_rejected", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_no_condition_is_fine", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_unrelated_task_is_rejected", "tests.test_condition_scope.TestTransitiveNam...
42
scheduler-triage3-19
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. A graph we expected to be rejected ran anyway, and gated the wrong task. We rely on the pre-run checks to catch conditions that reference something they shouldn't. A task whose condition names ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_condition_scope.py": "\nimport unittest\n\nfrom flow import Task, TaskGraph, validate_all\n\n\ndef chain_with_condition(condition):\n return TaskGraph([\n Task(\"a\"),\n Task(\"b\", depends_on=frozenset({\"a\"})),\n Task(\"c\", depends_on=frozenset({\"b\"}), condition=condition),\n ...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_combination_of_both_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_deep_ancestor_is_accepted", "tests.test_condition_scope.TestTransitiveNamesAreLegal.test_grandparent_is_accepted", "tests.test_graph_isolation.TestReadsDo...
[ "tests.test_condition_scope.TestOutOfScopeStillRejected.test_downstream_task_is_rejected", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_no_condition_is_fine", "tests.test_condition_scope.TestOutOfScopeStillRejected.test_unrelated_task_is_rejected", "tests.test_condition_scope.TestTransitiveNam...
41
scheduler-triage3-22
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. Conditional tasks are running when they shouldn't. We gate an optional deploy step with the condition `staging or canary and green`. Our intent is the usual reading: deploy when staging succeed...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_precedence.py": "\nimport unittest\n\nfrom flow import evaluate\n\n\ndef facts(**kw):\n return kw\n\n\nclass TestOperatorPrecedence(unittest.TestCase):\n \"\"\"`and` must bind tighter than `or`, as in Python.\"\"\"\n\n def test_or_of_and(self):\n self.assertTrue(evaluate(\"a or b and c\", f...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_precedence.TestExpressionBasicsIntact.test_parentheses_override", "tests.test_precedence.TestOperatorPrecedence.test_and_of_or", "tests.test_precedence.TestOperatorPrecedence.test_matches_python_over_every_assignment", "tests.test_precedence.TestOperatorPrecedence.test_or_of_and", "tests.test_pr...
[ "tests.test_precedence.TestExpressionBasicsIntact.test_bare_name", "tests.test_precedence.TestExpressionBasicsIntact.test_blank_condition_is_true", "tests.test_precedence.TestExpressionBasicsIntact.test_not_binds_tightest", "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_capacity_is_held_while_ru...
34
scheduler-triage3-24
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. A long-running workflow gradually stops scheduling anything. Our pipeline has a pool of 4 "cpu" units and several flaky tasks that fail and retry. The first few retries behave, but after enough...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_resource_lifecycle.py": "\nimport unittest\n\nfrom flow import (ResourcePool, ResourceRequest, RetryPolicy, Scheduler, Task,\n TaskGraph)\n\n\ndef scheduler(capacity=4, **kw):\n graph = TaskGraph([Task(\"job\", resources=(ResourceRequest(\"cpu\", 2),), **kw)])\n return Scheduler(grap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_resource_lifecycle.TestCapacityIsReturned.test_capacity_is_stable_across_many_retries", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_failure_returns_capacity", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_nothing_is_still_held_after_failure", "tests.test_resource_lifecy...
[ "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_capacity_is_held_while_running", "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_success_returns_capacity", "tests.test_should_retry.TestAttemptBudget.test_first_attempt_is_always_allowed", "tests.test_should_retry.TestBackoffUnaffected...
22
scheduler-triage3-25
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. A workflow with a retry policy hangs instead of retrying. To see it: define one task with RetryPolicy(max_attempts=3), start it, and report it failed. The run then never makes progress again --...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_retry.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, RetryPolicy, Scheduler, Task, TaskGraph\nfrom flow import state as st\n\n\ndef one_task(**kw):\n graph = TaskGraph([Task(\"job\", **kw)])\n return Scheduler(graph, ResourcePool({\"cpu\": 4}))\n\n\nclass TestRetryBecomesE...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_retry.TestRetryBecomesEligible.test_retry_is_offered_after_backoff", "tests.test_retry.TestRetryBecomesEligible.test_run_reaches_completion", "tests.test_roots.TestRoots.test_a_chain_has_one_root", "tests.test_roots.TestRoots.test_only_dependency_free_tasks", "tests.test_roots.TestRoots.test_sev...
[ "tests.test_retry.TestBackoffStillEnforced.test_exhausted_retries_end_as_failed", "tests.test_retry.TestBackoffStillEnforced.test_not_offered_before_backoff", "tests.test_retry.TestBackoffStillEnforced.test_terminal_tasks_are_never_offered", "tests.test_retry.TestRetryBecomesEligible.test_retry_runs_to_succes...
20
scheduler-triage3-26
scheduler
python
logic
5
3 findings from this week's triage. They have separate causes and are not related to one another; all 3 need fixing. 1. A workflow with a retry policy hangs instead of retrying. To see it: define one task with RetryPolicy(max_attempts=3), start it, and report it failed. The run then never makes progress again --...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_retry.py": "\nimport unittest\n\nfrom flow import ResourcePool, ResourceRequest, RetryPolicy, Scheduler, Task, TaskGraph\nfrom flow import state as st\n\n\ndef one_task(**kw):\n graph = TaskGraph([Task(\"job\", **kw)])\n return Scheduler(graph, ResourcePool({\"cpu\": 4}))\n\n\nclass TestRetryBecomesE...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_retry.TestBackoffStillEnforced.test_exhausted_retries_end_as_failed", "tests.test_retry.TestRetryBecomesEligible.test_retry_is_offered_after_backoff", "tests.test_retry.TestRetryBecomesEligible.test_run_reaches_completion", "tests.test_should_retry.TestAttemptBudget.test_no_retry_constant", "tes...
[ "tests.test_retry.TestBackoffStillEnforced.test_not_offered_before_backoff", "tests.test_retry.TestBackoffStillEnforced.test_terminal_tasks_are_never_offered", "tests.test_retry.TestRetryBecomesEligible.test_retry_runs_to_success", "tests.test_should_retry.TestAttemptBudget.test_first_attempt_is_always_allowe...
22
scheduler-triage4-09
scheduler
python
logic
5
4 findings from this week's triage. They have separate causes and are not related to one another; all 4 need fixing. 1. A long-running workflow gradually stops scheduling anything. Our pipeline has a pool of 4 "cpu" units and several flaky tasks that fail and retry. The first few retries behave, but after enough...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
{"tests/test_resource_lifecycle.py": "\nimport unittest\n\nfrom flow import (ResourcePool, ResourceRequest, RetryPolicy, Scheduler, Task,\n TaskGraph)\n\n\ndef scheduler(capacity=4, **kw):\n graph = TaskGraph([Task(\"job\", resources=(ResourceRequest(\"cpu\", 2),), **kw)])\n return Scheduler(grap...
{"README.md": "# flow\n\nA small workflow engine: directed graphs of tasks, run state, and a scheduler\nthat decides what may run next.\n\n```python\nfrom flow import Task, TaskGraph, ResourcePool, Scheduler\n\ngraph = TaskGraph([\n Task(\"fetch\"),\n Task(\"build\", depends_on=frozenset({\"fetch\"})),\n Task(...
[ "tests.test_resource_lifecycle.TestCapacityIsReturned.test_capacity_is_stable_across_many_retries", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_failure_returns_capacity", "tests.test_resource_lifecycle.TestCapacityIsReturned.test_nothing_is_still_held_after_failure", "tests.test_resource_lifecy...
[ "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_capacity_is_held_while_running", "tests.test_resource_lifecycle.TestNormalPathUnaffected.test_success_returns_capacity", "tests.test_topo.TestOrderIsReproducible.test_insertion_order_does_not_change_the_result", "tests.test_topo.TestOrderIsReproduci...
34