Events Worker Test Specification

Events Worker Test Specification

A. Metadata

Field Value
Worker name Events Worker
Documentation status Complete static source catalogue plus curated risk cases; execution pending.
Last reviewed 2026-10-17
Last test execution Not run
Source repository /home/johnny/projects/toastmachine-event-worker; toastmachine-event-worker
Inspected source revision ce3acfd30bf2ed479a6c71c437c149518a4b73a9; working tree clean at inspection.
Related Worker documentation Events Worker
Test specification revision 2 — complete static source catalogue added; original curated IDs preserved.

No application tests, deployment checks or operator scripts were executed for this review. Not run describes this review, not historical results. Existing reserved IDs have been populated, not removed. Source links identify the inspected revision. Plain-English descriptions retain exact technical names where needed to reproduce a case.

B. Purpose and scope

Reading the Corpus change feed, validating ordered event data, batching queue output and saving progress. The Worker relays events; it does not originate contribution records or guarantee exactly-once delivery.

The original cases are a curated high-value review. The catalogue below accounts for all 18 named declarations across 1 test files at this revision; this is not complete behavioural coverage. Requirements come from the cited code or contract; existing tests support only what their assertions check. Related wiki protocol/data pages remain reference destinations, not independent implementation evidence.

Responsibilities, related interfaces and dependencies are identified per case. Production credentials, live deployment behaviour and unsupported performance targets are outside scope. Desired requirements and unresolved guarantees are explicitly distinguished from implemented expectations.

Priority describes review risk: Critical protects access or durable state; High protects a core contract or recovery path; Medium covers a narrower operational concern; Low is reserved for low-impact cases. Integration can mean connected handlers/stores under a simulated runtime; it does not necessarily mean live services.

C. Test environment and prerequisites

Prerequisite Established setup and limitations
Required runtime and tooling CI selects Node.js 22 and pnpm 12.11.2. No root Vitest configuration was found. tests/pump.test.ts directly calls pump with makeEnv, an in-memory progress value and queue spies, and passes controlled feed responses. No deployed queue/KV or application credentials are needed for these unit cases.
Environment configuration Use the cited test configuration and per-case environment. Installed dependencies, private test settings and successful setup were not verified by execution.
Service bindings and dependencies Reuse makeChange, makeEnv and feed from the pump tests. Use canonical message/relationship events and explicit starting progress positions. Protocol event maximum is 102400 bytes; queue batching additionally measures the actual body wrapper.
Test databases and storage In-memory KV progress and queue spies provided by makeEnv; no deployed queue or store.
Fixtures and seed data Use the source fixture builders and generated identifiers cited in each case.
Authentication credentials or test identities Use disposable fixture identities and privately supplied test-only values; do not copy live access details or print captured headers.
Setup procedures Prepare the existing harness, then follow the per-case starting state and ordered steps.
Teardown and environment cleanup Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.

Harness/resource evidence: unit fixtures and assertions, producer configuration checks, event validation and size, schedule and resource declarations; deployment connections.

D. Test inventory

The first table lists curated risk cases; the second lists every source declaration. The views overlap and must not be added as distinct runnable tests. Status means implementation status; execution remains Not run.

Test ID Scenario Category Priority Status
EVT-001 Publish accepted changes and then save progress Happy-path behaviour; dependency interactions Critical Existing automated test
EVT-002 Keep message and relationship changes in one ordered feed Ordering; API compatibility High Existing automated test
EVT-003 Reject an out-of-order response before publishing it Input validation and boundary conditions High Existing automated test
EVT-004 Do not advance progress after a queue rejection Dependency failure handling Critical Existing automated test
EVT-005 Allow duplicate publication when saving progress fails Duplicate delivery; recovery Critical Existing automated test
EVT-006 Keep a maximum-size payload event intact Resource limits; payload preservation High Existing automated test
EVT-007 Stop before feed access if the initial progress read fails Dependency interactions; failure handling High Proposed test, not implemented

Complete automated source inventory

Every named source declaration in the test folders is listed below. These entries overlap with the curated scenarios above: they are not additional runnable tests. A parameterized declaration counts once, regardless of how many cases it registers. Conditional tests are included; all execution results remain Not run.

