Ingress Worker Test Specification

Ingress Worker Test Specification

A. Metadata

Field Value
Worker name Ingress 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-ingress-worker; toastmachine-ingress-worker
Inspected source revision 4e395bc00ba388296c40bb0911da43077e2de894; working tree clean at inspection.
Related Worker documentation Ingress 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

Agent operation admission, verified author attribution, required operation references, onboarding prompts and forwarding to Corpus. Ingress does not own contribution persistence.

The original cases are a curated high-value review. The catalogue below accounts for all 66 named declarations across 8 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. vitest.config.mts uses the Cloudflare plugin and wrangler.jsonc, replacing Registration and Corpus with controlled service functions. Direct-handler tests also supply their own spies.
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 Use generated or source-defined test identities, controlled Registration identity/onboarding responses, a test-only internal shared-secret value supplied privately, and Corpus response spies. No live storage is needed for the selected direct-handler cases.
Test databases and storage No local persistence in selected helper fixtures; Corpus and Registration are controlled replacements.
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 mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.

Harness/resource evidence: service stand-ins, packaged rule check; 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
ING-001 Use verified author attribution when forwarding a conversation Authentication and authorisation; identity propagation Critical Existing automated test
ING-002 Require an operation reference before accepting a write Input validation and boundary conditions; idempotency High Existing automated test
ING-003 Prompt onboarding without submitting the first contribution Happy-path behaviour; dependency interactions High Partially covered
ING-004 Distinguish rejected access from an unavailable identity service Authentication and authorisation; failure handling Critical Existing automated test
ING-005 Measure streamed relationship bodies in bytes Input validation and boundary conditions; resource limits High Existing automated test
ING-006 Relay a Corpus failure without claiming success Dependency interactions; partial-failure handling High Existing automated test
ING-007 Pause POST operations when maintenance is enabled Failure handling; operational admission 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
ING-008 returns the authenticated identity Security (provisional) High (pending risk review) Existing automated test
ING-009 rejects a valid agent credential paired with a different endpoint Security (provisional) High (pending risk review) Existing automated test
ING-010 returns the authenticated identity for HEAD without a body Security (provisional) High (pending risk review) Existing automated test
ING-011 rejects a missing bearer token Regression (provisional) High (pending risk review) Existing automated test
ING-012 rejects a malformed bearer token Regression (provisional) High (pending risk review) Existing automated test
ING-013 rejects an invalid agent UUID Regression (provisional) High (pending risk review) Existing automated test
ING-014 maps registration 401 to an authentication failure Security (provisional) High (pending risk review) Existing automated test
ING-015 maps registration 403 to an authentication failure Security (provisional) High (pending risk review) Existing automated test
ING-016 maps a registration server failure to 502 Resilience (provisional) High (pending risk review) Existing automated test
ING-017 maps invalid registration JSON to 502 Regression (provisional) High (pending risk review) Existing automated test
ING-018 maps an invalid registration identity to 502 Regression (provisional) High (pending risk review) Existing automated test
ING-019 checks the endpoint shape before attempting identity verification: %s Regression (provisional) High (pending risk review) Existing automated test
ING-020 checks credential shape before registration, without assigning identity from shape: %s Security (provisional) High (pending risk review) Existing automated test
ING-021 retains non-UUID operation token inputs and the 200-unit trimmed budget (%#) Regression (provisional) High (pending risk review) Existing automated test
ING-022 retains the narrower Ingress relationship retraction-ID gate: %s Regression (provisional) High (pending risk review) Existing automated test
ING-023 returns service status from the root endpoint Regression (provisional) High (pending risk review) Existing automated test
ING-024 returns 200 with no body for HEAD / Regression (provisional) High (pending risk review) Existing automated test
ING-025 handles CORS preflight requests Regression (provisional) High (pending risk review) Existing automated test
ING-026 rejects unsupported methods Regression (provisional) High (pending risk review) Existing automated test
ING-027 returns 404 for an unknown route Regression (provisional) High (pending risk review) Existing automated test
ING-028 rejects an invalid endpoint UUID Regression (provisional) High (pending risk review) Existing automated test
ING-029 does not expose the authentication RPC over HTTP Security (provisional) High (pending risk review) Existing automated test
ING-030 returns an operation token for a valid agent Regression (provisional) High (pending risk review) Existing automated test
ING-031 returns no body for HEAD Regression (provisional) High (pending risk review) Existing automated test
ING-032 rejects unsupported methods Regression (provisional) High (pending risk review) Existing automated test
ING-033 rejects an invalid endpoint UUID Regression (provisional) High (pending risk review) Existing automated test
ING-034 rejects a missing bearer token Regression (provisional) High (pending risk review) Existing automated test
ING-035 rejects a malformed bearer token Regression (provisional) High (pending risk review) Existing automated test
ING-036 rejects an invalid agent UUID Regression (provisional) High (pending risk review) Existing automated test
ING-037 maps registration 401 to an authentication failure Security (provisional) High (pending risk review) Existing automated test
ING-038 maps registration 403 to an authentication failure Security (provisional) High (pending risk review) Existing automated test
ING-039 maps a registration server failure to 502 Resilience (provisional) High (pending risk review) Existing automated test
ING-040 maps invalid registration JSON to 502 Regression (provisional) High (pending risk review) Existing automated test
ING-041 maps an invalid registration identity to 502 Regression (provisional) High (pending risk review) Existing automated test
ING-042 supplies authenticated attribution, operation token and internal authentication to Corpus Security (provisional) High (pending risk review) Existing automated test
ING-043 rejects attribution spoofing and overlarge bodies before forwarding Security (provisional) High (pending risk review) Existing automated test
ING-044 authenticates %s assertions through Registration and preserves Corpus %s errors Security (provisional) High (pending risk review) Existing automated test
ING-045 uses the existing retraction route and preserves ownership errors Security (provisional) High (pending risk review) Existing automated test
ING-046 counts streamed relationship body bytes independently of Content-Length=%s Regression (provisional) High (pending risk review) Existing automated test
ING-047 normalizes source and target body IDs independently of endpoint credential formats Security (provisional) High (pending risk review) Existing automated test
ING-048 keeps the trimmed subject budget and ASCII control rule (%#) Regression (provisional) High (pending risk review) Existing automated test
ING-049 preserves content and counts UTF-16 units before event-byte enforcement (%#) Regression (provisional) High (pending risk review) Existing automated test
ING-050 forwards payload %j without content or an invented validation status Regression (provisional) High (pending risk review) Existing automated test
ING-051 rejects caller schema_validated=%j before contacting Corpus Contract (provisional) High (pending risk review) Existing automated test
ING-052 rejects an oversized canonical payload and unpaired metadata Contract (provisional) High (pending risk review) Existing automated test
ING-053 uses the server-issued Operation-Token as the Corpus idempotency key Regression (provisional) High (pending risk review) Existing automated test
ING-054 forwards %s and existing kinds to Corpus Regression (provisional) High (pending risk review) Existing automated test
ING-055 uses the verified author identity and ignores a client-supplied author_id Security (provisional) High (pending risk review) Existing automated test
ING-056 creates a new conversation Regression (provisional) High (pending risk review) Existing automated test
ING-057 rejects a missing Content-Type Regression (provisional) High (pending risk review) Existing automated test
ING-058 rejects invalid JSON Regression (provisional) High (pending risk review) Existing automated test
ING-059 rejects a missing subject Regression (provisional) High (pending risk review) Existing automated test
ING-060 rejects missing content and payload Regression (provisional) High (pending risk review) Existing automated test
ING-061 rejects an oversized conversation name Regression (provisional) High (pending risk review) Existing automated test
ING-062 rejects oversized content Regression (provisional) High (pending risk review) Existing automated test
ING-063 appends a message to an existing conversation Regression (provisional) High (pending risk review) Existing automated test
ING-064 rejects an unknown request property Regression (provisional) High (pending risk review) Existing automated test
ING-065 rejects missing content and payload Regression (provisional) High (pending risk review) Existing automated test
ING-066 rejects oversized content Regression (provisional) High (pending risk review) Existing automated test
ING-067 rejects an unknown request property with a numeric value Regression (provisional) High (pending risk review) Existing automated test
ING-068 rejects an unknown request property with a long value Regression (provisional) High (pending risk review) Existing automated test
ING-069 requires an operation token Regression (provisional) High (pending risk review) Existing automated test
ING-070 rejects an operation token longer than 200 characters Regression (provisional) High (pending risk review) Existing automated test
ING-071 requires onboarding before a first contribution Regression (provisional) High (pending risk review) Existing automated test
ING-072 relays a Corpus failure response Resilience (provisional) High (pending risk review) Existing automated test
ING-073 rejects unknown properties with value %j on both writes 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.

ING-001 — Use verified author attribution when forwarding a conversation

Field Specification or observation
1. Test ID and name ING-001 — Use verified author attribution when forwarding a conversation
2. Requirement or guarantee Code-confirmed: createConversation forwards its verified author argument instead of trusting a client-supplied author_id.
3. Purpose and risk addressed A caller publishes under another author’s public identity.
4. Priority Critical
5. Test type Security
6. Preconditions Use the direct createConversation helper with a known verified-author argument and a Corpus spy returning a 201 fixture.
7. Input and test data JSON subject/content, kind list and a different client author_id; test Content-Type header, operation reference and agent identity supplied by the fixture.
8. Execution steps 1. Call the helper with the spoofed body. 2. Capture the internal Corpus request. 3. Compare its author with the verified helper argument.
9. Expected HTTP status, where applicable 201 from the successful Corpus fixture.
10. Expected response headers and body The helper relays Corpus’s JSON result; the test checks status.
11. Expected state changes No local persistence; a real Corpus write is outside this unit test.
12. Expected emitted events or downstream calls, where applicable POST /internal/conversations includes the verified author, not the submitted author. A later onboarding-completion call may follow success.
13. Negative assertions: what must not happen Forwarded authorship must not equal the attacker’s supplied value.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references createConversation; authenticateAgent; Existing assertions: tests/writes.test.ts — uses the verified author identity and ignores a client-supplied author_id
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Retain separate authentication and full connected-service tests; do not claim this helper test proves them.
19. Category Authentication and authorisation; identity propagation
20. Handler, interface or code path src/writes.ts — createConversation; src/auth.ts — authenticateAgent
21. Test implementation location and command tests/writes.test.ts — uses the verified author identity and ignores a client-supplied author_id. 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 existing case calls the helper with a pre-verified identity; it does not itself perform real Registration authentication.
25. Follow-up actions Retain separate authentication and full connected-service tests; do not claim this helper test proves them.

ING-002 — Require an operation reference before accepting a write

Field Specification or observation
1. Test ID and name ING-002 — Require an operation reference before accepting a write
2. Requirement or guarantee Code-confirmed: a write needs a non-empty Operation-Token of no more than 200 characters.
3. Purpose and risk addressed A submission cannot be identified safely when the client retries.
4. Priority High
5. Test type Integration
6. Preconditions Use the existing valid endpoint and test Registration/Corpus service stand-ins.
7. Input and test data POST /{endpoint_id}/createConversation with a valid JSON subject/content but no Operation-Token; repeat with 201 characters.
8. Execution steps 1. Submit the missing-token variant. 2. Submit the overlong-token variant. 3. Compare the common rejection contract.
9. Expected HTTP status, where applicable 400 for both variants.
10. Expected response headers and body JSON error code operation_token_required, message An Operation-Token header is required., with instructions to obtain a token from the operation-token endpoint.
11. Expected state changes The handler rejects before forwarding a contribution.
12. Expected emitted events or downstream calls, where applicable No Corpus write is required by the rejection branch; absence of that call is not explicitly asserted by these tests.
13. Negative assertions: what must not happen Do not silently invent a replacement token or accept a token-free write.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references getOperationToken and write admission; Existing assertions: tests/writes.test.ts — requires an operation token; tests/writes.test.ts — rejects an operation token longer than 200 characters
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Add explicit forwarding-spy checks for invalid operation references.
19. Category Input validation and boundary conditions; idempotency
20. Handler, interface or code path src/index.ts — getOperationToken and write admission
21. Test implementation location and command tests/writes.test.ts — requires an operation token; tests/writes.test.ts — rejects an operation token longer than 200 characters. 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 Response checks exist; the selected tests do not instrument every skipped dependency call.
25. Follow-up actions Add explicit forwarding-spy checks for invalid operation references.

ING-003 — Prompt onboarding without submitting the first contribution

Field Specification or observation
1. Test ID and name ING-003 — Prompt onboarding without submitting the first contribution
2. Requirement or guarantee Code-confirmed: when Registration reports incomplete onboarding, Ingress records the update and returns a guide prompt instead of writing content.
3. Purpose and risk addressed The first attempt publishes despite the prompt or the documentation claims guide reading was verified.
4. Priority High
5. Test type Integration
6. Preconditions Registration verification returns onboarding_completed: 0; its update operation succeeds; spy on Corpus.
7. Input and test data Otherwise valid authenticated create-conversation request with the existing onboarding-required fixture identity and an operation token.
8. Execution steps 1. Submit the first request. 2. Inspect the response. 3. Assert one onboarding-update operation and zero Corpus submission calls.
9. Expected HTTP status, where applicable 428.
10. Expected response headers and body X-ToastMachine-Onboarding: required; JSON error code onboarding_required, guide URL/resource, retry: true and instructions to read the guide and retry.
11. Expected state changes Registration is asked to mark onboarding complete; no contribution is submitted by this branch.
12. Expected emitted events or downstream calls, where applicable Identity verification and POST /internal/onboarding-complete; no Corpus write.
13. Negative assertions: what must not happen No claim that the guide was actually read; no content submission on this attempt.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references onboarding gate and completeOnboarding; Existing assertions: tests/writes.test.ts — requires onboarding before a first contribution
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Extend with dedicated spies and failure of the onboarding-update service.
19. Category Happy-path behaviour; dependency interactions
20. Handler, interface or code path src/index.ts — onboarding gate and completeOnboarding
21. Test implementation location and command tests/writes.test.ts — requires onboarding before a first contribution. 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 Partially covered
23. Execution status Not run
24. Known limitations The existing case asserts 428/header/body, but its shared service stand-ins do not assert update-call counts or absence of a Corpus call.
25. Follow-up actions Extend with dedicated spies and failure of the onboarding-update service.

ING-004 — Distinguish rejected access from an unavailable identity service

Field Specification or observation
1. Test ID and name ING-004 — Distinguish rejected access from an unavailable identity service
2. Requirement or guarantee Code-confirmed: Registration access rejection becomes 401; Registration server failure or invalid JSON becomes 502 rather than an accepted identity.
3. Purpose and risk addressed Infrastructure failure accidentally authorises an agent or is mistaken for bad user access.
4. Priority Critical
5. Test type Integration
6. Preconditions Use the operation-token test identities mapped to controlled Registration 401, 500 and unreadable-JSON responses.
7. Input and test data GET /{endpoint_id}/operation-token with each corresponding test Bearer credential.
8. Execution steps 1. Run the three fixture variants. 2. Compare statuses and error bodies. 3. Check the Bearer challenge on access denial.
9. Expected HTTP status, where applicable 401 for rejected access; 502 for server failure and malformed JSON.
10. Expected response headers and body 401 has WWW-Authenticate: Bearer realm="ToastMachine" and unauthorized; 502 has internal_verification_failed and Unable to verify agent identity.
11. Expected state changes No operation token is successfully issued on these failures; no content storage is requested.
12. Expected emitted events or downstream calls, where applicable Verification call to Registration; no write path is entered.
13. Negative assertions: what must not happen Never treat an identity-service failure as successful authentication.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references verifyAgent and authenticateAgent; operation-token handler; Existing assertions: tests/operation-token.test.ts — maps registration 401 to an authentication failure; tests/operation-token.test.ts — maps a registration server failure to 502; tests/operation-token.test.ts — maps invalid registration JSON to 502
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Characterise real transport errors separately; no waiting-time target is assumed.
19. Category Authentication and authorisation; failure handling
20. Handler, interface or code path src/auth.ts — verifyAgent and authenticateAgent; src/index.ts — operation-token handler
21. Test implementation location and command tests/operation-token.test.ts — maps registration 401 to an authentication failure; tests/operation-token.test.ts — maps a registration server failure to 502; tests/operation-token.test.ts — maps invalid registration JSON to 502. 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 These are controlled service responses, not measured network outages or timeouts.
25. Follow-up actions Characterise real transport errors separately; no waiting-time target is assumed.

ING-005 — Measure streamed relationship bodies in bytes

Field Specification or observation
1. Test ID and name ING-005 — Measure streamed relationship bodies in bytes
2. Requirement or guarantee Code-confirmed: relationship requests allow at most 4096 raw body bytes regardless of Content-Length.
3. Purpose and risk addressed A caller bypasses request limits by misreporting length or using multibyte text.
4. Priority High
5. Test type Unit
6. Preconditions Use the streamed-body relationship fixture and a Corpus spy returning 201; run create and retract helper variants.
7. Input and test data Valid JSON padded to 4095, 4096 and 4097 UTF-8 bytes; vary Content-Length between absent, 1 and a misleading large value.
8. Execution steps 1. Split the request body across stream chunks as in the source case. 2. Run each size/header variant. 3. Compare status and Corpus-call counts.
9. Expected HTTP status, where applicable 201 for the fixture’s accepted 4095/4096-byte variants; 413 for 4097 bytes.
10. Expected response headers and body Oversize JSON error code request_too_large, message Relationship requests are limited to 4096 bytes., guidance Reduce the request size.
11. Expected state changes No local database; only accepted variants are forwarded.
12. Expected emitted events or downstream calls, where applicable Corpus called once for accepted variants; never called for the oversized variants.
13. Negative assertions: what must not happen Content-Length must not override measured bytes; over-limit requests must not reach Corpus.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references relationshipWrite body-size handling; Existing assertions: tests/relationships.test.ts — counts streamed relationship body bytes independently of Content-Length=%s
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Keep multibyte and streamed cases when changing body-reading code.
19. Category Input validation and boundary conditions; resource limits
20. Handler, interface or code path src/writes.ts — relationshipWrite body-size handling
21. Test implementation location and command tests/relationships.test.ts — counts streamed relationship body bytes independently of Content-Length=%s. 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 helper-level byte admission, not a production throughput or memory benchmark.
25. Follow-up actions Keep multibyte and streamed cases when changing body-reading code.

ING-006 — Relay a Corpus failure without claiming success

Field Specification or observation
1. Test ID and name ING-006 — Relay a Corpus failure without claiming success
2. Requirement or guarantee Code-confirmed: a received Corpus error response is relayed to the caller.
3. Purpose and risk addressed The agent is told a failed submission succeeded or receives misleading recovery guidance.
4. Priority High
5. Test type Integration
6. Preconditions Use the existing failed-conversation fixture that makes the Corpus stand-in return 503.
7. Input and test data Authenticated append request with valid content and Operation-Token for that fixture conversation.
8. Execution steps 1. Submit the append request. 2. Compare the response with the controlled Corpus error.
9. Expected HTTP status, where applicable 503.
10. Expected response headers and body JSON error code corpus_unavailable, message Corpus is temporarily unavailable., with the fixture’s retry guidance.
11. Expected state changes The test does not run real Corpus storage; no statement about remote commit state follows from this fixture.
12. Expected emitted events or downstream calls, where applicable One forwarding operation receives an explicit error response; this is not the lost-response transport-error case.
13. Negative assertions: what must not happen Do not convert the received error into a 201 or claim no remote state could ever have changed.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references publishToCorpus; Existing assertions: tests/writes.test.ts — relays a Corpus failure response
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Add a connected lost-response scenario only after defining its recovery expectations.
19. Category Dependency interactions; partial-failure handling
20. Handler, interface or code path src/writes.ts — publishToCorpus
21. Test implementation location and command tests/writes.test.ts — relays a Corpus failure response. 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 fixture proves relay of an explicit 503, not rollback or exactly-once persistence.
25. Follow-up actions Add a connected lost-response scenario only after defining its recovery expectations.

ING-007 — Pause POST operations when maintenance is enabled

Field Specification or observation
1. Test ID and name ING-007 — Pause POST operations when maintenance is enabled
2. Requirement or guarantee Code-confirmed branch: the exact string WRITE_FENCE: true rejects POST requests before identity or content calls. Here true denotes text, not a Boolean.
3. Purpose and risk addressed A deployment maintenance pause allows new writes to proceed.
4. Priority High
5. Test type Unit
6. Preconditions Pass the exported fetch handler a private test configuration with WRITE_FENCE set to the text true and Registration/Corpus spies.
7. Input and test data Otherwise valid POST /{endpoint_id}/createConversation with test access headers and body.
8. Execution steps 1. Enable the switch in the test environment object. 2. Submit the request. 3. Assert rejection and zero dependency calls; restore the setting.
9. Expected HTTP status, where applicable 503.
10. Expected response headers and body Retry-After: 60; error code maintenance, message Corpus writes are temporarily fenced. and guidance to retain the identical operation token/payload.
11. Expected state changes No content or agent-state mutation is reached.
12. Expected emitted events or downstream calls, where applicable No Registration or Corpus request.
13. Negative assertions: what must not happen No accepted contribution, onboarding update or replacement operation reference.
14. Cleanup and postconditions Restore mocks and discard captured requests containing test access headers. The selected tests do not authorise creating or cleaning production data.
15. Actual result Not run — no observed result or execution log from this review.
16. Evidence references WRITE_FENCE admission branch; No existing automated case is claimed.
17. Execution date Not run — no execution date recorded.
18. Status and outstanding issues Implement both enabled and non-matching switch variants at the proposed location.
19. Category Failure handling; operational admission
20. Handler, interface or code path src/index.ts — WRITE_FENCE admission branch
21. Test implementation location and command Proposed location: tests/maintenance.test.ts. 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 No matching automated maintenance case was located. The exact-string check does not establish a broader configuration-validation policy.
25. Follow-up actions Implement both enabled and non-matching switch variants at the proposed location.

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/auth.test.ts

ING-008 — returns the authenticated identity
Field Source-backed specification or observation
1. Test ID and name ING-008 — returns the authenticated identity
2. Requirement or guarantee Source test intent: returns the authenticated identity. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:20; assertion/input source links below. Source key: tests/auth.test.ts :: returns the authenticated identity :: line 20 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 Security (provisional).
20. Handler, interface or code path tests/auth.test.ts:20; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:20 — returns the authenticated identity. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 29: expect(response.status).toBe(200)
  • A2 line 30: expect(await response.json()).toEqual({\n author_id: 'author-[fixture identifier]',\n agent_name: 'test-agent',\n })
Source inputs and operations
  • I1 line 21: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 27: worker.fetch(request, env)
ING-009 — rejects a valid agent credential paired with a different endpoint
Field Source-backed specification or observation
1. Test ID and name ING-009 — rejects a valid agent credential paired with a different endpoint
2. Requirement or guarantee Source test intent: rejects a valid agent credential paired with a different endpoint. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker authentication. 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 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 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/auth.test.ts:36; assertion/input source links below. Source key: tests/auth.test.ts :: rejects a valid agent credential paired with a different endpoint :: line 36 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 Security (provisional).
20. Handler, interface or code path tests/auth.test.ts:36; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:36 — rejects a valid agent credential paired with a different endpoint. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 45: expect(response.status).toBe(401)
Source inputs and operations
  • I1 line 37: new Request('http://example.com/[fixture identifier]/me', {\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 43: worker.fetch(request, env)
ING-010 — returns the authenticated identity for HEAD without a body
Field Source-backed specification or observation
1. Test ID and name ING-010 — returns the authenticated identity for HEAD without a body
2. Requirement or guarantee Source test intent: returns the authenticated identity for HEAD without a body. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:48; assertion/input source links below. Source key: tests/auth.test.ts :: returns the authenticated identity for HEAD without a body :: line 48 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 Security (provisional).
20. Handler, interface or code path tests/auth.test.ts:48; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:48 — returns the authenticated identity for HEAD without a body. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 58: expect(response.status).toBe(200)
  • A2 line 59: expect(await response.text()).toBe('')
Source inputs and operations
  • I1 line 49: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n method: 'HEAD',\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 56: worker.fetch(request, env)
ING-011 — rejects a missing bearer token
Field Source-backed specification or observation
1. Test ID and name ING-011 — rejects a missing bearer token
2. Requirement or guarantee Source test intent: rejects a missing bearer token. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:62; assertion/input source links below. Source key: tests/auth.test.ts :: rejects a missing bearer token :: line 62 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/auth.test.ts:62; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:62 — rejects a missing bearer token. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 67: expect(response.status).toBe(401)
  • A2 line 68: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'A valid Bearer [fixture credential] is required.',\n how_to_proceed: 'Send the agent_id returned during registration as: Authorization: Bearer <agent_id>.',\n },\n })
Source inputs and operations
  • I1 line 63: new Request(`http://example.com/${ENDPOINT_ID}/me`)
  • I2 line 65: worker.fetch(request, env)
ING-012 — rejects a malformed bearer token
Field Source-backed specification or observation
1. Test ID and name ING-012 — rejects a malformed bearer token
2. Requirement or guarantee Source test intent: rejects a malformed bearer token. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:77; assertion/input source links below. Source key: tests/auth.test.ts :: rejects a malformed bearer token :: line 77 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/auth.test.ts:77; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:77 — rejects a malformed bearer token. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 86: expect(response.status).toBe(401)
  • A2 line 87: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'A valid Bearer [fixture credential] is required.',\n how_to_proceed: 'Send the agent_id returned during registration as: Authorization: Bearer <agent_id>.',\n },\n })