Test ID Scenario and source Category Priority Status
EVT-008 queues a 102400-byte event with payload intact and room for transport metadata Contract (provisional) High (pending risk review) Existing automated test
EVT-009 publishes assertions and retractions in the same ordered feed as messages Regression (provisional) High (pending risk review) Existing automated test
EVT-010 rejects an unknown event type without checkpointing past it Regression (provisional) High (pending risk review) Existing automated test
EVT-011 leaves the cursor unchanged when the feed is empty Regression (provisional) High (pending risk review) Existing automated test
EVT-012 publishes changes and advances the cursor Regression (provisional) High (pending risk review) Existing automated test
EVT-013 preserves multiple kinds in the published queue message Regression (provisional) High (pending risk review) Existing automated test
EVT-014 rejects noncanonical kind ordering Regression (provisional) High (pending risk review) Existing automated test
EVT-015 rejects changes that do not include the conversation subject Regression (provisional) High (pending risk review) Existing automated test
EVT-016 preserves all seven kinds in canonical order Regression (provisional) High (pending risk review) Existing automated test
EVT-017 rejects unsupported or duplicate kinds Regression (provisional) High (pending risk review) Existing automated test
EVT-018 requests subsequent pages using the latest cursor Regression (provisional) High (pending risk review) Existing automated test
EVT-019 rejects invalid JSON Regression (provisional) High (pending risk review) Existing automated test
EVT-020 rejects changes with invalid sequence ordering Regression (provisional) High (pending risk review) Existing automated test
EVT-021 rejects a corpus HTTP error without advancing the cursor Regression (provisional) High (pending risk review) Existing automated test
EVT-022 does not advance the cursor when queue publication fails Resilience (provisional) High (pending risk review) Existing automated test
EVT-023 may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor Resilience (provisional) High (pending risk review) Existing automated test
EVT-024 rejects a stored cursor that is invalid Regression (provisional) High (pending risk review) Existing automated test
EVT-025 rejects an oversized queue message Regression (provisional) High (pending risk review) Existing automated test

E. Detailed test cases

Cases follow the reusable test-case template. Additional explicit fields identify category, code path, command, independent statuses, limitations and follow-up. Expectations were not observed by running tests in this review.

EVT-001 — Publish accepted changes and then save progress

Field Specification or observation
1. Test ID and name EVT-001 — Publish accepted changes and then save progress
2. Requirement or guarantee Code-confirmed: a successfully published group advances saved progress to its last sequence after queue acceptance.
3. Purpose and risk addressed Progress skips unpublished records or accepted records are never tracked.
4. Priority Critical
5. Test type Unit
6. Preconditions Use makeEnv with starting position 0 and a queue spy that resolves; feed changes with sequences 1 and 2.
7. Input and test data Call pump(env, feed stand-in) with the two valid events.
8. Execution steps 1. Run the pump. 2. Compare the submitted bodies. 3. Check the final saved position and KV write arguments.
9. Expected HTTP status, where applicable Not applicable: scheduled-task helper, not a public HTTP handler.
10. Expected response headers and body The helper completes without a response body; queue input is the two {body: change} entries.
11. Expected state changes KV last_sequence is saved as text 2 after acceptance.
12. Expected emitted events or downstream calls, where applicable One queue sendBatch and progress put for the small fixture.
13. Negative assertions: what must not happen No progress beyond the last accepted record. The existing happy-path test does not independently control a pending queue promise to prove timing.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references pump and publishBatch; Existing assertions: tests/pump.test.ts — publishes changes and advances the cursor
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Add a deferred queue-resolution assertion if exact call timing is changed.
19. Category Happy-path behaviour; dependency interactions
20. Handler, interface or code path src/index.ts — pump and publishBatch
21. Test implementation location and command tests/pump.test.ts — publishes changes and advances the cursor. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations The assertion checks final state/calls; queue-rejection coverage in EVT-004 supports the failure-side ordering. This is not production queue delivery evidence.
25. Follow-up actions Add a deferred queue-resolution assertion if exact call timing is changed.

EVT-002 — Keep message and relationship changes in one ordered feed

Field Specification or observation
1. Test ID and name EVT-002 — Keep message and relationship changes in one ordered feed
2. Requirement or guarantee Code-confirmed: accepted event types share sequence order; gaps between positions are valid.
3. Purpose and risk addressed A reader processes only messages or drops relationship changes by assuming every position is present.
4. Priority High
5. Test type Unit
6. Preconditions Use makeEnv at 0 and the existing mixed-event fixture with message sequence 1, relationship assertion 4 and retraction 6.
7. Input and test data Pass that feed to pump with a successful queue stand-in.
8. Execution steps 1. Send the mixed feed. 2. Compare queue bodies and order. 3. Inspect saved progress.
9. Expected HTTP status, where applicable Not applicable: direct pump call.
10. Expected response headers and body Queue receives all three event envelopes unchanged and in input order.
11. Expected state changes Saved progress becomes text 6.
12. Expected emitted events or downstream calls, where applicable One small sendBatch followed by the corresponding KV save.
13. Negative assertions: what must not happen No synthetic events at missing positions and no discarded assertion/retraction.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references feed validation and publication; isCorpusEvent; Existing assertions: tests/pump.test.ts — publishes assertions and retractions in the same ordered feed as messages
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Keep downstream ordering guarantees separate from this producer assertion.
19. Category Ordering; API compatibility
20. Handler, interface or code path src/index.ts — feed validation and publication; src/protocol.ts — isCorpusEvent
21. Test implementation location and command tests/pump.test.ts — publishes assertions and retractions in the same ordered feed as messages. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Maintaining order within a submitted batch does not prove global downstream processing order across queue deliveries.
25. Follow-up actions Keep downstream ordering guarantees separate from this producer assertion.

EVT-003 — Reject an out-of-order response before publishing it

Field Specification or observation
1. Test ID and name EVT-003 — Reject an out-of-order response before publishing it
2. Requirement or guarantee Code-confirmed: each received sequence must be strictly greater than the preceding one and the saved start position.
3. Purpose and risk addressed Progress moves backwards or already processed data is treated as new.
4. Priority High
5. Test type Unit
6. Preconditions Fresh makeEnv at 0; provide valid events ordered 2 then 1 in a single response.
7. Input and test data Call pump with feed([makeChange(2), makeChange(1)]).
8. Execution steps 1. Supply the invalid ordering. 2. Assert rejection. 3. Inspect queue and KV spies.
9. Expected HTTP status, where applicable Not applicable: promise rejection, not an HTTP response.
10. Expected response headers and body Error text includes invalid change.
11. Expected state changes No progress put for this response.
12. Expected emitted events or downstream calls, where applicable No sendBatch and no KV put.
13. Negative assertions: what must not happen No partially published first event from this invalid response.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references previousSequence validation before grouping; Existing assertions: tests/pump.test.ts — rejects changes with invalid sequence ordering
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Use separate fixtures if testing a failure after prior-page progress.
19. Category Input validation and boundary conditions
20. Handler, interface or code path src/index.ts — previousSequence validation before grouping
21. Test implementation location and command tests/pump.test.ts — rejects changes with invalid sequence ordering. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations This fixture has no earlier successfully processed pages; a later bad page does not roll back previously accepted batches.
25. Follow-up actions Use separate fixtures if testing a failure after prior-page progress.

EVT-004 — Do not advance progress after a queue rejection

Field Specification or observation
1. Test ID and name EVT-004 — Do not advance progress after a queue rejection
2. Requirement or guarantee Code-confirmed: the queue must accept a group before its progress is persisted.
3. Purpose and risk addressed A failed publication is skipped on the next run.
4. Priority Critical
5. Test type Resilience
6. Preconditions makeEnv at 0; queue.sendBatch rejects once with a synthetic queue-unavailable error.
7. Input and test data One valid event at sequence 1.
8. Execution steps 1. Run pump. 2. Assert its rejection. 3. Compare saved progress and KV writes.
9. Expected HTTP status, where applicable Not applicable: helper rejects.
10. Expected response headers and body The rejection carries the injected queue-unavailable error; no automatic retry completes the run.
11. Expected state changes Stored position remains text 0.
12. Expected emitted events or downstream calls, where applicable The queue is attempted; KV put is not called for that group.
13. Negative assertions: what must not happen No checkpoint past a rejected group.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references publishBatch; Existing assertions: tests/pump.test.ts — does not advance the cursor when queue publication fails
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Keep ambiguous network outcomes distinct from this deterministic fixture.
19. Category Dependency failure handling
20. Handler, interface or code path src/index.ts — publishBatch
21. Test implementation location and command tests/pump.test.ts — does not advance the cursor when queue publication fails. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations A rejected promise does not generally establish whether an external service accepted anything before a lost response; the unit fixture is an explicit failed send.
25. Follow-up actions Keep ambiguous network outcomes distinct from this deterministic fixture.

EVT-005 — Allow duplicate publication when saving progress fails

Field Specification or observation
1. Test ID and name EVT-005 — Allow duplicate publication when saving progress fails
2. Requirement or guarantee Code-confirmed current behaviour: queue acceptance followed by failed KV persistence can cause the same sequence to be sent again on a later run.
3. Purpose and risk addressed A consumer incorrectly assumes the producer guarantees exactly-once delivery.
4. Priority Critical
5. Test type Resilience
6. Preconditions makeEnv at 0; let queue send succeed and make the first KV put fail; use a sequence-4 fixture.
7. Input and test data Run pump with that event, then run it again after the one-time put failure is removed.
8. Execution steps 1. Assert the first run rejects after one send. 2. Verify saved position is still 0. 3. Rerun with the same feed. 4. Inspect the two sends and final position.
9. Expected HTTP status, where applicable Not applicable: first helper call rejects, second completes.
10. Expected response headers and body First error is the injected KV failure; the same event body is submitted in both runs.
11. Expected state changes Position is initially unchanged, then saved as text 4 after the second acceptance.
12. Expected emitted events or downstream calls, where applicable Two total sends across two runs; final successful KV put records sequence 4.
13. Negative assertions: what must not happen Do not add a negative assertion forbidding duplicates; duplicates are explicitly supported behaviour here.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references queue-then-KV persistence order; Existing assertions: tests/pump.test.ts — may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Require downstream consumers to define duplicate tolerance; do not label this producer test an idempotent consumer test.
19. Category Duplicate delivery; recovery
20. Handler, interface or code path src/index.ts — queue-then-KV persistence order
21. Test implementation location and command tests/pump.test.ts — may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations This is a deterministic KV-save failure with manual rerun, not a live queue retry-policy test.
25. Follow-up actions Require downstream consumers to define duplicate tolerance; do not label this producer test an idempotent consumer test.

EVT-006 — Keep a maximum-size payload event intact