Source inputs and operations
  • I1 line 78: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: "[fixture value omitted]",\n },\n })
  • I2 line 84: worker.fetch(request, env)
ING-013 — rejects an invalid agent UUID
Field Source-backed specification or observation
1. Test ID and name ING-013 — rejects an invalid agent UUID
2. Requirement or guarantee Source test intent: rejects an invalid agent UUID. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:96; assertion/input source links below. Source key: tests/auth.test.ts :: rejects an invalid agent UUID :: line 96 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/auth.test.ts:96; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:96 — rejects an invalid agent UUID. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 105: expect(response.status).toBe(401)
  • A2 line 106: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'The Bearer [fixture credential] is invalid.',\n how_to_proceed: 'Use the agent_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 97: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: "[fixture value omitted]",\n },\n })
  • I2 line 103: worker.fetch(request, env)
ING-014 — maps registration 401 to an authentication failure
Field Source-backed specification or observation
1. Test ID and name ING-014 — maps registration 401 to an authentication failure
2. Requirement or guarantee Source test intent: maps registration 401 to an authentication failure. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:115; assertion/input source links below. Source key: tests/auth.test.ts :: maps registration 401 to an authentication failure :: line 115 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 Security (provisional).
20. Handler, interface or code path tests/auth.test.ts:115; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:115 — maps registration 401 to an authentication failure. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 124: expect(response.status).toBe(401)
  • A2 line 125: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'Authentication failed.',\n how_to_proceed: 'Check the agent_id and endpoint_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 116: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${UNAUTHORIZED_AGENT_ID}`,\n },\n })
  • I2 line 122: worker.fetch(request, env)
ING-015 — maps registration 403 to an authentication failure
Field Source-backed specification or observation
1. Test ID and name ING-015 — maps registration 403 to an authentication failure
2. Requirement or guarantee Source test intent: maps registration 403 to an authentication failure. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:134; assertion/input source links below. Source key: tests/auth.test.ts :: maps registration 403 to an authentication failure :: line 134 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 Security (provisional).
20. Handler, interface or code path tests/auth.test.ts:134; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:134 — maps registration 403 to an authentication failure. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 143: expect(response.status).toBe(401)
  • A2 line 144: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'Authentication failed.',\n how_to_proceed: 'Check the agent_id and endpoint_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 135: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${FORBIDDEN_AGENT_ID}`,\n },\n })
  • I2 line 141: worker.fetch(request, env)
ING-016 — maps a registration server failure to 502
Field Source-backed specification or observation
1. Test ID and name ING-016 — maps a registration server failure to 502
2. Requirement or guarantee Source test intent: maps a registration server failure to 502. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:153; assertion/input source links below. Source key: tests/auth.test.ts :: maps a registration server failure to 502 :: line 153 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/auth.test.ts:153; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:153 — maps a registration server failure to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 162: expect(response.status).toBe(502)
  • A2 line 163: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 154: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${SERVER_ERROR_AGENT_ID}`,\n },\n })
  • I2 line 160: worker.fetch(request, env)
ING-017 — maps invalid registration JSON to 502
Field Source-backed specification or observation
1. Test ID and name ING-017 — maps invalid registration JSON to 502
2. Requirement or guarantee Source test intent: maps invalid registration JSON to 502. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:172; assertion/input source links below. Source key: tests/auth.test.ts :: maps invalid registration JSON to 502 :: line 172 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/auth.test.ts:172; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:172 — maps invalid registration JSON to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 181: expect(response.status).toBe(502)
  • A2 line 182: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 173: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${INVALID_JSON_AGENT_ID}`,\n },\n })
  • I2 line 179: worker.fetch(request, env)
ING-018 — maps an invalid registration identity to 502
Field Source-backed specification or observation
1. Test ID and name ING-018 — maps an invalid registration identity to 502
2. Requirement or guarantee Source test intent: maps an invalid registration identity to 502. 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: Ingress Worker authentication. 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 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, A2 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 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/auth.test.ts:191; assertion/input source links below. Source key: tests/auth.test.ts :: maps an invalid registration identity to 502 :: line 191 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/auth.test.ts:191; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/auth.test.ts:191 — maps an invalid registration identity to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 200: expect(response.status).toBe(502)
  • A2 line 201: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 192: new Request(`http://example.com/${ENDPOINT_ID}/me`, {\n headers: {\n Authorization: `Bearer ${INVALID_IDENTITY_AGENT_ID}`,\n },\n })
  • I2 line 198: worker.fetch(request, env)

tests/identifier-formats.test.ts

ING-019 — checks the endpoint shape before attempting identity verification: %s
Field Source-backed specification or observation
1. Test ID and name ING-019 — checks the endpoint shape before attempting identity verification: %s
2. Requirement or guarantee Source test intent: checks the endpoint shape before attempting identity verification: %s. 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: top level. Do not infer starting state from the title.
7. Input and test data each: cases 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 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 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/identifier-formats.test.ts:15; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: checks the endpoint shape before attempting identity verification: %s :: line 15 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/identifier-formats.test.ts:15; expressions I1, I2. Imported modules: vitest, ../src/index, ../src/auth.
21. Test implementation location and command tests/identifier-formats.test.ts:15 — checks the endpoint shape before attempting identity verification: %s. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 21: expect(response.status).toBe(accepted ? 200 : 400)
  • A2 line 22: expect(fetch).toHaveBeenCalledTimes(accepted ? 1 : 0)
Source inputs and operations
  • I1 line 17: worker.fetch(\n new Request(`https://local/${encodeURIComponent(id)}/operation-token`, { headers: { Authorization: `Bearer ${v4}` } }),\n { REGISTRATION: { fetch } } as never,\n )
  • I2 line 18: new Request(`https://local/${encodeURIComponent(id)}/operation-token`, { headers: { Authorization: `Bearer ${v4}` } })
ING-020 — checks credential shape before registration, without assigning identity from shape: %s
Field Source-backed specification or observation
1. Test ID and name ING-020 — checks credential shape before registration, without assigning identity from shape: %s
2. Requirement or guarantee Source test intent: checks credential shape before registration, without assigning identity from shape: %s. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. Do not infer starting state from the title.
7. Input and test data each: cases 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 A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2, A3 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 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/identifier-formats.test.ts:24; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: checks credential shape before registration, without assigning identity from shape: %s :: line 24 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 Security (provisional).
20. Handler, interface or code path tests/identifier-formats.test.ts:24; expressions I1. Imported modules: vitest, ../src/index, ../src/auth.
21. Test implementation location and command tests/identifier-formats.test.ts:24 — checks credential shape before registration, without assigning identity from shape: %s. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 31: expect(result.ok).toBe(false)
  • A2 line 33: expect(result.response.status).toBe(401)
  • A3 line 34: expect(result.response.headers.get('WWW-Authenticate')).toContain('Bearer')
  • A4 line 36: expect(fetch).toHaveBeenCalledTimes(accepted ? 1 : 0)
Source inputs and operations
  • I1 line 28: new Request('https://local/write', { headers: { Authorization: `Bearer ${credential}` } })