Field Specification or observation
1. Test ID and name EVT-006 — Keep a maximum-size payload event intact
2. Requirement or guarantee Code-confirmed: a valid 102400-byte event can fit within the configured queue wrapper budget and must not lose its payload during forwarding.
3. Purpose and risk addressed A large accepted contribution cannot be propagated or its structured data is silently truncated.
4. Priority High
5. Test type Unit
6. Preconditions Use the exact-size fixture that measures its serialized envelope and fills remaining content bytes while keeping the payload.
7. Input and test data A valid message.created event of exactly 102400 bytes, with payload plus content.
8. Execution steps 1. Measure the fixture bytes as in the test. 2. Check wrapper headroom. 3. Run pump and compare the full queued body and payload.
9. Expected HTTP status, where applicable Not applicable: direct pump call.
10. Expected response headers and body Queue body equals the original event; payload remains equal to its input.
11. Expected state changes Saved progress reaches text 1.
12. Expected emitted events or downstream calls, where applicable A queue batch contains the intact event.
13. Negative assertions: what must not happen No truncation or replacement of payload data to fit the transport.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references event and queue byte checks; assertEventSize; Existing assertions: tests/pump.test.ts — queues a 102400-byte event with payload intact and room for transport metadata
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Retain actual byte measurement when transport metadata changes.
19. Category Resource limits; payload preservation
20. Handler, interface or code path src/index.ts — event and queue byte checks; src/protocol.ts — assertEventSize
21. Test implementation location and command tests/pump.test.ts — queues a 102400-byte event with payload intact and room for transport metadata. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations This is an exact valid-event boundary fixture. Queue batch-count and aggregate-byte boundaries are separate from the per-event limit.
25. Follow-up actions Retain actual byte measurement when transport metadata changes.

EVT-007 — Stop before feed access if the initial progress read fails

Field Specification or observation
1. Test ID and name EVT-007 — Stop before feed access if the initial progress read fails
2. Requirement or guarantee Code-confirmed branch: pump awaits the progress-store get before fetching changes; a rejected get must not silently be treated as an absent position.
3. Purpose and risk addressed An outage is mistaken for first use and replays the whole feed without explicit recovery.
4. Priority High
5. Test type Resilience
6. Preconditions Provide makeEnv with the initial KV get rejecting; use feed/queue/put spies that must not be reached.
7. Input and test data Call pump once; no change feed response is necessary because the initial read fails.
8. Execution steps 1. Reject the initial get with a synthetic storage error. 2. Assert pump rejects. 3. Assert no feed fetch, queue send or progress put.
9. Expected HTTP status, where applicable Not applicable: helper rejection; no feed HTTP call should occur.
10. Expected response headers and body The original get rejection propagates; no application-defined fallback response is implemented.
11. Expected state changes No new saved position.
12. Expected emitted events or downstream calls, where applicable One failing KV get; zero feed requests, sends and puts.
13. Negative assertions: what must not happen Do not convert storage failure to cursor 0 or checkpoint invented progress.
14. Cleanup and postconditions Restore spies and discard each in-memory progress/queue fixture. There is no deployed-resource cleanup in these cases.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references initial KV get before parseCursor/feed loop; No existing automated case is claimed.
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Add this failure-spy case to the existing pump test file.
19. Category Dependency interactions; failure handling
20. Handler, interface or code path src/index.ts — initial KV get before parseCursor/feed loop
21. Test implementation location and command Proposed location: tests/pump.test.ts (new named case). No existing case is claimed. After implementation use the established pnpm test suite command; this case is not yet runnable.
22. Implementation status Proposed test, not implemented
23. Execution status Not run
24. Known limitations A case for invalid stored text already exists; it does not exercise a failed storage read. Overlapping-run concurrency remains a separate gap.
25. Follow-up actions Add this failure-spy case to the existing pump test file.

Complete automated source catalogue

Every named source declaration at this revision is documented below, including tests already referenced by curated cases. Catalogue entries have fresh stable IDs after the original IDs. Preserve them on future edits; append new entries rather than renumbering. Category and priority are provisional documentation triage labels.

Expected outcomes below come from actual source assertions. Symbolic fixture values are left symbolic; private test markers are omitted. Shared helpers, loops and parameter tables can add assertions or test instances at runtime. Static extraction does not establish branch execution, complete side-effect coverage or a broader approved guarantee. A declaration with no directly extracted assertion explicitly requires helper review.

tests/pump.test.ts

EVT-008 — queues a 102400-byte event with payload intact and room for transport metadata
Field Source-backed specification or observation
1. Test ID and name EVT-008 — queues a 102400-byte event with payload intact and room for transport metadata
2. Requirement or guarantee Source test intent: queues a 102400-byte event with payload intact and room for transport metadata. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Contract — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body See assertions A2, A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A5 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A3, A4 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:83; assertion/input source links below. Source key: tests/pump.test.ts :: queues a 102400-byte event with payload intact and room for transport metadata :: line 83 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Contract (provisional).
20. Handler, interface or code path tests/pump.test.ts:83; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:83 — queues a 102400-byte event with payload intact and room for transport metadata. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 89: expect(encoder.encode(JSON.stringify(change)).length).toBe(102400)
  • A2 line 90: expect(\n encoder.encode(JSON.stringify({ body: change })).length + 100,\n ).toBeLessThan(128000)
  • A3 line 94: expect(queue.sendBatch).toHaveBeenCalledWith([{ body: change }])
  • A4 line 95: expect(queue.sendBatch.mock.calls[0][0][0].body.data).toHaveProperty(\n "payload",\n change.data.payload,\n )
  • A5 line 99: expect(getCursor()).toBe("1")