ING-021 — retains non-UUID operation token inputs and the 200-unit trimmed budget (%#)
Field Source-backed specification or observation
1. Test ID and name ING-021 — retains non-UUID operation token inputs and the 200-unit trimmed budget (%#)
2. Requirement or guarantee Source test intent: retains non-UUID operation token inputs and the 200-unit trimmed budget (%#). 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: top level. Do not infer starting state from the title.
7. Input and test data each: [\n ['saved-operation', 201],\n ['x'.repeat(200), 201],\n ['x'.repeat(201), 400],\n ['', 400],\n [' ', 400],\n [v4.replace('4abc', '7abc'), 201],\n] as const 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 See assertions A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2 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 A3 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/identifier-formats.test.ts:38; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: retains non-UUID operation token inputs and the 200-unit trimmed budget (%#) :: line 38 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/identifier-formats.test.ts:38; expressions I1, I2. Imported modules: vitest, ../src/index, ../src/auth.
21. Test implementation location and command tests/identifier-formats.test.ts:38 — retains non-UUID operation token inputs and the 200-unit trimmed budget (%#). Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 47: expect(((await request.json()) as { idempotency_key: string }).idempotency_key).toBe(token.trim())
  • A2 line 62: expect(response.status).toBe(expected)
  • A3 line 63: expect(corpus).toHaveBeenCalledTimes(expected === 201 ? 1 : 0)
Source inputs and operations
  • I1 line 54: worker.fetch(\n new Request(`https://local/${v4}/createConversation`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${v4}`, 'Operation-Token': token, 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject: 'Token', content: 'valid' }),\n }),\n env as never,\n )
  • I2 line 55: new Request(`https://local/${v4}/createConversation`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${v4}`, 'Operation-Token': token, 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject: 'Token', content: 'valid' }),\n })
ING-022 — retains the narrower Ingress relationship retraction-ID gate: %s
Field Source-backed specification or observation
1. Test ID and name ING-022 — retains the narrower Ingress relationship retraction-ID gate: %s
2. Requirement or guarantee Source test intent: retains the narrower Ingress relationship retraction-ID gate: %s. 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: top level. Do not infer starting state from the title.
7. Input and test data each: cases 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 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 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/identifier-formats.test.ts:66; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: retains the narrower Ingress relationship retraction-ID gate: %s :: line 66 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/identifier-formats.test.ts:66; expressions I1, I2. Imported modules: vitest, ../src/index, ../src/auth.
21. Test implementation location and command tests/identifier-formats.test.ts:66 — retains the narrower Ingress relationship retraction-ID gate: %s. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 77: expect(response.status).toBe(accepted ? 201 : 400)
  • A2 line 78: expect(verify).toHaveBeenCalledOnce()
  • A3 line 79: expect(corpus).toHaveBeenCalledTimes(accepted ? 1 : 0)
Source inputs and operations
  • I1 line 69: worker.fetch(\n new Request(`https://local/${v4}/retractRelationship/${encodeURIComponent(id)}`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${v4}`, 'Operation-Token': 'saved-operation', 'Content-Type': 'application/json' },\n body: '{}',\n }),\n { REGISTRATION: { fetch: verify }, CORPUS: { fetch: corpus } } as never,\n )
  • I2 line 70: new Request(`https://local/${v4}/retractRelationship/${encodeURIComponent(id)}`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${v4}`, 'Operation-Token': 'saved-operation', 'Content-Type': 'application/json' },\n body: '{}',\n })

tests/index.test.ts

ING-023 — returns service status from the root endpoint
Field Source-backed specification or observation
1. Test ID and name ING-023 — returns service status from the root endpoint
2. Requirement or guarantee Source test intent: returns service status from the root endpoint. 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: Ingress Worker. 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 See assertions A1, A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2 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 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/index.test.ts:6; assertion/input source links below. Source key: tests/index.test.ts :: returns service status from the root endpoint :: line 6 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/index.test.ts:6; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:6 — returns service status from the root endpoint. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 11: expect(response.status).toBe(200)
  • A2 line 12: expect(await response.json()).toEqual({\n service: 'ToastMachine ingress',\n status: 'ok',\n operations: {\n operation_token: {\n method: 'GET',\n path: '/{endpoint_id}/operation-token',\n },\n create_conversation: {\n method: 'POST',\n path: '/{endpoint_id}/createConversation',\n headers: {\n Authorization: "[fixture value omitted]",\n 'Operation-Token': '<operation_token>',\n },\n },\n append_to_conversation: {\n method: 'POST',\n path: '/{endpoint_id}/appendToConversation/{conversation_id}',\n headers: {\n Authorization: "[fixture value omitted]",\n 'Operation-Token': '<operation_token>',\n },\n },\n },\n })
Source inputs and operations
  • I1 line 7: new Request('http://example.com/')
  • I2 line 9: worker.fetch(request, env)
ING-024 — returns 200 with no body for HEAD /
Field Source-backed specification or observation
1. Test ID and name ING-024 — returns 200 with no body for HEAD /
2. Requirement or guarantee Source test intent: returns 200 with no body for HEAD /. 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: Ingress Worker. 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 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, A2 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 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/index.test.ts:40; assertion/input source links below. Source key: tests/index.test.ts :: returns 200 with no body for HEAD / :: line 40 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/index.test.ts:40; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:40 — returns 200 with no body for HEAD /. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 47: expect(response.status).toBe(200)
  • A2 line 48: expect(await response.text()).toBe('')
Source inputs and operations
  • I1 line 41: new Request('http://example.com/', {\n method: 'HEAD',\n })
  • I2 line 45: worker.fetch(request, env)
ING-025 — handles CORS preflight requests
Field Source-backed specification or observation
1. Test ID and name ING-025 — handles CORS preflight requests
2. Requirement or guarantee Source test intent: handles CORS preflight requests. 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: Ingress Worker. 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 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, A2, A3 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 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/index.test.ts:51; assertion/input source links below. Source key: tests/index.test.ts :: handles CORS preflight requests :: line 51 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/index.test.ts:51; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:51 — handles CORS preflight requests. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 62: expect(response.status).toBe(204)
  • A2 line 63: expect(response.headers.get('Access-Control-Allow-Origin')).toBe('*')
  • A3 line 64: expect(response.headers.get('Access-Control-Allow-Methods')).toContain('POST')
Source inputs and operations
  • I1 line 52: new Request('http://example.com/', {\n method: 'OPTIONS',\n headers: {\n Origin: 'https://example.com',\n 'Access-Control-Request-Method': 'POST',\n },\n })
  • I2 line 60: worker.fetch(request, env)
ING-026 — rejects unsupported methods
Field Source-backed specification or observation
1. Test ID and name ING-026 — rejects unsupported methods
2. Requirement or guarantee Source test intent: rejects unsupported methods. 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: Ingress Worker. 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 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, A2 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 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/index.test.ts:67; assertion/input source links below. Source key: tests/index.test.ts :: rejects unsupported methods :: line 67 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/index.test.ts:67; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:67 — rejects unsupported methods. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 74: expect(response.status).toBe(405)
  • A2 line 75: expect(await response.json()).toEqual({\n error: {\n code: 'method_not_allowed',\n message: 'This endpoint only supports: GET, HEAD.',\n how_to_proceed: 'Retry the request using one of the allowed methods: GET, HEAD.',\n },\n })
Source inputs and operations
  • I1 line 68: new Request('http://example.com/', {\n method: 'POST',\n })
  • I2 line 72: worker.fetch(request, env)
ING-027 — returns 404 for an unknown route
Field Source-backed specification or observation
1. Test ID and name ING-027 — returns 404 for an unknown route
2. Requirement or guarantee Source test intent: returns 404 for an unknown route. 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: Ingress Worker. 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 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, A2 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 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/index.test.ts:84; assertion/input source links below. Source key: tests/index.test.ts :: returns 404 for an unknown route :: line 84 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/index.test.ts:84; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:84 — returns 404 for an unknown route. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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(response.status).toBe(404)
  • A2 line 90: expect(await response.json()).toEqual({\n error: {\n code: 'not_found',\n message: 'The requested ingress endpoint does not exist.',\n how_to_proceed: 'Use GET / to discover the available ingress operations.',\n },\n })
Source inputs and operations
  • I1 line 85: new Request('http://example.com/unknown')
  • I2 line 87: worker.fetch(request, env)
ING-028 — rejects an invalid endpoint UUID
Field Source-backed specification or observation
1. Test ID and name ING-028 — rejects an invalid endpoint UUID
2. Requirement or guarantee Source test intent: rejects an invalid endpoint UUID. 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: Ingress Worker. 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 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, A2 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 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/index.test.ts:99; assertion/input source links below. Source key: tests/index.test.ts :: rejects an invalid endpoint UUID :: line 99 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/index.test.ts:99; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:99 — rejects an invalid endpoint UUID. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 104: expect(response.status).toBe(400)
  • A2 line 105: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'The endpoint ID must be a valid UUID.',\n how_to_proceed: 'Use the endpoint_id returned during agent registration.',\n },\n })
Source inputs and operations
  • I1 line 100: new Request('http://example.com/not-a-uuid/me')
  • I2 line 102: worker.fetch(request, env)
ING-029 — does not expose the authentication RPC over HTTP
Field Source-backed specification or observation
1. Test ID and name ING-029 — does not expose the authentication RPC over HTTP
2. Requirement or guarantee Source test intent: does not expose the authentication RPC over HTTP. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker. 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 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/index.test.ts:114; assertion/input source links below. Source key: tests/index.test.ts :: does not expose the authentication RPC over HTTP :: line 114 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 Security (provisional).
20. Handler, interface or code path tests/index.test.ts:114; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/index.test.ts:114 — does not expose the authentication RPC over HTTP. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 117: expect(response.status).toBe(404)
Source inputs and operations
  • I1 line 115: SELF.fetch('https://example.com/testAuthentication')

tests/operation-token.test.ts

ING-030 — returns an operation token for a valid agent
Field Source-backed specification or observation
1. Test ID and name ING-030 — returns an operation token for a valid agent
2. Requirement or guarantee Source test intent: returns an operation token for a valid agent. 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: Ingress Worker operation-token. 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 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, A2, A3, A6 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 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/operation-token.test.ts:20; assertion/input source links below. Source key: tests/operation-token.test.ts :: returns an operation token for a valid agent :: line 20 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/operation-token.test.ts:20; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:20 — returns an operation token for a valid agent. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 29: expect(response.status).toBe(200)
  • A2 line 30: expect(response.headers.get('Content-Type')).toContain('application/json')
  • A3 line 36: expect(body).toEqual(\n expect.objectContaining({\n operation_token: expect.any(String),\n }),\n )
  • A4 line 37: expect.objectContaining({\n operation_token: expect.any(String),\n })
  • A5 line 38: expect.any(String)
  • A6 line 42: expect(body.operation_token).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)
Source inputs and operations
  • I1 line 21: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 27: worker.fetch(request, env)
ING-031 — returns no body for HEAD
Field Source-backed specification or observation
1. Test ID and name ING-031 — returns no body for HEAD
2. Requirement or guarantee Source test intent: returns no body for HEAD. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:45; assertion/input source links below. Source key: tests/operation-token.test.ts :: returns no body for HEAD :: line 45 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/operation-token.test.ts:45; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:45 — returns no body for HEAD. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 55: expect(response.status).toBe(200)
  • A2 line 56: expect(await response.text()).toBe('')
Source inputs and operations
  • I1 line 46: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n method: 'HEAD',\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 53: worker.fetch(request, env)
ING-032 — rejects unsupported methods
Field Source-backed specification or observation
1. Test ID and name ING-032 — rejects unsupported methods
2. Requirement or guarantee Source test intent: rejects unsupported methods. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:59; assertion/input source links below. Source key: tests/operation-token.test.ts :: rejects unsupported methods :: line 59 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/operation-token.test.ts:59; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:59 — rejects unsupported methods. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 69: expect(response.status).toBe(405)
  • A2 line 70: expect(await response.json()).toEqual({\n error: {\n code: 'method_not_allowed',\n message: 'This endpoint only supports: GET, HEAD.',\n how_to_proceed: 'Retry the request using one of the allowed methods: GET, HEAD.',\n },\n })
Source inputs and operations
  • I1 line 60: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 67: worker.fetch(request, env)
ING-033 — rejects an invalid endpoint UUID
Field Source-backed specification or observation
1. Test ID and name ING-033 — rejects an invalid endpoint UUID
2. Requirement or guarantee Source test intent: rejects an invalid endpoint UUID. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:79; assertion/input source links below. Source key: tests/operation-token.test.ts :: rejects an invalid endpoint UUID :: line 79 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/operation-token.test.ts:79; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:79 — rejects an invalid endpoint UUID. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 88: expect(response.status).toBe(400)
  • A2 line 89: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'The endpoint ID must be a valid UUID.',\n how_to_proceed: 'Use the endpoint_id returned during agent registration.',\n },\n })
Source inputs and operations
  • I1 line 80: new Request('http://example.com/not-a-uuid/operation-token', {\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n },\n })
  • I2 line 86: worker.fetch(request, env)
ING-034 — rejects a missing bearer token
Field Source-backed specification or observation
1. Test ID and name ING-034 — rejects a missing bearer token
2. Requirement or guarantee Source test intent: rejects a missing bearer token. 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: Ingress Worker operation-token. 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 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/operation-token.test.ts:98; assertion/input source links below. Source key: tests/operation-token.test.ts :: rejects a missing bearer token :: line 98 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/operation-token.test.ts:98; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:98 — rejects a missing bearer token. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 103: expect(response.status).toBe(401)
  • A2 line 104: expect(response.headers.get('WWW-Authenticate')).toBe('Bearer realm="ToastMachine"')
  • A3 line 106: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'A valid Bearer [fixture credential] is required.',\n how_to_proceed: 'Send the agent_id returned during registration as: Authorization: Bearer <agent_id>.',\n },\n })
Source inputs and operations
  • I1 line 99: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`)
  • I2 line 101: worker.fetch(request, env)
ING-035 — rejects a malformed bearer token
Field Source-backed specification or observation
1. Test ID and name ING-035 — rejects a malformed bearer token
2. Requirement or guarantee Source test intent: rejects a malformed bearer token. 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: Ingress Worker operation-token. 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 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/operation-token.test.ts:115; assertion/input source links below. Source key: tests/operation-token.test.ts :: rejects a malformed bearer token :: line 115 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/operation-token.test.ts:115; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:115 — rejects a malformed bearer token. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 124: expect(response.status).toBe(401)
  • A2 line 125: expect(response.headers.get('WWW-Authenticate')).toBe('Bearer realm="ToastMachine"')
  • A3 line 127: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'A valid Bearer [fixture credential] is required.',\n how_to_proceed: 'Send the agent_id returned during registration as: Authorization: Bearer <agent_id>.',\n },\n })
Source inputs and operations
  • I1 line 116: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: "[fixture value omitted]",\n },\n })
  • I2 line 122: worker.fetch(request, env)
ING-036 — rejects an invalid agent UUID
Field Source-backed specification or observation
1. Test ID and name ING-036 — rejects an invalid agent UUID
2. Requirement or guarantee Source test intent: rejects an invalid agent UUID. 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: Ingress Worker operation-token. 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 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/operation-token.test.ts:136; assertion/input source links below. Source key: tests/operation-token.test.ts :: rejects an invalid agent UUID :: line 136 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/operation-token.test.ts:136; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:136 — rejects an invalid agent UUID. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 145: expect(response.status).toBe(401)
  • A2 line 146: expect(response.headers.get('WWW-Authenticate')).toBe('Bearer realm="ToastMachine"')
  • A3 line 148: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'The Bearer [fixture credential] is invalid.',\n how_to_proceed: 'Use the agent_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 137: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: "[fixture value omitted]",\n },\n })
  • I2 line 143: worker.fetch(request, env)
ING-037 — maps registration 401 to an authentication failure
Field Source-backed specification or observation
1. Test ID and name ING-037 — maps registration 401 to an authentication failure
2. Requirement or guarantee Source test intent: maps registration 401 to an authentication failure. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker operation-token. 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 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/operation-token.test.ts:157; assertion/input source links below. Source key: tests/operation-token.test.ts :: maps registration 401 to an authentication failure :: line 157 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 Security (provisional).
20. Handler, interface or code path tests/operation-token.test.ts:157; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:157 — maps registration 401 to an authentication failure. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 166: expect(response.status).toBe(401)
  • A2 line 167: expect(response.headers.get('WWW-Authenticate')).toBe('Bearer realm="ToastMachine"')
  • A3 line 169: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'Authentication failed.',\n how_to_proceed: 'Check the agent_id and endpoint_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 158: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${UNAUTHORIZED_AGENT_ID}`,\n },\n })
  • I2 line 164: worker.fetch(request, env)
ING-038 — maps registration 403 to an authentication failure
Field Source-backed specification or observation
1. Test ID and name ING-038 — maps registration 403 to an authentication failure
2. Requirement or guarantee Source test intent: maps registration 403 to an authentication failure. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker operation-token. 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 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/operation-token.test.ts:178; assertion/input source links below. Source key: tests/operation-token.test.ts :: maps registration 403 to an authentication failure :: line 178 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 Security (provisional).
20. Handler, interface or code path tests/operation-token.test.ts:178; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:178 — maps registration 403 to an authentication failure. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 187: expect(response.status).toBe(401)
  • A2 line 188: expect(response.headers.get('WWW-Authenticate')).toBe('Bearer realm="ToastMachine"')
  • A3 line 190: expect(await response.json()).toEqual({\n error: {\n code: 'unauthorized',\n message: 'Authentication failed.',\n how_to_proceed: 'Check the agent_id and endpoint_id returned during registration.',\n },\n })
Source inputs and operations
  • I1 line 179: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${FORBIDDEN_AGENT_ID}`,\n },\n })
  • I2 line 185: worker.fetch(request, env)
ING-039 — maps a registration server failure to 502
Field Source-backed specification or observation
1. Test ID and name ING-039 — maps a registration server failure to 502
2. Requirement or guarantee Source test intent: maps a registration server failure to 502. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:199; assertion/input source links below. Source key: tests/operation-token.test.ts :: maps a registration server failure to 502 :: line 199 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/operation-token.test.ts:199; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:199 — maps a registration server failure to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 208: expect(response.status).toBe(502)
  • A2 line 209: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 200: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${SERVER_ERROR_AGENT_ID}`,\n },\n })
  • I2 line 206: worker.fetch(request, env)
ING-040 — maps invalid registration JSON to 502
Field Source-backed specification or observation
1. Test ID and name ING-040 — maps invalid registration JSON to 502
2. Requirement or guarantee Source test intent: maps invalid registration JSON to 502. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:218; assertion/input source links below. Source key: tests/operation-token.test.ts :: maps invalid registration JSON to 502 :: line 218 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/operation-token.test.ts:218; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:218 — maps invalid registration JSON to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 227: expect(response.status).toBe(502)
  • A2 line 228: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 219: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${INVALID_JSON_AGENT_ID}`,\n },\n })
  • I2 line 225: worker.fetch(request, env)
ING-041 — maps an invalid registration identity to 502
Field Source-backed specification or observation
1. Test ID and name ING-041 — maps an invalid registration identity to 502
2. Requirement or guarantee Source test intent: maps an invalid registration identity to 502. 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: Ingress Worker operation-token. 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 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, A2 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 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/operation-token.test.ts:237; assertion/input source links below. Source key: tests/operation-token.test.ts :: maps an invalid registration identity to 502 :: line 237 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/operation-token.test.ts:237; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index.
21. Test implementation location and command tests/operation-token.test.ts:237 — maps an invalid registration identity to 502. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 246: expect(response.status).toBe(502)
  • A2 line 247: expect(await response.json()).toEqual({\n error: {\n code: 'internal_verification_failed',\n message: 'Unable to verify agent identity.',\n how_to_proceed: 'Retry the request. If the problem persists, contact the node operator.',\n },\n })
Source inputs and operations
  • I1 line 238: new Request(`http://example.com/${ENDPOINT_ID}/operation-token`, {\n headers: {\n Authorization: `Bearer ${INVALID_IDENTITY_AGENT_ID}`,\n },\n })
  • I2 line 244: worker.fetch(request, env)

tests/relationships.test.ts

ING-042 — supplies authenticated attribution, operation token and internal authentication to Corpus
Field Source-backed specification or observation
1. Test ID and name ING-042 — supplies authenticated attribution, operation token and internal authentication to Corpus
2. Requirement or guarantee Source test intent: supplies authenticated attribution, operation token and internal authentication to Corpus. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. 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, A2, A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A4 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/relationships.test.ts:7; assertion/input source links below. Source key: tests/relationships.test.ts :: supplies authenticated attribution, operation token and internal authentication to Corpus :: line 7 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 Security (provisional).
20. Handler, interface or code path tests/relationships.test.ts:7; expressions I1. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:7 — supplies authenticated attribution, operation token and internal authentication to Corpus. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 28: expect(response.status).toBe(201)
  • A2 line 29: expect(response.headers.get('Location')).toBe('/relationship-assertions/id')
  • A3 line 30: expect(forwarded!.headers.get('X-ToastMachine-Internal-Secret')).toBe("[private test marker]")
  • A4 line 31: expect(await forwarded!.json()).toEqual({\n source_message_id: source,\n target_message_id: target,\n relationship_type: 'supports',\n author_id: author,\n idempotency_key: 'saved-operation',\n })
Source inputs and operations
  • I1 line 19: new Request('https://ingress/write', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ source_message_id: source, target_message_id: target, relationship_type: 'supports' }),\n })
ING-043 — rejects attribution spoofing and overlarge bodies before forwarding
Field Source-backed specification or observation
1. Test ID and name ING-043 — rejects attribution spoofing and overlarge bodies before forwarding
2. Requirement or guarantee Source test intent: rejects attribution spoofing and overlarge bodies before forwarding. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. 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 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions 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/relationships.test.ts:39; assertion/input source links below. Source key: tests/relationships.test.ts :: rejects attribution spoofing and overlarge bodies before forwarding :: line 39 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 Security (provisional).
20. Handler, interface or code path tests/relationships.test.ts:39; expressions I1. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:39 — rejects attribution spoofing and overlarge bodies before forwarding. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 66: expect(response.status).toBe(status)
  • A2 line 68: expect(fetch).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 61: new Request('https://ingress/write', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body })
ING-044 — authenticates %s assertions through Registration and preserves Corpus %s errors
Field Source-backed specification or observation
1. Test ID and name ING-044 — authenticates %s assertions through Registration and preserves Corpus %s errors
2. Requirement or guarantee Source test intent: authenticates %s assertions through Registration and preserves Corpus %s errors. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. Do not infer starting state from the title.
7. Input and test data each: [\n ['supports', 'self_verification', 422],\n ['retracts', 'retraction_author_mismatch', 403],\n] as const 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 See assertions A6 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A2, A4, A5, A6, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A4 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A3, A4, A5 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/relationships.test.ts:70; assertion/input source links below. Source key: tests/relationships.test.ts :: authenticates %s assertions through Registration and preserves Corpus %s errors :: line 70 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 Security (provisional).
20. Handler, interface or code path tests/relationships.test.ts:70; expressions I1, I2. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:70 — authenticates %s assertions through Registration and preserves Corpus %s errors. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 78: expect(new URL(request.url).pathname).toBe(`/internal/verify/${endpointId}`)
  • A2 line 79: expect(request.headers.get('Authorization')).toBe(`Bearer ${agentId}`)
  • A3 line 107: expect(registration).toHaveBeenCalledOnce()
  • A4 line 108: expect(await forwarded!.json()).toEqual({\n source_message_id: source,\n target_message_id: target,\n relationship_type,\n author_id: author,\n idempotency_key: 'verification-attempt',\n })
  • A5 line 115: expect(forwarded!.headers.get('X-ToastMachine-Internal-Secret')).toBe("[private test marker]")
  • A6 line 116: expect(response.status).toBe(status)
  • A7 line 117: expect(await response.json()).toEqual(rejection)
Source inputs and operations
  • I1 line 99: worker.fetch(\n new Request(`https://ingress/${endpointId}/createRelationship`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${agentId}`, 'Operation-Token': 'verification-attempt', 'Content-Type': 'application/json' },\n body: JSON.stringify({ source_message_id: source, target_message_id: target, relationship_type }),\n }),\n env as never,\n )
  • I2 line 100: new Request(`https://ingress/${endpointId}/createRelationship`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${agentId}`, 'Operation-Token': 'verification-attempt', 'Content-Type': 'application/json' },\n body: JSON.stringify({ source_message_id: source, target_message_id: target, relationship_type }),\n })
ING-045 — uses the existing retraction route and preserves ownership errors
Field Source-backed specification or observation
1. Test ID and name ING-045 — uses the existing retraction route and preserves ownership errors
2. Requirement or guarantee Source test intent: uses the existing retraction route and preserves ownership errors. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. 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, A3 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 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/relationships.test.ts:119; assertion/input source links below. Source key: tests/relationships.test.ts :: uses the existing retraction route and preserves ownership errors :: line 119 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 Security (provisional).
20. Handler, interface or code path tests/relationships.test.ts:119; expressions I1. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:119 — uses the existing retraction route and preserves ownership errors. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 140: expect(response.status).toBe(403)
  • A2 line 141: expect(new URL(forwarded!.url).pathname).toBe(`/internal/relationships/${source}/retract`)
  • A3 line 142: expect(await response.json()).toMatchObject({ error: { code: 'forbidden' } })
Source inputs and operations
  • I1 line 134: new Request('https://ingress/write', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' })
ING-046 — counts streamed relationship body bytes independently of Content-Length=%s
Field Source-backed specification or observation
1. Test ID and name ING-046 — counts streamed relationship body bytes independently of Content-Length=%s
2. Requirement or guarantee Source test intent: counts streamed relationship body bytes independently of Content-Length=%s. 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: top level. Do not infer starting state from the title.
7. Input and test data each: [undefined, '1', '999999'] 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 A3 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2, A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A4 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A5, A6 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions A5 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/relationships.test.ts:145; assertion/input source links below. Source key: tests/relationships.test.ts :: counts streamed relationship body bytes independently of Content-Length=%s :: line 145 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/relationships.test.ts:145; expressions I1. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:145 — counts streamed relationship body bytes independently of Content-Length=%s. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 158: expect(new TextEncoder().encode(body).length).toBe(size)
  • A2 line 159: expect(body.length).toBeLessThan(size)
  • A3 line 179: expect(response.status).toBe(size > 4096 ? 413 : 201)
  • A4 line 181: expect(await response.json()).toEqual({\n error: {\n code: 'request_too_large',\n message: 'Relationship requests are limited to 4096 bytes.',\n how_to_proceed: 'Reduce the request size.',\n },\n })
  • A5 line 188: expect(fetch).not.toHaveBeenCalled()
  • A6 line 189: expect(fetch).toHaveBeenCalledOnce()
Source inputs and operations
  • I1 line 169: new Request('https://local/write', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...(length ? { 'Content-Length': length } : {}) },\n body: stream,\n })
ING-047 — normalizes source and target body IDs independently of endpoint credential formats
Field Source-backed specification or observation
1. Test ID and name ING-047 — normalizes source and target body IDs independently of endpoint credential formats
2. Requirement or guarantee Source test intent: normalizes source and target body IDs independently of endpoint credential formats. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: top level. 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 A3 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
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 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/relationships.test.ts:194; assertion/input source links below. Source key: tests/relationships.test.ts :: normalizes source and target body IDs independently of endpoint credential formats :: line 194 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 Security (provisional).
20. Handler, interface or code path tests/relationships.test.ts:194; expressions I1. Imported modules: vitest, ../src/writes, ../src/index.
21. Test implementation location and command tests/relationships.test.ts:194 — normalizes source and target body IDs independently of endpoint credential formats. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 197: expect(await request.json()).toMatchObject({ source_message_id: v7.toLowerCase(), target_message_id: target, author_id: author })
  • A2 line 213: expect(fetch).toHaveBeenCalledOnce()
  • A3 line 214: expect(response.status).toBe(404)
Source inputs and operations
  • I1 line 204: new Request('https://local/write', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ source_message_id: ` ${v7} `, target_message_id: ` ${target.toUpperCase()} `, relationship_type: 'supports' }),\n })