Source inputs and operations
  • I1 line 93: pump(env, async () => feed([change]))
EVT-009 — publishes assertions and retractions in the same ordered feed as messages
Field Source-backed specification or observation
1. Test ID and name EVT-009 — publishes assertions and retractions in the same ordered feed as messages
2. Requirement or guarantee Source test intent: publishes assertions and retractions in the same ordered feed as messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A1, A2 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:102; assertion/input source links below. Source key: tests/pump.test.ts :: publishes assertions and retractions in the same ordered feed as messages :: line 102 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:102; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:102 — publishes assertions and retractions in the same ordered feed as messages. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 141: expect(queue.sendBatch).toHaveBeenCalledWith(\n changes.map((body) => ({ body })),\n )
  • A2 line 144: expect(getCursor()).toBe("6")
Source inputs and operations
  • I1 line 140: pump(env, async () => feed(changes))
EVT-010 — rejects an unknown event type without checkpointing past it
Field Source-backed specification or observation
1. Test ID and name EVT-010 — rejects an unknown event type without checkpointing past it
2. Requirement or guarantee Source test intent: rejects an unknown event type without checkpointing past it. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:147; assertion/input source links below. Source key: tests/pump.test.ts :: rejects an unknown event type without checkpointing past it :: line 147 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:147; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:147 — rejects an unknown event type without checkpointing past it. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 153: expect(pump(env, async () => feed([unknown]))).rejects.toThrow(\n "invalid change",\n )
  • A2 line 156: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 157: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 153: pump(env, async () => feed([unknown]))
EVT-011 — leaves the cursor unchanged when the feed is empty
Field Source-backed specification or observation
1. Test ID and name EVT-011 — leaves the cursor unchanged when the feed is empty
2. Requirement or guarantee Source test intent: leaves the cursor unchanged when the feed is empty. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes See assertions A1 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:159; assertion/input source links below. Source key: tests/pump.test.ts :: leaves the cursor unchanged when the feed is empty :: line 159 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:159; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:159 — leaves the cursor unchanged when the feed is empty. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 164: expect(getCursor()).toBe("5")
  • A2 line 165: expect(kv.put).not.toHaveBeenCalled()
  • A3 line 166: expect(queue.sendBatch).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 162: pump(env, async () => new Response("", { status: 200 }))
EVT-012 — publishes changes and advances the cursor
Field Source-backed specification or observation
1. Test ID and name EVT-012 — publishes changes and advances the cursor
2. Requirement or guarantee Source test intent: publishes changes and advances the cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A2, A3, A4 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A1, A2, A4 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:169; assertion/input source links below. Source key: tests/pump.test.ts :: publishes changes and advances the cursor :: line 169 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:169; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:169 — publishes changes and advances the cursor. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 175: expect(queue.sendBatch).toHaveBeenCalledTimes(1)
  • A2 line 176: expect(queue.sendBatch).toHaveBeenCalledWith(\n changes.map((body) => ({ body })),\n )
  • A3 line 179: expect(getCursor()).toBe("2")
  • A4 line 180: expect(kv.put).toHaveBeenLastCalledWith("last_sequence", "2")
Source inputs and operations
  • I1 line 173: pump(env, async () => feed(changes))
EVT-013 — preserves multiple kinds in the published queue message
Field Source-backed specification or observation
1. Test ID and name EVT-013 — preserves multiple kinds in the published queue message
2. Requirement or guarantee Source test intent: preserves multiple kinds in the published queue message. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:183; assertion/input source links below. Source key: tests/pump.test.ts :: preserves multiple kinds in the published queue message :: line 183 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:183; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:183 — preserves multiple kinds in the published queue message. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 189: expect(queue.sendBatch).toHaveBeenCalledWith([{ body: change }])
Source inputs and operations
  • I1 line 187: pump(env, async () => feed([change as unknown as CorpusChange]))
EVT-014 — rejects noncanonical kind ordering
Field Source-backed specification or observation
1. Test ID and name EVT-014 — rejects noncanonical kind ordering
2. Requirement or guarantee Source test intent: rejects noncanonical kind ordering. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:192; assertion/input source links below. Source key: tests/pump.test.ts :: rejects noncanonical kind ordering :: line 192 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:192; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:192 — rejects noncanonical kind ordering. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 195: expect(pump(env, async () => feed([change]))).rejects.toThrow(\n "invalid change",\n )
  • A2 line 198: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 199: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 195: pump(env, async () => feed([change]))