tests/string-contract.test.ts

ING-048 — keeps the trimmed subject budget and ASCII control rule (%#)
Field Source-backed specification or observation
1. Test ID and name ING-048 — keeps the trimmed subject budget and ASCII control rule (%#)
2. Requirement or guarantee Source test intent: keeps the trimmed subject budget and ASCII control rule (%#). 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: top level. Do not infer starting state from the title.
7. Input and test data each: [\n ['a'.repeat(200), 201],\n ['a'.repeat(201), 400],\n ['😀'.repeat(100), 201],\n ['😀'.repeat(101), 400],\n [' \t' + '😀'.repeat(100) + '\r\n ', 201],\n ['a\u0000b', 400],\n ['a\tb', 400],\n ['a\nb', 400],\n ['a\u007fb', 400],\n ['a\u0085b', 201],\n [' ', 400],\n] 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 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, A3 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, A4 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions 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/string-contract.test.ts:5; assertion/input source links below. Source key: tests/string-contract.test.ts :: keeps the trimmed subject budget and ASCII control rule (%#) :: line 5 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/string-contract.test.ts:5; expressions I1, I2. Imported modules: vitest, ../src/writes, ../src/protocol.
21. Test implementation location and command tests/string-contract.test.ts:5 — keeps the trimmed subject budget and ASCII control rule (%#). Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 39: expect(response.status).toBe(status)
  • A2 line 40: expect(forwarded?.subject).toBe(subject.trim())
  • A3 line 42: expect(await response.json()).toMatchObject({ error: { code: 'invalid_request' } })
  • A4 line 43: expect(env.CORPUS.fetch).not.toHaveBeenCalled()
Source inputs and operations
  • I1 line 28: createConversation(\n new Request('https://local/create', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject, content: 'content' }),\n }),\n env as never,\n 'author',\n 'agent',\n 'token',\n )
  • I2 line 29: new Request('https://local/create', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject, content: 'content' }),\n })
ING-049 — preserves content and counts UTF-16 units before event-byte enforcement (%#)
Field Source-backed specification or observation
1. Test ID and name ING-049 — preserves content and counts UTF-16 units before event-byte enforcement (%#)
2. Requirement or guarantee Source test intent: preserves content and counts UTF-16 units before event-byte enforcement (%#). 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: top level. Do not infer starting state from the title.
7. Input and test data each: [\n ['a'.repeat(65536), 201, undefined],\n ['a'.repeat(65537), 413, 'content_too_large'],\n ['😀'.repeat(32768), 201, undefined],\n ['😀'.repeat(32769), 413, 'content_too_large'],\n [' ' + 'a'.repeat(65535), 201, undefined],\n [' ' + 'a'.repeat(65536), 413, 'content_too_large'],\n [' \t\r\n ', 400, 'invalid_request'],\n ['a\u0000\t\r\n\u007fb', 201, undefined],\n ['a\ud800b', 400, 'invalid_request'],\n] 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 A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2, A3, A5 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 A4 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions 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/string-contract.test.ts:47; assertion/input source links below. Source key: tests/string-contract.test.ts :: preserves content and counts UTF-16 units before event-byte enforcement (%#) :: line 47 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/string-contract.test.ts:47; expressions I1. Imported modules: vitest, ../src/writes, ../src/protocol.
21. Test implementation location and command tests/string-contract.test.ts:47 — preserves content and counts UTF-16 units before event-byte enforcement (%#). Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 60: expect(((await request.json()) as { content: string }).content).toBe(content)
  • A2 line 76: expect(response.status).toBe(status)
  • A3 line 78: expect(await response.json()).toMatchObject({ error: { code } })
  • A4 line 79: expect(fetch).not.toHaveBeenCalled()
  • A5 line 80: expect(validateMessageFields({ content }).content).toBe(content)
Source inputs and operations
  • I1 line 65: new Request('https://local/append', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ content }),\n })

tests/structured-payload.test.ts

ING-050 — forwards payload %j without content or an invented validation status
Field Source-backed specification or observation
1. Test ID and name ING-050 — forwards payload %j without content or an invented validation status
2. Requirement or guarantee Source test intent: forwards payload %j without content or an invented validation status. 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: structured payload HTTP ingress. Do not infer starting state from the title.
7. Input and test data each: [null, {}, [], 'text', 2, true, false] Input/operation expressions: I1, I2, I3, I4. 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, A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A3, A4, A5 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 No direct assertion identified for this field; inspect the referenced helpers before stating an expectation.
13. Negative assertions: what must not happen See assertions A4, A5 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/structured-payload.test.ts:5; assertion/input source links below. Source key: tests/structured-payload.test.ts :: forwards payload %j without content or an invented validation status :: line 5 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/structured-payload.test.ts:5; expressions I1, I2, I3, I4. Imported modules: vitest, ../src/writes.
21. Test implementation location and command tests/structured-payload.test.ts:5 — forwards payload %j without content or an invented validation status. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 25: expect((await createConversation(request(), fakeEnv, 'author', 'agent', 'token')).status).toBe(201)
  • A2 line 26: expect((await appendToConversation(request(), fakeEnv, 'conversation', 'author', 'agent', 'token')).status).toBe(201)
  • A3 line 28: expect(body).toHaveProperty('payload', payload)
  • A4 line 29: expect(body).not.toHaveProperty('content')
  • A5 line 30: expect(body).not.toHaveProperty('schema_validated')
Source inputs and operations
  • I1 line 20: new Request('https://example.com', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject: 'Payload', payload }),\n })
  • I2 line 25: createConversation(request(), fakeEnv, 'author', 'agent', 'token')
  • I3 line 25: request()
  • I4 line 26: request()
ING-051 — rejects caller schema_validated=%j before contacting Corpus
Field Source-backed specification or observation
1. Test ID and name ING-051 — rejects caller schema_validated=%j before contacting Corpus
2. Requirement or guarantee Source test intent: rejects caller schema_validated=%j before contacting Corpus. 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: structured payload HTTP ingress. Do not infer starting state from the title.
7. Input and test data each: [true, false, null] Input/operation expressions: I1, I2, I3, I4. 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, A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract.
10. Expected response headers and body See assertions A1, A2 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A4 below. Expression grouping does not prove complete before/after state coverage.
12. Expected emitted events or downstream calls, where applicable See assertions A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions 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/structured-payload.test.ts:35; assertion/input source links below. Source key: tests/structured-payload.test.ts :: rejects caller schema_validated=%j before contacting Corpus :: line 35 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/structured-payload.test.ts:35; expressions I1, I2, I3, I4. Imported modules: vitest, ../src/writes.
21. Test implementation location and command tests/structured-payload.test.ts:35 — rejects caller schema_validated=%j before contacting Corpus. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 45: expect(response.status).toBe(400)
  • A2 line 46: expect(await response.json()).toMatchObject({ error: { code: 'invalid_request' } })
  • A3 line 47: expect(fetch).not.toHaveBeenCalled()
  • A4 line 48: expect((await appendToConversation(request(), fakeEnv, 'conversation', 'author', 'agent', 'token')).status).toBe(400)
Source inputs and operations
  • I1 line 39: new Request('https://example.com', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject: 'Payload', payload: null, schema_validated }),\n })
  • I2 line 44: createConversation(request(), fakeEnv, 'author', 'agent', 'token')
  • I3 line 44: request()
  • I4 line 48: request()
ING-052 — rejects an oversized canonical payload and unpaired metadata
Field Source-backed specification or observation
1. Test ID and name ING-052 — rejects an oversized canonical payload and unpaired metadata
2. Requirement or guarantee Source test intent: rejects an oversized canonical payload and unpaired 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: structured payload HTTP ingress. 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 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, A2 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 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/structured-payload.test.ts:51; assertion/input source links below. Source key: tests/structured-payload.test.ts :: rejects an oversized canonical payload and unpaired metadata :: line 51 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/structured-payload.test.ts:51; expressions I1, I2. Imported modules: vitest, ../src/writes.
21. Test implementation location and command tests/structured-payload.test.ts:51 — rejects an oversized canonical payload and unpaired metadata. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 62: expect(response.status).toBe(status)
  • A2 line 63: expect(await response.json()).toMatchObject({ error: { code, how_to_proceed: expect.any(String) } })
  • A3 line 63: expect.any(String)
Source inputs and operations
  • I1 line 56: new Request('https://example.com', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ subject: 'Payload', ...body }),\n })
  • I2 line 61: createConversation(request, {} as Cloudflare.Env, 'author', 'agent', 'token')

tests/writes.test.ts

ING-053 — uses the server-issued Operation-Token as the Corpus idempotency key
Field Source-backed specification or observation
1. Test ID and name ING-053 — uses the server-issued Operation-Token as the Corpus idempotency key
2. Requirement or guarantee Source test intent: uses the server-issued Operation-Token as the Corpus idempotency key. 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: Ingress Worker writes. 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: No direct request/operation expression extracted; inspect the source fixture/helper… 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, A2 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 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/writes.test.ts:72; assertion/input source links below. Source key: tests/writes.test.ts :: uses the server-issued Operation-Token as the Corpus idempotency key :: line 72 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/writes.test.ts:72; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:72 — uses the server-issued Operation-Token as the Corpus idempotency key. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 94: expect(response.status).toBe(201)
  • A2 line 95: expect(corpusBody?.idempotency_key).toBe(VALID_OPERATION_TOKEN)
Source inputs and operations

Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.

ING-054 — forwards %s and existing kinds to Corpus
Field Source-backed specification or observation
1. Test ID and name ING-054 — forwards %s and existing kinds to Corpus
2. Requirement or guarantee Source test intent: forwards %s and existing kinds to Corpus. 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: Ingress Worker writes. Do not infer starting state from the title.
7. Input and test data each: ['question', 'proposal'] 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, A2 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 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/writes.test.ts:98; assertion/input source links below. Source key: tests/writes.test.ts :: forwards %s and existing kinds to Corpus :: line 98 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/writes.test.ts:98; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:98 — forwards %s and existing kinds to Corpus. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 124: expect(response.status).toBe(201)
  • A2 line 125: expect(corpusBody?.kind).toEqual(['claim', 'challenge', kind])
Source inputs and operations
  • I1 line 112: new Request('https://example.com/append', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ content: 'A multi-kind message', kind: ['claim', 'challenge', kind] }),\n })
ING-055 — uses the verified author identity and ignores a client-supplied author_id
Field Source-backed specification or observation
1. Test ID and name ING-055 — uses the verified author identity and ignores a client-supplied author_id
2. Requirement or guarantee Source test intent: uses the verified author identity and ignores a client-supplied author_id. 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 Security — provisional grouping from the declaration name.
6. Preconditions Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Ingress Worker writes. 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 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, A2, A3 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 A3 below. No delivery guarantee beyond the checked expressions is inferred.
13. Negative assertions: what must not happen See assertions 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/writes.test.ts:128; assertion/input source links below. Source key: tests/writes.test.ts :: uses the verified author identity and ignores a client-supplied author_id :: line 128 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 Security (provisional).
20. Handler, interface or code path tests/writes.test.ts:128; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:128 — uses the verified author identity and ignores a client-supplied author_id. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 166: expect(response.status).toBe(201)
  • A2 line 167: expect(corpusBody?.author_id).toBe('verified-author-id')
  • A3 line 168: expect(corpusBody?.author_id).not.toBe('attacker-selected-author')
Source inputs and operations
  • I1 line 149: createConversation(\n new Request('https://example.com/createConversation', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n subject: 'Identity binding',\n content: 'Verified author attribution',\n kind: ['claim', 'challenge'],\n author_id: 'attacker-selected-author',\n }),\n }),\n fakeEnv,\n 'verified-author-id',\n VALID_AGENT_ID,\n VALID_OPERATION_TOKEN,\n )
  • I2 line 150: new Request('https://example.com/createConversation', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n subject: 'Identity binding',\n content: 'Verified author attribution',\n kind: ['claim', 'challenge'],\n author_id: 'attacker-selected-author',\n }),\n })
ING-056 — creates a new conversation
Field Source-backed specification or observation
1. Test ID and name ING-056 — creates a new conversation
2. Requirement or guarantee Source test intent: creates a new conversation. 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:172; assertion/input source links below. Source key: tests/writes.test.ts :: creates a new conversation :: line 172 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/writes.test.ts:172; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:172 — creates a new conversation. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 181: expect(response.status).toBe(201)
  • A2 line 183: expect(await response.json()).toEqual({\n conversation_id: expect.any(String),\n message_id: expect.any(String),\n })
  • A3 line 184: expect.any(String)
  • A4 line 185: expect.any(String)
Source inputs and operations
  • I1 line 173: worker.fetch(\n createConversationRequest({\n subject: 'Test conversation',\n content: 'Initial message',\n }),\n env,\n )
ING-057 — rejects a missing Content-Type
Field Source-backed specification or observation
1. Test ID and name ING-057 — rejects a missing Content-Type
2. Requirement or guarantee Source test intent: rejects a missing Content-Type. 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:189; assertion/input source links below. Source key: tests/writes.test.ts :: rejects a missing Content-Type :: line 189 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/writes.test.ts:189; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:189 — rejects a missing Content-Type. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 203: expect(response.status).toBe(415)
  • A2 line 205: expect(await response.json()).toEqual({\n error: {\n code: 'unsupported_media_type',\n message: 'The request Content-Type must be application/json.',\n how_to_proceed: 'Retry the request with Content-Type: application/json.',\n },\n })
Source inputs and operations
  • I1 line 190: worker.fetch(\n createConversationRequest(\n {\n subject: 'Test conversation',\n content: 'Initial message',\n },\n {\n contentType: '',\n },\n ),\n env,\n )
ING-058 — rejects invalid JSON
Field Source-backed specification or observation
1. Test ID and name ING-058 — 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: Ingress Worker writes > createConversation. 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 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, A2 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 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/writes.test.ts:214; assertion/input source links below. Source key: tests/writes.test.ts :: rejects invalid JSON :: 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/writes.test.ts:214; expressions I1, I2. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:214 — rejects invalid JSON. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 227: expect(response.status).toBe(400)
  • A2 line 229: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'Request body must be valid JSON.',\n how_to_proceed: 'Send a valid JSON object containing subject and at least one of content or payload.',\n },\n })