EVT-015 — rejects changes that do not include the conversation subject
Field Source-backed specification or observation
1. Test ID and name EVT-015 — rejects changes that do not include the conversation subject
2. Requirement or guarantee Source test intent: rejects changes that do not include the conversation subject. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:202; assertion/input source links below. Source key: tests/pump.test.ts :: rejects changes that do not include the conversation subject :: line 202 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:202; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:202 — rejects changes that do not include the conversation subject. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 207: expect(\n pump(env, async () => feed([invalid as unknown as CorpusChange])),\n ).rejects.toThrow("invalid change")
  • A2 line 210: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 211: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 208: pump(env, async () => feed([invalid as unknown as CorpusChange]))
EVT-016 — preserves all seven kinds in canonical order
Field Source-backed specification or observation
1. Test ID and name EVT-016 — preserves all seven kinds in canonical order
2. Requirement or guarantee Source test intent: preserves all seven kinds in canonical order. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:214; assertion/input source links below. Source key: tests/pump.test.ts :: preserves all seven kinds in canonical order :: line 214 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:214; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:214 — preserves all seven kinds in canonical order. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 218: expect(queue.sendBatch).toHaveBeenCalledWith([{ body: change }])
Source inputs and operations
  • I1 line 217: pump(env, async () => feed([change as unknown as CorpusChange]))
EVT-017 — rejects unsupported or duplicate kinds
Field Source-backed specification or observation
1. Test ID and name EVT-017 — rejects unsupported or duplicate kinds
2. Requirement or guarantee Source test intent: rejects unsupported or duplicate kinds. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:221; assertion/input source links below. Source key: tests/pump.test.ts :: rejects unsupported or duplicate kinds :: line 221 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:221; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:221 — rejects unsupported or duplicate kinds. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 230: expect(\n pump(env, async () => feed([change as unknown as CorpusChange])),\n ).rejects.toThrow("invalid change")
  • A2 line 235: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 236: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 231: pump(env, async () => feed([change as unknown as CorpusChange]))
EVT-018 — requests subsequent pages using the latest cursor
Field Source-backed specification or observation
1. Test ID and name EVT-018 — requests subsequent pages using the latest cursor
2. Requirement or guarantee Source test intent: requests subsequent pages using the latest cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
13. Negative assertions: what must not happen No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:239; assertion/input source links below. Source key: tests/pump.test.ts :: requests subsequent pages using the latest cursor :: line 239 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:239; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:239 — requests subsequent pages using the latest cursor. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 257: expect(requestedUrls).toHaveLength(2)
  • A2 line 258: expect(requestedUrls[0].searchParams.get("after")).toBe("0")
  • A3 line 259: expect(requestedUrls[1].searchParams.get("after")).toBe("1")
Source inputs and operations
EVT-019 — rejects invalid JSON
Field Source-backed specification or observation
1. Test ID and name EVT-019 — rejects invalid JSON
2. Requirement or guarantee Source test intent: rejects invalid JSON. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:262; assertion/input source links below. Source key: tests/pump.test.ts :: rejects invalid JSON :: line 262 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:262; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:262 — rejects invalid JSON. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 265: expect(\n pump(env, async () => new Response("not-json", { status: 200 })),\n ).rejects.toThrow("invalid JSON")
  • A2 line 269: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 270: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 266: pump(env, async () => new Response("not-json", { status: 200 }))
EVT-020 — rejects changes with invalid sequence ordering
Field Source-backed specification or observation
1. Test ID and name EVT-020 — rejects changes with invalid sequence ordering
2. Requirement or guarantee Source test intent: rejects changes with invalid sequence ordering. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:273; assertion/input source links below. Source key: tests/pump.test.ts :: rejects changes with invalid sequence ordering :: line 273 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:273; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:273 — rejects changes with invalid sequence ordering. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 276: expect(\n pump(env, async () => feed([makeChange(2), makeChange(1)])),\n ).rejects.toThrow("invalid change")
  • A2 line 280: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 281: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 277: pump(env, async () => feed([makeChange(2), makeChange(1)]))
EVT-021 — rejects a corpus HTTP error without advancing the cursor
Field Source-backed specification or observation
1. Test ID and name EVT-021 — rejects a corpus HTTP error without advancing the cursor
2. Requirement or guarantee Source test intent: rejects a corpus HTTP error without advancing the cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A2 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A3, A4 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A3, A4 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:284; assertion/input source links below. Source key: tests/pump.test.ts :: rejects a corpus HTTP error without advancing the cursor :: line 284 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:284; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:284 — rejects a corpus HTTP error without advancing the cursor. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 287: expect(\n pump(env, async () => new Response("Unavailable", { status: 503 })),\n ).rejects.toThrow("HTTP 503")
  • A2 line 291: expect(getCursor()).toBe("4")
  • A3 line 292: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A4 line 293: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 288: pump(env, async () => new Response("Unavailable", { status: 503 }))
EVT-022 — does not advance the cursor when queue publication fails
Field Source-backed specification or observation
1. Test ID and name EVT-022 — does not advance the cursor when queue publication fails
2. Requirement or guarantee Source test intent: does not advance the cursor when queue publication fails. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Resilience — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes See assertions A2 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A1, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:296; assertion/input source links below. Source key: tests/pump.test.ts :: does not advance the cursor when queue publication fails :: line 296 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Resilience (provisional).
20. Handler, interface or code path tests/pump.test.ts:296; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:296 — does not advance the cursor when queue publication fails. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 300: expect(pump(env, async () => feed([makeChange(1)]))).rejects.toThrow(\n "Queue unavailable",\n )
  • A2 line 304: expect(getCursor()).toBe("0")
  • A3 line 305: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 300: pump(env, async () => feed([makeChange(1)]))
EVT-023 — may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor
Field Source-backed specification or observation
1. Test ID and name EVT-023 — may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor
2. Requirement or guarantee Source test intent: may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Resilience — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes See assertions A3, A5, A6 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A4, A6 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:308; assertion/input source links below. Source key: tests/pump.test.ts :: may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor :: line 308 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Resilience (provisional).
20. Handler, interface or code path tests/pump.test.ts:308; expressions I1, I2. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:308 — may republish an accepted batch if cursor persistence fails, then resumes from the saved cursor. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 313: expect(pump(env, async () => feed([change]))).rejects.toThrow(\n "KV unavailable",\n )
  • A2 line 316: expect(queue.sendBatch).toHaveBeenCalledTimes(1)
  • A3 line 317: expect(getCursor()).toBe("0")
  • A4 line 321: expect(queue.sendBatch).toHaveBeenCalledTimes(2)
  • A5 line 322: expect(getCursor()).toBe("4")
  • A6 line 323: expect(kv.put).toHaveBeenLastCalledWith("last_sequence", "4")
Source inputs and operations
  • I1 line 313: pump(env, async () => feed([change]))
  • I2 line 320: pump(env, async () => feed([change]))
EVT-024 — rejects a stored cursor that is invalid
Field Source-backed specification or observation
1. Test ID and name EVT-024 — rejects a stored cursor that is invalid
2. Requirement or guarantee Source test intent: rejects a stored cursor that is invalid. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes See assertions A1 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A2 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:326; assertion/input source links below. Source key: tests/pump.test.ts :: rejects a stored cursor that is invalid :: line 326 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:326; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:326 — rejects a stored cursor that is invalid. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 329: expect(pump(env, async () => feed([makeChange(1)]))).rejects.toThrow(\n "Stored event cursor is invalid",\n )
  • A2 line 333: expect(queue.sendBatch).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 329: pump(env, async () => feed([makeChange(1)]))
EVT-025 — rejects an oversized queue message
Field Source-backed specification or observation
1. Test ID and name EVT-025 — rejects an oversized queue message
2. Requirement or guarantee Source test intent: rejects an oversized queue message. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee.
3. Purpose and risk addressed Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review.
4. Priority High — provisional catalogue triage; subject to risk review.
5. Test type Regression — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Event Worker pump. Do not infer starting state from the title.
7. Input and test data No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only.
8. Execution steps 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review.
9. Expected HTTP status, where applicable No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
10. Expected response headers and body No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
11. Expected state changes No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
12. Expected emitted events or downstream calls, where applicable See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review.
14. Cleanup and postconditions Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data.
15. Actual result Not run — no execution evidence collected.
16. Evidence references tests/pump.test.ts:336; assertion/input source links below. Source key: tests/pump.test.ts :: rejects an oversized queue message :: line 336 at this pinned revision.
17. Execution date Not run.
18. Status and outstanding issues Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction.
19. Category Regression (provisional).
20. Handler, interface or code path tests/pump.test.ts:336; expressions I1. Imported modules: ../src/kinds, vitest, ../src/index.
21. Test implementation location and command tests/pump.test.ts:336 — rejects an oversized queue message. Run pnpm test from /home/johnny/projects/toastmachine-event-worker after preparing its existing test environment; this invokes the suite.
22. Implementation status Existing automated test
23. Execution status Not run
24. Known limitations Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded.
25. Follow-up actions Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID.
Source assertions
  • A1 line 340: expect(pump(env, async () => feed([oversized]))).rejects.toThrow(\n "complete serialized event exceeds 102400",\n )
  • A2 line 344: expect(queue.sendBatch).not.toHaveBeenCalled()
  • A3 line 345: expect(kv.put).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 340: pump(env, async () => feed([oversized]))

F. Test categories

This maps selected cases rather than all source assertions. An unselected category is not automatically absent from the Worker or wider suite.

Category Applicability and selected coverage
Happy-path behaviour Selected cases: EVT-001. Their limitations apply.
Input validation and boundary conditions Selected cases: EVT-003. Their limitations apply.
Authentication and authorisation No public fetch handler is exported, so public HTTP credential cases are Not applicable. Platform resource access is a separate concern.
API and contract compatibility Selected cases: EVT-002. Their limitations apply.
Data integrity and consistency No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Idempotency and duplicate operations Selected cases: EVT-005. Their limitations apply.
Pagination and ordering Selected cases: EVT-002. Their limitations apply.
Dependency interactions Selected cases: EVT-001, EVT-004, EVT-007. Their limitations apply.
Timeout, retry and partial-failure handling Selected cases: EVT-004, EVT-005, EVT-007. Their limitations apply.
Security and abuse prevention No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Observability and diagnostics No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable. No complete logging, metrics, redaction or alerting guarantee is established here.
Regression tests No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Integration and end-to-end tests No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.