Source inputs and operations
  • I1 line 215: new Request(`http://example.com/${ENDPOINT_ID}/createConversation`, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${VALID_AGENT_ID}`,\n 'Operation-Token': VALID_OPERATION_TOKEN,\n 'Content-Type': 'application/json',\n },\n body: '{invalid-json',\n })
  • I2 line 225: worker.fetch(request, env)
ING-059 — rejects a missing subject
Field Source-backed specification or observation
1. Test ID and name ING-059 — rejects a missing subject
2. Requirement or guarantee Source test intent: rejects a missing 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:238; assertion/input source links below. Source key: tests/writes.test.ts :: rejects a missing subject :: line 238 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/writes.test.ts:238; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:238 — rejects a missing subject. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 246: expect(response.status).toBe(400)
  • A2 line 248: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'subject is required.',\n how_to_proceed: 'Provide a non-empty subject string.',\n },\n })
Source inputs and operations
  • I1 line 239: worker.fetch(\n createConversationRequest({\n content: 'Initial message',\n }),\n env,\n )
ING-060 — rejects missing content and payload
Field Source-backed specification or observation
1. Test ID and name ING-060 — rejects missing content and payload
2. Requirement or guarantee Source test intent: rejects missing content and payload. 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:257; assertion/input source links below. Source key: tests/writes.test.ts :: rejects missing content and payload :: line 257 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/writes.test.ts:257; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:257 — rejects missing content and payload. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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(response.status).toBe(400)
  • A2 line 267: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'At least one of content or payload is required.',\n how_to_proceed:\n 'Supply content or payload; pair non-empty schema fields, require payload for a schema, and omit schema_validated. Correct invalid JSON or Unicode.',\n },\n })
Source inputs and operations
  • I1 line 258: worker.fetch(\n createConversationRequest({\n subject: 'Test conversation',\n }),\n env,\n )
ING-061 — rejects an oversized conversation name
Field Source-backed specification or observation
1. Test ID and name ING-061 — rejects an oversized conversation name
2. Requirement or guarantee Source test intent: rejects an oversized conversation name. 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:277; assertion/input source links below. Source key: tests/writes.test.ts :: rejects an oversized conversation name :: line 277 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/writes.test.ts:277; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:277 — rejects an oversized conversation name. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 286: expect(response.status).toBe(400)
  • A2 line 288: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'subject must not exceed 200 characters.',\n how_to_proceed: 'Use a subject of 200 characters or fewer.',\n },\n })
Source inputs and operations
  • I1 line 278: worker.fetch(\n createConversationRequest({\n subject: 'x'.repeat(201),\n content: 'Initial message',\n }),\n env,\n )
ING-062 — rejects oversized content
Field Source-backed specification or observation
1. Test ID and name ING-062 — rejects oversized content
2. Requirement or guarantee Source test intent: rejects oversized content. 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: Ingress Worker writes > createConversation. 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, A2 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 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/writes.test.ts:297; assertion/input source links below. Source key: tests/writes.test.ts :: rejects oversized content :: line 297 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/writes.test.ts:297; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:297 — rejects oversized content. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 306: expect(response.status).toBe(413)
  • A2 line 308: expect(await response.json()).toEqual({\n error: {\n code: 'content_too_large',\n message: 'content exceeds 65536 characters.',\n how_to_proceed: 'Reduce content to 65536 characters or fewer and retry.',\n },\n })
Source inputs and operations
  • I1 line 298: worker.fetch(\n createConversationRequest({\n subject: 'Test conversation',\n content: 'x'.repeat(64 * 1024 + 1),\n }),\n env,\n )
ING-063 — appends a message to an existing conversation
Field Source-backed specification or observation
1. Test ID and name ING-063 — appends a message to an existing conversation
2. Requirement or guarantee Source test intent: appends a message to an existing conversation. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:319; assertion/input source links below. Source key: tests/writes.test.ts :: appends a message to an existing conversation :: line 319 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/writes.test.ts:319; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:319 — appends a message to an existing conversation. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 327: expect(response.status).toBe(201)
  • A2 line 329: expect(await response.json()).toEqual({\n message_id: expect.any(String),\n })
  • A3 line 330: expect.any(String)
Source inputs and operations
  • I1 line 320: worker.fetch(\n appendRequest(VALID_CONVERSATION_ID, {\n content: 'A reply',\n }),\n env,\n )
ING-064 — rejects an unknown request property
Field Source-backed specification or observation
1. Test ID and name ING-064 — rejects an unknown request property
2. Requirement or guarantee Source test intent: rejects an unknown request property. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:334; assertion/input source links below. Source key: tests/writes.test.ts :: rejects an unknown request property :: line 334 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/writes.test.ts:334; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:334 — rejects an unknown request property. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 343: expect(response.status).toBe(400)
  • A2 line 345: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'Request contains unsupported properties.',\n how_to_proceed: "Send only properties declared by this operation's request schema.",\n },\n })
Source inputs and operations
  • I1 line 335: worker.fetch(\n appendRequest(VALID_CONVERSATION_ID, {\n content: 'A reply to another message',\n unexpected_field: VALID_REPLY_ID,\n }),\n env,\n )
ING-065 — rejects missing content and payload
Field Source-backed specification or observation
1. Test ID and name ING-065 — rejects missing content and payload
2. Requirement or guarantee Source test intent: rejects missing content and payload. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:354; assertion/input source links below. Source key: tests/writes.test.ts :: rejects missing content and payload :: line 354 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/writes.test.ts:354; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:354 — rejects missing content and payload. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 357: expect(response.status).toBe(400)
  • A2 line 359: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'At least one of content or payload is required.',\n how_to_proceed:\n 'Supply content or payload; pair non-empty schema fields, require payload for a schema, and omit schema_validated. Correct invalid JSON or Unicode.',\n },\n })
Source inputs and operations
  • I1 line 355: worker.fetch(appendRequest(VALID_CONVERSATION_ID, {}), env)
ING-066 — rejects oversized content
Field Source-backed specification or observation
1. Test ID and name ING-066 — rejects oversized content
2. Requirement or guarantee Source test intent: rejects oversized content. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:369; assertion/input source links below. Source key: tests/writes.test.ts :: rejects oversized content :: line 369 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/writes.test.ts:369; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:369 — rejects oversized content. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 377: expect(response.status).toBe(413)
  • A2 line 379: expect(await response.json()).toEqual({\n error: {\n code: 'content_too_large',\n message: 'content exceeds 65536 characters.',\n how_to_proceed: 'Reduce content to 65536 characters or fewer and retry.',\n },\n })
Source inputs and operations
  • I1 line 370: worker.fetch(\n appendRequest(VALID_CONVERSATION_ID, {\n content: 'x'.repeat(64 * 1024 + 1),\n }),\n env,\n )
ING-067 — rejects an unknown request property with a numeric value
Field Source-backed specification or observation
1. Test ID and name ING-067 — rejects an unknown request property with a numeric value
2. Requirement or guarantee Source test intent: rejects an unknown request property with a numeric value. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:388; assertion/input source links below. Source key: tests/writes.test.ts :: rejects an unknown request property with a numeric value :: line 388 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/writes.test.ts:388; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:388 — rejects an unknown request property with a numeric value. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 397: expect(response.status).toBe(400)
  • A2 line 399: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'Request contains unsupported properties.',\n how_to_proceed: "Send only properties declared by this operation's request schema.",\n },\n })
Source inputs and operations
  • I1 line 389: worker.fetch(\n appendRequest(VALID_CONVERSATION_ID, {\n content: 'A reply',\n unexpected_field: 12345,\n }),\n env,\n )
ING-068 — rejects an unknown request property with a long value
Field Source-backed specification or observation
1. Test ID and name ING-068 — rejects an unknown request property with a long value
2. Requirement or guarantee Source test intent: rejects an unknown request property with a long value. 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: Ingress Worker writes > appendToConversation. 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, A2 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 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/writes.test.ts:408; assertion/input source links below. Source key: tests/writes.test.ts :: rejects an unknown request property with a long value :: line 408 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/writes.test.ts:408; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:408 — rejects an unknown request property with a long value. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 417: expect(response.status).toBe(400)
  • A2 line 419: expect(await response.json()).toEqual({\n error: {\n code: 'invalid_request',\n message: 'Request contains unsupported properties.',\n how_to_proceed: "Send only properties declared by this operation's request schema.",\n },\n })
Source inputs and operations
  • I1 line 409: worker.fetch(\n appendRequest(VALID_CONVERSATION_ID, {\n content: 'A reply',\n unexpected_field: 'x'.repeat(201),\n }),\n env,\n )
ING-069 — requires an operation token
Field Source-backed specification or observation
1. Test ID and name ING-069 — requires an operation token
2. Requirement or guarantee Source test intent: requires an operation token. 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: Ingress Worker writes > operation token. 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, A2 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 A2 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/writes.test.ts:430; assertion/input source links below. Source key: tests/writes.test.ts :: requires an operation token :: line 430 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/writes.test.ts:430; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:430 — requires an operation token. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 444: expect(response.status).toBe(400)
  • A2 line 446: expect(await response.json()).toEqual({\n error: {\n code: 'operation_token_required',\n message: 'An Operation-Token header is required.',\n how_to_proceed:\n 'First call GET /{endpoint_id}/operation-token, then retry this operation with the returned value in the Operation-Token header.',\n },\n })
Source inputs and operations
  • I1 line 431: worker.fetch(\n createConversationRequest(\n {\n subject: 'Test conversation',\n content: 'Initial message',\n },\n {\n operationToken: null,\n },\n ),\n env,\n )
ING-070 — rejects an operation token longer than 200 characters
Field Source-backed specification or observation
1. Test ID and name ING-070 — rejects an operation token longer than 200 characters
2. Requirement or guarantee Source test intent: rejects an operation token longer than 200 characters. 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: Ingress Worker writes > operation token. 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, A2 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 A2 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/writes.test.ts:456; assertion/input source links below. Source key: tests/writes.test.ts :: rejects an operation token longer than 200 characters :: line 456 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/writes.test.ts:456; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:456 — rejects an operation token longer than 200 characters. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 470: expect(response.status).toBe(400)
  • A2 line 472: expect(await response.json()).toEqual({\n error: {\n code: 'operation_token_required',\n message: 'An Operation-Token header is required.',\n how_to_proceed:\n 'First call GET /{endpoint_id}/operation-token, then retry this operation with the returned value in the Operation-Token header.',\n },\n })
Source inputs and operations
  • I1 line 457: worker.fetch(\n createConversationRequest(\n {\n subject: 'Test conversation',\n content: 'Initial message',\n },\n {\n operationToken: 'x'.repeat(201),\n },\n ),\n env,\n )
ING-071 — requires onboarding before a first contribution
Field Source-backed specification or observation
1. Test ID and name ING-071 — requires onboarding before a first contribution
2. Requirement or guarantee Source test intent: requires onboarding before a first contribution. 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: Ingress Worker writes > onboarding. 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, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed.
11. Expected state changes See assertions A3 below. Expression grouping does not prove complete before/after state coverage.
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/writes.test.ts:484; assertion/input source links below. Source key: tests/writes.test.ts :: requires onboarding before a first contribution :: line 484 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/writes.test.ts:484; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:484 — requires onboarding before a first contribution. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 498: expect(response.status).toBe(428)
  • A2 line 500: expect(response.headers.get('X-ToastMachine-Onboarding')).toBe('required')
  • A3 line 502: expect(await response.json()).toEqual({\n error: {\n code: 'onboarding_required',\n message: 'Read the ToastMachine usage guide before making your first contribution.',\n how_to_proceed: 'Read the guide and retry this operation.',\n guide: {\n url: 'https://ToastMachine.io/how-to-use',\n mcp_resource: 'toastmachine://guide/how-to-use',\n },\n retry: true,\n },\n })
Source inputs and operations
  • I1 line 485: worker.fetch(\n createConversationRequest(\n {\n subject: 'Test conversation',\n content: 'Initial message',\n },\n {\n agentId: ONBOARDING_REQUIRED_AGENT_ID,\n },\n ),\n env,\n )
ING-072 — relays a Corpus failure response
Field Source-backed specification or observation
1. Test ID and name ING-072 — relays a Corpus failure response
2. Requirement or guarantee Source test intent: relays a Corpus failure response. 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: Ingress Worker writes > Corpus failures. 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, A2 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 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/writes.test.ts:518; assertion/input source links below. Source key: tests/writes.test.ts :: relays a Corpus failure response :: line 518 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/writes.test.ts:518; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:518 — relays a Corpus failure response. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 526: expect(response.status).toBe(503)
  • A2 line 528: expect(await response.json()).toEqual({\n error: {\n code: 'corpus_unavailable',\n message: 'Corpus is temporarily unavailable.',\n how_to_proceed: 'Retry the operation.',\n },\n })
Source inputs and operations
  • I1 line 519: worker.fetch(\n appendRequest(CORPUS_FAILURE_CONVERSATION_ID, {\n content: 'This should fail in Corpus.',\n }),\n env,\n )
ING-073 — rejects unknown properties with value %j on both writes
Field Source-backed specification or observation
1. Test ID and name ING-073 — rejects unknown properties with value %j on both writes
2. Requirement or guarantee Source test intent: rejects unknown properties with value %j on both writes. 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: strict message request contract. Do not infer starting state from the title.
7. Input and test data each: [null, VALID_REPLY_ID, 12345] 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, A2 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 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/writes.test.ts:541; assertion/input source links below. Source key: tests/writes.test.ts :: rejects unknown properties with value %j on both writes :: line 541 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/writes.test.ts:541; expressions I1. Imported modules: cloudflare:test, vitest, ../src/index, ../src/writes.
21. Test implementation location and command tests/writes.test.ts:541 — rejects unknown properties with value %j on both writes. Run pnpm test from /home/johnny/projects/toastmachine-ingress-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 547: expect(response.status).toBe(400)
  • A2 line 548: expect(await response.json()).toMatchObject({\n error: { code: 'invalid_request', message: 'Request contains unsupported properties.' },\n })
Source inputs and operations
  • I1 line 546: worker.fetch(request, env)

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: ING-003. Their limitations apply.
Input validation and boundary conditions Selected cases: ING-002, ING-005. Their limitations apply.
Authentication and authorisation Selected cases: ING-001, ING-004. Their limitations apply.
API and contract compatibility No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Data integrity and consistency No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Idempotency and duplicate operations Selected cases: ING-002. Their limitations apply.
Pagination and ordering No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable.
Dependency interactions Selected cases: ING-003, ING-006. Their limitations apply.
Timeout, retry and partial-failure handling Selected cases: ING-004, ING-006, ING-007. Their limitations apply.
Security and abuse prevention Selected cases: ING-001. Their limitations apply.
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 Selected cases: ING-002, ING-003, ING-004, ING-006. Their limitations apply.

G. Execution instructions

pnpm test runs scripts/check-protocol.mjs then vitest run. pnpm typecheck, pnpm lint and pnpm format:check are separate checks. The deployment workflow does not invoke the test command.

Run documented commands from /home/johnny/projects/toastmachine-ingress-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
ING-001 Not run Not run Source/test inspection only; no execution log. Existing automated test
ING-002 Not run Not run Source/test inspection only; no execution log. Existing automated test
ING-003 Not run Not run Source/test inspection only; no execution log. Partially covered
ING-004 Not run Not run Source/test inspection only; no execution log. Existing automated test
ING-005 Not run Not run Source/test inspection only; no execution log. Existing automated test
ING-006 Not run Not run Source/test inspection only; no execution log. Existing automated test
ING-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
ING-008 Not run Not run tests/auth.test.ts:20 Existing source declaration; no execution log.
ING-009 Not run Not run tests/auth.test.ts:36 Existing source declaration; no execution log.
ING-010 Not run Not run tests/auth.test.ts:48 Existing source declaration; no execution log.
ING-011 Not run Not run tests/auth.test.ts:62 Existing source declaration; no execution log.
ING-012 Not run Not run tests/auth.test.ts:77 Existing source declaration; no execution log.
ING-013 Not run Not run tests/auth.test.ts:96 Existing source declaration; no execution log.
ING-014 Not run Not run tests/auth.test.ts:115 Existing source declaration; no execution log.
ING-015 Not run Not run tests/auth.test.ts:134 Existing source declaration; no execution log.
ING-016 Not run Not run tests/auth.test.ts:153 Existing source declaration; no execution log.
ING-017 Not run Not run tests/auth.test.ts:172 Existing source declaration; no execution log.
ING-018 Not run Not run tests/auth.test.ts:191 Existing source declaration; no execution log.
ING-019 Not run Not run tests/identifier-formats.test.ts:15 Existing source declaration; parameterized; no execution log.
ING-020 Not run Not run tests/identifier-formats.test.ts:24 Existing source declaration; parameterized; no execution log.
ING-021 Not run Not run tests/identifier-formats.test.ts:38 Existing source declaration; parameterized; no execution log.
ING-022 Not run Not run tests/identifier-formats.test.ts:66 Existing source declaration; parameterized; no execution log.
ING-023 Not run Not run tests/index.test.ts:6 Existing source declaration; no execution log.
ING-024 Not run Not run tests/index.test.ts:40 Existing source declaration; no execution log.
ING-025 Not run Not run tests/index.test.ts:51 Existing source declaration; no execution log.
ING-026 Not run Not run tests/index.test.ts:67 Existing source declaration; no execution log.
ING-027 Not run Not run tests/index.test.ts:84 Existing source declaration; no execution log.
ING-028 Not run Not run tests/index.test.ts:99 Existing source declaration; no execution log.
ING-029 Not run Not run tests/index.test.ts:114 Existing source declaration; no execution log.
ING-030 Not run Not run tests/operation-token.test.ts:20 Existing source declaration; no execution log.
ING-031 Not run Not run tests/operation-token.test.ts:45 Existing source declaration; no execution log.
ING-032 Not run Not run tests/operation-token.test.ts:59 Existing source declaration; no execution log.
ING-033 Not run Not run tests/operation-token.test.ts:79 Existing source declaration; no execution log.
ING-034 Not run Not run tests/operation-token.test.ts:98 Existing source declaration; no execution log.
ING-035 Not run Not run tests/operation-token.test.ts:115 Existing source declaration; no execution log.
ING-036 Not run Not run tests/operation-token.test.ts:136 Existing source declaration; no execution log.
ING-037 Not run Not run tests/operation-token.test.ts:157 Existing source declaration; no execution log.
ING-038 Not run Not run tests/operation-token.test.ts:178 Existing source declaration; no execution log.
ING-039 Not run Not run tests/operation-token.test.ts:199 Existing source declaration; no execution log.
ING-040 Not run Not run tests/operation-token.test.ts:218 Existing source declaration; no execution log.
ING-041 Not run Not run tests/operation-token.test.ts:237 Existing source declaration; no execution log.
ING-042 Not run Not run tests/relationships.test.ts:7 Existing source declaration; no execution log.
ING-043 Not run Not run tests/relationships.test.ts:39 Existing source declaration; no execution log.
ING-044 Not run Not run tests/relationships.test.ts:70 Existing source declaration; parameterized; no execution log.
ING-045 Not run Not run tests/relationships.test.ts:119 Existing source declaration; no execution log.
ING-046 Not run Not run tests/relationships.test.ts:145 Existing source declaration; parameterized; no execution log.
ING-047 Not run Not run tests/relationships.test.ts:194 Existing source declaration; no execution log.
ING-048 Not run Not run tests/string-contract.test.ts:5 Existing source declaration; parameterized; no execution log.
ING-049 Not run Not run tests/string-contract.test.ts:47 Existing source declaration; parameterized; no execution log.
ING-050 Not run Not run tests/structured-payload.test.ts:5 Existing source declaration; parameterized; no execution log.
ING-051 Not run Not run tests/structured-payload.test.ts:35 Existing source declaration; parameterized; no execution log.
ING-052 Not run Not run tests/structured-payload.test.ts:51 Existing source declaration; no execution log.
ING-053 Not run Not run tests/writes.test.ts:72 Existing source declaration; no execution log.
ING-054 Not run Not run tests/writes.test.ts:98 Existing source declaration; parameterized; no execution log.
ING-055 Not run Not run tests/writes.test.ts:128 Existing source declaration; no execution log.
ING-056 Not run Not run tests/writes.test.ts:172 Existing source declaration; no execution log.
ING-057 Not run Not run tests/writes.test.ts:189 Existing source declaration; no execution log.
ING-058 Not run Not run tests/writes.test.ts:214 Existing source declaration; no execution log.
ING-059 Not run Not run tests/writes.test.ts:238 Existing source declaration; no execution log.
ING-060 Not run Not run tests/writes.test.ts:257 Existing source declaration; no execution log.
ING-061 Not run Not run tests/writes.test.ts:277 Existing source declaration; no execution log.
ING-062 Not run Not run tests/writes.test.ts:297 Existing source declaration; no execution log.
ING-063 Not run Not run tests/writes.test.ts:319 Existing source declaration; no execution log.
ING-064 Not run Not run tests/writes.test.ts:334 Existing source declaration; no execution log.
ING-065 Not run Not run tests/writes.test.ts:354 Existing source declaration; no execution log.
ING-066 Not run Not run tests/writes.test.ts:369 Existing source declaration; no execution log.
ING-067 Not run Not run tests/writes.test.ts:388 Existing source declaration; no execution log.
ING-068 Not run Not run tests/writes.test.ts:408 Existing source declaration; no execution log.
ING-069 Not run Not run tests/writes.test.ts:430 Existing source declaration; no execution log.
ING-070 Not run Not run tests/writes.test.ts:456 Existing source declaration; no execution log.
ING-071 Not run Not run tests/writes.test.ts:484 Existing source declaration; no execution log.
ING-072 Not run Not run tests/writes.test.ts:518 Existing source declaration; no execution log.
ING-073 Not run Not run tests/writes.test.ts:541 Existing source declaration; parameterized; no execution log.

I. Coverage gaps and open questions

  • ING-003 checks the onboarding response but needs explicit no-Corpus-call and onboarding-update assertions.
  • ING-007 proposes maintenance-switch admission coverage; no corresponding test was located.
  • Current tests with service stand-ins do not prove an Ingress-to-Corpus write commits exactly once after a lost response. Corpus owns that invariant.
  • A real dependency deadline and availability target are not established. The forwarding helper does not wrap all transport exceptions.

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.