G. Execution instructions

pnpm test checks the packaged protocol and queue configuration, then runs Vitest. pnpm check:queue-config checks producer declarations only. pnpm typecheck, pnpm lint and pnpm format:check are separate. The inspected deploy workflow does not invoke the application test suite.

Run documented commands from /home/johnny/projects/toastmachine-event-worker only in the prepared test environment. None was run here. Commands are defined in package.json; release behaviour is declared in the CI/deploy workflow. Each case names its existing assertions or proposed location.

Execution layer Instruction and evidence boundary
Setup and teardown Use section C and the cited fixtures; record environment and revision and remove only disposable test data.
Unit tests Use the package suite for the relevant direct-helper cases; no separate unit-only command is assumed.
Integration tests Use the existing harness and service replacements. This does not prove a live cross-deployment guarantee.
Contract tests Use the existing package suite. Resources also defines openapi:check; schema checks do not replace runtime assertions.
Proposed tests Implement the specified case first; a proposed path is not an existing runnable test.
CI workflow references The inspected deployment workflow does not invoke the application suite. Other build/type/schema checks do not establish these cases executed.

H. Results and evidence

Test ID Last run Result Evidence Notes
EVT-001 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-002 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-003 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-004 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-005 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-006 Not run Not run Source/test inspection only; no execution log. Existing automated test
EVT-007 Not run Not run Source/test inspection only; no execution log. Proposed test, not implemented
Execution status Meaning
Not run No result is recorded in this review.
Passing A recorded execution met the scoped assertions in its stated environment.
Failing A recorded execution did not meet one or more assertions.
Blocked An identified prerequisite prevents execution.
Skipped Deliberate non-execution with a recorded reason.
Implementation status Meaning
Existing automated test Named assertions cover the scoped case, subject to its stated limitations.
Partially covered Related assertions exist but specific expectations still need verification.
Proposed test, not implemented New automated implementation is proposed, not claimed to exist.
Blocked by missing prerequisites A specified prerequisite prevents implementation.

A passing related test does not establish every associated guarantee. Record command, environment, immutable revision, run date and output evidence before changing an execution result. Source inspection is not execution evidence.

Complete automated source catalogue results

These entries correspond to source declarations, not additional or runtime-expanded tests.

Test ID Last run Result Evidence Notes
EVT-008 Not run Not run tests/pump.test.ts:83 Existing source declaration; no execution log.
EVT-009 Not run Not run tests/pump.test.ts:102 Existing source declaration; no execution log.
EVT-010 Not run Not run tests/pump.test.ts:147 Existing source declaration; no execution log.
EVT-011 Not run Not run tests/pump.test.ts:159 Existing source declaration; no execution log.
EVT-012 Not run Not run tests/pump.test.ts:169 Existing source declaration; no execution log.
EVT-013 Not run Not run tests/pump.test.ts:183 Existing source declaration; no execution log.
EVT-014 Not run Not run tests/pump.test.ts:192 Existing source declaration; no execution log.
EVT-015 Not run Not run tests/pump.test.ts:202 Existing source declaration; no execution log.
EVT-016 Not run Not run tests/pump.test.ts:214 Existing source declaration; no execution log.
EVT-017 Not run Not run tests/pump.test.ts:221 Existing source declaration; no execution log.
EVT-018 Not run Not run tests/pump.test.ts:239 Existing source declaration; no execution log.
EVT-019 Not run Not run tests/pump.test.ts:262 Existing source declaration; no execution log.
EVT-020 Not run Not run tests/pump.test.ts:273 Existing source declaration; no execution log.
EVT-021 Not run Not run tests/pump.test.ts:284 Existing source declaration; no execution log.
EVT-022 Not run Not run tests/pump.test.ts:296 Existing source declaration; no execution log.
EVT-023 Not run Not run tests/pump.test.ts:308 Existing source declaration; no execution log.
EVT-024 Not run Not run tests/pump.test.ts:326 Existing source declaration; no execution log.
EVT-025 Not run Not run tests/pump.test.ts:336 Existing source declaration; no execution log.

I. Coverage gaps and open questions

  • EVT-007 proposes the initial progress-store read-failure branch; invalid saved values are already tested separately.
  • Queue publication and saving progress are not one transaction. Duplicate publication after a saved-progress failure is documented existing behaviour, not a missing exactly-once feature.
  • The tests do not establish a monotonic saved cursor under overlapping scheduled runs. That concurrency requirement and supported scheduling assumptions need review.
  • The configured one-minute trigger is not a processing-time guarantee. No throughput, catch-up deadline, production queue retry or live scheduling evidence was collected.
  • Progress and error logging exists in source, but dedicated assertions for log content/redaction were not located in this focused review.

Known flaky tests and historical failure rates: Unknown; execution history was not assessed. No new reproduced application defect is claimed. Follow-up ownership and execution dates remain unassigned. Characterization proposals may expose a requirement decision without establishing a stronger approved guarantee.