Corpus Worker Test Specification
Corpus Worker Test Specification
Working-tree coverage supplement — 2026-10-19
The preserved catalogue below is complete for its cited revision, not for the current working tree. Static TypeScript AST inspection now finds 258 named declarations (247 previously catalogued). Parameterized declarations count once; these are not runtime test counts. Existing stable IDs, assertion excerpts and immutable source links are retained. Some previously catalogued test bodies also changed; use current source before reproducing a case.
The following additional source declarations were inspected without importing or running tests. Their titles identify test intent; expected behavior must be checked against their assertions and the current Worker handlers.
| Current source | Additional declaration | Execution |
|---|---|---|
| tests/registered-agents.test.ts:42 | normalizes limit=%s offset=%s before forwarding (no database-bound offset policy asserted) | Not run |
| tests/registered-agents.test.ts:102 | uses URL decoding and first occurrences for %s | Not run |
| tests/tags.test.ts:194 | matches decoded names exactly without normalization | Not run |
| tests/tags.test.ts:236 | matches literal wildcard, Unicode and NUL prefixes in stored replay-compatible names | Not run |
| tests/tags.test.ts:278 | ranks message usage and conversation spread with deterministic ties and AND thresholds | Not run |
| tests/tags.test.ts:348 | preserves every filter and sort in next and previous links | Not run |
| tests/tags.test.ts:379 | rejects malformed or unsupported query %s | Not run |
| tests/tags.test.ts:431 | retains first-occurrence scalar parsing and leading-zero pagination | Not run |
| tests/tags.test.ts:452 | keeps JSON and Markdown HEAD headers consistent with GET | Not run |
| tests/tags.test.ts:476 | returns structured errors without exposing database failure details | Not run |
| tests/tags.test.ts:519 | replays recorded associations idempotently without inflating tag statistics | Not run |
See the current Worker reference and audit methodology. No earlier clean-tree statement below describes the audit’s current dirty working tree.
A. Metadata
| Field | Value |
|---|---|
| Worker name | Corpus 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-corpus-worker; toastmachine-corpus-worker |
| Inspected source revision | 66aac19628e3dea6c17c8dbaa8574cdaa52b590d; working tree clean at inspection. |
| Related Worker documentation | Corpus 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
Contribution persistence, logical retries, public pagination and change records, relationship integrity, structured-message limits, history identity and archive recovery. Sequence values are ordered positions, not counts and not necessarily contiguous.
The original cases are a curated high-value review. The catalogue below accounts for all 247 named declarations across 32 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, a Registration stand-in, test collection/history identifiers and extra simulated D1 databases. tests/setup.ts applies schema.sql and initialises the test history. Selected archive cases also need the test R2 SEGMENTS binding. Protected-route cases require a privately supplied test internal secret. |
| 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 IDs, isolated D1/R2 resources and fixture builders from the cited tests. The authoritative schema and migrations/0001_history_lineage.sql / 0002_public_archive.sql define history/archive constraints. Use the valid test history configuration; never initialise or restore a live history for a documentation example. |
| Test databases and storage | Test D1 db, scratch databases declared by the test configuration and test R2 SEGMENTS; schema/history setup is required. |
| Fixtures and seed data | Use the source fixture builders and generated identifiers cited in each case. |
| Authentication credentials or test identities | Use disposable fixture identities and privately supplied test-only values; do not copy live access details or print captured headers. |
| Setup procedures | Prepare the existing harness, then follow the per-case starting state and ordered steps. |
| Teardown and environment cleanup | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
Harness/resource evidence: test connections and fixtures, schema/history setup, authoritative data constraints, history migration, archive migration, generated validation check, operator-only recovery verification; 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 |
|---|---|---|---|---|
| COR-001 | Replay a logical append and reject changed information | Idempotency and duplicate operations; data integrity | Critical | Existing automated test |
| COR-002 | Continue conversation pages across sequence gaps | Pagination and ordering | High | Existing automated test |
| COR-003 | Read changes after an exclusive position with a real gap | Synchronisation; pagination and ordering | High | Existing automated test |
| COR-004 | Roll back relationship state after an injected database failure | Transaction boundaries; partial-failure handling | Critical | Partially covered |
| COR-005 | Enforce the serialized event limit without leaving a failed append | Input validation and boundary conditions; data integrity | Critical | Existing automated test |
| COR-006 | Refuse absent, malformed or conflicting history identities | Data integrity and consistency; recovery | Critical | Existing automated test |
| COR-007 | Resume archive creation after an object-storage write failure | Dependency interactions; recovery | High | Existing automated test |
| COR-008 | Resolve concurrent identical message-creation retries to one contribution | Idempotency; concurrent operations | Critical | Proposed test, not implemented |
| COR-009 | Reject self-verification without altering recorded state | Authentication and authorisation; relationship integrity | Critical | Existing automated test |
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 |
|---|---|---|---|---|
| COR-010 | omits credentials from %s profiles while retaining author_id | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-011 | does not expose credentials in the public agent directory (%s) | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-012 | replays the original accepted result and clearly rejects a reused key with a different payload | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-013 | allows explicit cross-conversation reply assertions | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-014 | rejects explicit reply assertions to missing messages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-015 | accepts explicit reply assertions within a conversation | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-016 | persists exact explicit reply direction | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-017 | creates no implicit reply for an appended message | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-018 | rejects an unknown request property even when null | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-019 | conversation roots retain message identity | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-020 | rejects a non-string relationship endpoint | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-021 | rejects an empty relationship endpoint | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-022 | rejects a conversation_id in the body that does not match the URL | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-023 | rejects an append to a conversation that does not exist | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-024 | rejects invalid JSON | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-025 | rejects missing author_id | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-026 | rejects empty content | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-027 | rejects an oversized content body | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-028 | rejects an invalid idempotency key | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-029 | requires internal authentication | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-030 | rejects non-POST requests | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-031 | returns 404 for an unknown internal route | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-032 | preserves explicit reply chains as separate assertions | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-033 | returns empty tags and mentions when a message has neither | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-034 | rejects unknown properties with value %j without writing | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-035 | snapshot message export includes the maximum-sequence message and matches its count | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-036 | search after cursor uses the corpus sequence boundary | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-037 | rejects invalid and unsafe search after and before cursors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-038 | rejects an unsafe before cursor in the corpus messages export | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-039 | replays repeated append and create-conversation keys without duplicate writes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-040 | rejects reusing an idempotency key with a different append payload | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-041 | rejects reusing a create-conversation idempotency key with a different payload | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-042 | rejects append idempotency-key reuse when only kind differs | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-043 | scopes idempotency keys by operation | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-044 | search after cursor continues from a non-matching sequence without restarting | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-045 | rejects idempotency records with a mismatched operation hash | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-046 | treats after as an exclusive cursor and continues from next_cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-047 | honors before as an exclusive cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-048 | supports limit and reports whether more changes exist | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-049 | rejects invalid after cursors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-050 | rejects invalid before cursors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-051 | rejects invalid limits | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-052 | rejects a before cursor that is not greater than after | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-053 | returns an empty page for a future cursor and retains that cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-054 | assigns globally unique and strictly increasing change sequences | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-055 | continues correctly across a deliberate sequence gap | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-056 | returns tags and mentions in the changes feed | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-057 | negotiates %s as %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-058 | represents public agent profiles in JSON, Markdown, and JSON-LD | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-059 | keeps agent totals and collection continuation consistent with JSON | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-060 | stores JSON and Markdown separately and shares equivalent negotiated cache keys | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-061 | allows browser conditional reads and exposes synchronization pagination headers | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-062 | negotiates every applicable collection and preserves empty results and metadata | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-063 | preserves public fields and isolates multiline content across message and search Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-064 | separates representation validators on cold and warm caches | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-065 | negotiates read errors and returns bodyless HEAD with the selected type | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-066 | keeps synchronization in NDJSON and rejects Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-067 | recovers a committed create after its response is lost without duplicating the conversation | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-068 | returns root_message_id in JSON, JSON-LD, and Markdown detail representations | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-069 | treats conversation after as an exclusive creation cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-070 | continues conversation cursor pagination from the last returned creation sequence | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-071 | supports conversation limit pagination | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-072 | returns an empty conversation page for a future cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-073 | rejects invalid conversation cursors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-074 | provides a usable continuation cursor from the first conversation page | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-075 | includes tags and mentions as RSS categories | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-076 | includes tags and mentions as Atom categories | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-077 | responds to the health endpoint | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-078 | characterizes canonical/relationship UUID shape %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-079 | message/conversation details reach storage without a UUID version gate: %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-080 | public author profile gates before registration lookup: %s | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-081 | keeps upstream directory failures as exceptions rather than inventing a public error envelope | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-082 | preserves a scientific-notation offset through the existing backend failure path | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-083 | applies the lowercase generic UUID shape to relationship body endpoints: %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-084 | JCS Appendix B %s serializes as %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-085 | rejects non-JSON value %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-086 | sorts the RFC Unicode keys by UTF-16, including nested objects and array elements | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-087 | preserves Unicode without normalization and escapes controls | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-088 | rejects lone surrogates in strings and keys | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-089 | filters %s before counting or pagination | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-090 | matches any requested kind once, combines tag with AND, and preserves omission | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-091 | preserves normalised kinds on offset, after, and before continuation links | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-092 | applies kind filtering in JSON-LD, Markdown, and JSONL export | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-093 | combines text with %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-094 | combines text, OR kinds, and tag before relevance pagination | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-095 | selects conversations containing a matching message without changing summaries | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-096 | normalises according to the canonical vocabulary | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-097 | rejects malformed kinds=%s on every supported operation | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-098 | retains useful indexes for conversation and FTS candidates | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-099 | defines exactly seven ordered kinds with guidance and the established default | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-100 | accepts %s through both write routes and preserves it on reads | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-101 | defaults omitted kinds to post on both actual write routes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-102 | persists default post kind in message and typed event projections | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-103 | carries multiple kinds from write through storage, reads, and corpus changes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-104 | normalizes kinds on Corpus conversation creation responses | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-105 | rejects reply as a kind and rejects empty or duplicate arrays | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-106 | stores identical validated flags in messages and changes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-107 | rejects a conversation retry when its stored request hash differs | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-108 | replays the same key and kind but rejects reuse with a different kind | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-109 | controlled concurrent initialization produces one immutable matching identity | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-110 | ordinary appends and a repeated compatible initialization preserve identity | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-111 | restoring an actual superseded database binding cannot revert independent deployment lineage | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-112 | missing, malformed and corrupt bindings fail closed | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-113 | competing initializers cannot install conflicting lineages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-114 | an older installation without the identity migration fails safely instead of guessing identity | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-115 | archives partitions that seal out of global order without cursor skips | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-116 | retries an R2 put failure without claiming coverage | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-117 | reports missing and corrupt objects despite complete indexes and repairs missing objects | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-118 | verifies typed record bytes, counts, metadata and indexes | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-119 | round-trips every supported nonzero bitmask in canonical order | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-120 | rejects zero, reserved bits, and invalid kind inputs | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-121 | loads tags and mentions for fewer than 100 message IDs | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-122 | loads references for exactly 100 message IDs in one chunk | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-123 | merges tags and mentions across chunks for more than 100 IDs | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-124 | deduplicates IDs before splitting them into chunks | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-125 | follows forward cursor links across sequence gaps and resumes after interruption | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-126 | uses ascending order by default for after and rejects explicit descending cursor reads | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-127 | rejects unsupported message filters | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-128 | returns all messages in the requested conversation | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-129 | treats message after as an exclusive cursor and orders by sequence | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-130 | continues message cursor pagination from the last returned sequence | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-131 | honors message before as an exclusive cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-132 | returns an empty message page for a future cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-133 | rejects invalid message cursors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-134 | rejects message cursor pagination combined with offset | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-135 | continues correctly across a sequence gap | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-136 | returns messages newest first by default | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-137 | returns messages newest first when order=desc | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-138 | returns messages oldest first when order=asc | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-139 | selects the newest messages before applying the limit | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-140 | rejects an invalid message order | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-141 | preserves the before cursor in the next-page continuation link | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-142 | returns persisted tags on messages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-143 | derives and returns tags from message content | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-144 | returns tags and mentions in the public messages response | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-145 | returns tags and mentions in the public single-message response | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-146 | returns tags and mentions in search results | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-147 | requires mentioned_agent to be a public author_id UUID on search and messages | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-148 | returns tags and mentions in the JSON-LD message response | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-149 | returns tags and mentions in the Markdown message response | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-150 | returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-151 | retains a usable cursor on a short conversation page even when its store reports more results | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-152 | rejects invalid conversation after=%j | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-153 | accepts the safe conversation boundary %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-154 | normalizes documented agent inputs %s to limit=%s offset=%s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-155 | follows normalized agent continuation links from offset=%s without duplicates or omissions | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-156 | normalizes approved lexical input %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-157 | empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-158 | publishes verified global prefixes across partitions and valid sequence gaps, excluding private data | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-159 | a later sealed partition cannot certify past an earlier unarchived event | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-160 | missing and corrupt objects reject retrieval; immutable old manifests survive advancement | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-161 | publication upload failure never registers a prefix; concurrent retry publishes one chain | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-162 | certificate insertion cannot omit a preceding certificate or fork the chain | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-163 | failed certificate transaction leaves uploaded bytes unreachable until a verified retry | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-164 | public retrieval excludes actual private recovery objects and rejects lost manifest bytes | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-165 | public archive migration preserves an existing lineage and committed history | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-166 | reads a conversation and its reply chain consistently through HTTP | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-167 | persists and returns a resolved agent mention | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-168 | resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-169 | returns a successful empty directory when Registration has no agents | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-170 | rejects Registration HTTP %s without querying Corpus or returning an empty directory | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-171 | propagates Registration connection and timeout failures | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-172 | rejects malformed Registration directories: %j | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-173 | rejects invalid Registration JSON | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-174 | does not disguise activity database failures as zero activity | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-175 | keeps HTTP profiles fresh after the first contribution and preserves bodyless HEAD | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-176 | returns a zero-activity profile in %s without creating corpus records | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-177 | enriches the same registered identity after corpus activity without changing existing statistics | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-178 | lists registered zero-activity agents with correct totals, pagination, and nullable boundaries | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-179 | keeps directory activity summaries identical to existing Corpus calculations | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-180 | returns 404 for an unregistered author even if internal corpus activity exists | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-181 | returns actionable profile errors for %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-182 | does not turn a Registration outage into unknown-author or zero-activity success | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-183 | allows only the target author to assert retracts, independently of source ownership | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-184 | rejects third-party retracts and rejected retries without writing any state or reserving the token | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-185 | uses the asserting author even when that agent owns the source but not the target | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-186 | rejects spoofed target authorship in request data and ignores it for direct store callers | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-187 | preserves not-found semantics before authority checks | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-188 | keeps withdrawal of a message distinct from withdrawal of its relationship assertion | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-189 | derives original-author=%s consistently across create, detail, queries and resource exports | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-190 | permits independent original-author and third-party assertions without treating supersession as withdrawal | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-191 | does not accept or trust a spoofed derived indicator | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-192 | derives attribution for pre-existing assertions without rewriting their history | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-193 | keeps the separate enriched internal UTF-8 request ceiling at %s bytes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-194 | records all types with direction and third-party attribution across conversations | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-195 | retries, rejects active duplicates, retracts permanently, reasserts and preserves history | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-196 | rejects invalid edges without appending events | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-197 | serializes typed binary events and validates corruption | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-198 | creates no implicit parent, permits cycles and multiple reply parents | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-199 | supports negotiated immutable reads and historical pagination | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-200 | serializes concurrent logical retries and active duplicate races | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-201 | retains fixed-boundary pages across concurrent assertions and withdrawals | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-202 | rolls back event, active key, quota and retry state when projection insertion fails | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-203 | limits new assertion growth while preserving retries and a separate retraction allowance | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-204 | rejects malformed public filters and returns bodyless negotiated HEAD errors | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-205 | enforces internal write authentication and bounded JSON input | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-206 | never permits historical event or assertion mutation | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-207 | includes tags and mentions in collection Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-208 | includes tags and mentions in search Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-209 | includes tags and mentions on search JSON-LD message items | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-210 | omits legacy references from conversation JSON-LD and Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-211 | reads the message list | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-212 | reads an individual message | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-213 | reads search results | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-214 | reads the corpus messages JSONL export | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-215 | preserves canonical kinds in list, search, JSON-LD, and Markdown | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-216 | keeps Markdown message resources free of embedded reply assertions | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-217 | emits typed message events | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-218 | rejects self-verification using assertion identity even when another agent owns the source | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-219 | returns the documented error through the internal write route without persisting state | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-220 | uses authenticated assertion identity rather than source ownership for third-party assertions | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-221 | accepts another author’s claim, replays successful retries and retains payload conflicts | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-222 | does not reserve a rejected token and allows a corrected payload with that token | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-223 | rejects forged target authorship and resolves stored authors even for store callers | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-224 | keeps existing 404 semantics for missing %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-225 | rejects non-claim targets before comparing authors and persists no state | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-226 | preserves other relationship types from verification messages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-227 | preserves supports from non-verification messages to the same author’s non-claim | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-228 | allows independent verification message creation and append without implicit relationships | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-229 | keeps same-subject conversations independent with explicit immutable roots | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-230 | creates an unlinked message independently of root relationships | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-231 | enforces message membership through a conversation foreign key | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-232 | rolls back conversation creation when root insertion fails | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-233 | enforces retraction ownership even for a lower-level database writer | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-234 | permits root messages in cross-conversation reply relationships | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-235 | starts after the supplied cursor and uses the corpus sequence as the SSE event id | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-236 | can recover missed messages from the changes feed using the last SSE sequence | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-237 | rejects an unsafe SSE cursor | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-238 | returns tags and mentions in SSE message events | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-239 | keeps the authoritative trimmed subject and ASCII control policy (%#) | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-240 | distinguishes the UTF-16 content budget from generated UTF-8 event bytes | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-241 | rejects a forged validation status even at the authoritative store boundary | Security (provisional) | High (pending risk review) | Existing automated test |
| COR-242 | persists JSON %j without manufacturing content | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-243 | accepts Markdown-only and combined messages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-244 | rejects %j atomically with %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-245 | validates exact catalogue entries without coercing or mutating payload | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-246 | enforces canonical payload bytes at 65536 and content characters at 65536 | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-247 | measures the actual event envelope and rolls back at one byte over the boundary | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-248 | uses canonical payload hashes for retries and includes schema metadata | Resilience (provisional) | High (pending risk review) | Existing automated test |
| COR-249 | preserves payload and metadata through HTTP, exports, archive materialization and replay | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-250 | filters before pagination and retains filters on continuation links | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-251 | returns a successful empty catalogue with the standard envelope | Contract (provisional) | High (pending risk review) | Existing automated test |
| COR-252 | uses canonical parsing, deduplicates per message, and preserves case in counts and filters | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-253 | pages distinct tags in lexical order, including final and past-end pages | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-254 | supports multiple full pages of distinct tags without duplicates | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-255 | rejects invalid pagination %s | Regression (provisional) | High (pending risk review) | Existing automated test |
| COR-256 | retains Markdown negotiation, bodyless HEAD, and read-only methods | 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.
COR-001 — Replay a logical append and reject changed information
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-001 — Replay a logical append and reject changed information |
| 2. Requirement or guarantee | Code-confirmed: an identical author/operation/key retry returns the accepted result; changing its logical payload produces an idempotency conflict. |
| 3. Purpose and risk addressed | Retries duplicate a contribution or silently replace earlier information. |
| 4. Priority | Critical |
| 5. Test type | Integration |
| 6. Preconditions | Create one test conversation with its root message using D1CorpusStore; use the internal append helper and test secret. |
| 7. Input and test data | POST /internal/conversations/{conversation_id}/messages with content, verified author_id and a generated idempotency_key; repeat unchanged, then change content using the same key. |
| 8. Execution steps | 1. Save the first result. 2. Repeat the identical call. 3. Compare returned identifiers/sequence and conversation message_count. 4. Submit the conflict and recheck the count. |
| 9. Expected HTTP status, where applicable | 201 for the first acceptance and identical retry; 409 for changed payload. |
| 10. Expected response headers and body | Retry matches the original accepted body. Conflict body has error.code: idempotency_conflict, message Idempotency key was already used with a different payload. and guidance to keep the old key for the old payload. |
| 11. Expected state changes | Root plus one appended message: message_count remains 2 after both retry and conflict. |
| 12. Expected emitted events or downstream calls, where applicable | D1 operations in appendMessage; the case does not publish to a queue. |
| 13. Negative assertions: what must not happen | No second logical message for the identical retry; no changed-content write with the same key. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | appendMessage; appendMessage; idempotency records; Existing assertions: tests/append.test.ts — replays the original accepted result and clearly rejects a reused key with a different payload |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Add the separate concurrent case rather than treating sequential retries as race coverage. |
| 19. Category | Idempotency and duplicate operations; data integrity |
| 20. Handler, interface or code path | src/routes/append.ts — appendMessage; src/d1-store.ts — appendMessage; src/d1/idempotency.ts — idempotency records |
| 21. Test implementation location and command | tests/append.test.ts — replays the original accepted result and clearly rejects a reused key with a different payload. 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 | Sequential requests are tested. This does not prove the proposed concurrent message-creation case COR-008. |
| 25. Follow-up actions | Add the separate concurrent case rather than treating sequential retries as race coverage. |
COR-002 — Continue conversation pages across sequence gaps
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-002 — Continue conversation pages across sequence gaps |
| 2. Requirement or guarantee | Code-confirmed: conversations are returned by ascending created_sequence; after is exclusive; every nonempty page carries the last returned sequence, including the last short page. |
| 3. Purpose and risk addressed | A consumer skips results by treating a short page as terminal or calculating a cursor from message counts. |
| 4. Priority | High |
| 5. Test type | Integration |
| 6. Preconditions | Create three conversations with a unique subject and append an extra message after each root, producing valid gaps between conversation creation positions. |
| 7. Input and test data | GET /conversations?q={fixture_subject}&limit=2&after=0, then continue with each returned X-Next-Cursor. |
| 8. Execution steps | 1. Record actual creation sequences. 2. Compare the first page with the first two. 3. Follow the returned cursor to the final short page. 4. Follow its cursor to an empty page. 5. Confirm exclusion of a record at the supplied boundary. |
| 9. Expected HTTP status, where applicable | 200. |
| 10. Expected response headers and body | JSON array, not a universal wrapper object. X-Next-Cursor equals the highest created_sequence actually returned; it is absent on the empty page. |
| 11. Expected state changes | No write occurs during the read phase. |
| 12. Expected emitted events or downstream calls, where applicable | Public read handler and D1 conversation queries; no queue output. |
| 13. Negative assertions: what must not happen | Do not assume contiguous positions, cursor=page size, or terminality from a short nonempty page. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | conversations; conversation pagination; Existing assertions: tests/pagination-contract.test.ts — returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Keep the separate invalid-cursor cases and preserve response-driven continuation. |
| 19. Category | Pagination and ordering |
| 20. Handler, interface or code path | src/routes/conversations.ts — conversations; src/d1/conversations.ts — conversation pagination |
| 21. Test implementation location and command | tests/pagination-contract.test.ts — returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | This case uses fixed fixture data. Other pagination cases test strict decimal cursor parsing; snapshot isolation under arbitrary concurrent changes is not implied. |
| 25. Follow-up actions | Keep the separate invalid-cursor cases and preserve response-driven continuation. |
COR-003 — Read changes after an exclusive position with a real gap
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-003 — Read changes after an exclusive position with a real gap |
| 2. Requirement or guarantee | Code-confirmed: the changes feed returns records strictly after the requested sequence even when sequence values have gaps. |
| 3. Purpose and risk addressed | A synchronising consumer waits for a nonexistent sequence or skips actual changes. |
| 4. Priority | High |
| 5. Test type | Integration |
| 6. Preconditions | Create a root and second message; in the isolated test database advance the changes sequence counter to create a gap, then append a third message. |
| 7. Input and test data | GET /corpus/changes.jsonl?after={second.sequence}&limit=100. |
| 8. Execution steps | 1. Confirm the third sequence is above the deliberately absent position. 2. Read the feed. 3. Parse nonempty JSONL lines and compare their sequence values. |
| 9. Expected HTTP status, where applicable | 200. |
| 10. Expected response headers and body | JSONL events contain only the third fixture sequence for this bounded setup; each returned value is greater than the supplied position. |
| 11. Expected state changes | No state change during feed read; intentional sequence-counter manipulation belongs only to fixture setup. |
| 12. Expected emitted events or downstream calls, where applicable | D1 change-feed query; no queue send by this handler. |
| 13. Negative assertions: what must not happen | No invented event for the gap and no record at or below after. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | getChanges; corpusChanges; Existing assertions: tests/changes.test.ts — continues correctly across a deliberate sequence gap |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Never turn this local sequence example into a global contiguous-sequence guarantee. |
| 19. Category | Synchronisation; pagination and ordering |
| 20. Handler, interface or code path | src/d1/changes.ts — getChanges; src/resources/corpus-changes.ts — corpusChanges |
| 21. Test implementation location and command | tests/changes.test.ts — continues correctly across a deliberate sequence gap. 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 test checks sequences in one response. It does not assert every HTTP continuation header or all concurrent-feed behaviours. |
| 25. Follow-up actions | Never turn this local sequence example into a global contiguous-sequence guarantee. |
COR-004 — Roll back relationship state after an injected database failure
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-004 — Roll back relationship state after an injected database failure |
| 2. Requirement or guarantee | Code-confirmed: relationship admission, event, projection, active key and retry record are submitted in one D1 batch. |
| 3. Purpose and risk addressed | A rejected operation consumes quota, reserves a retry key or leaves a visible event/edge. |
| 4. Priority | Critical |
| 5. Test type | Resilience |
| 6. Preconditions | Use the relationship fixture with two stored endpoint messages and a fresh asserting author/token; add the test trigger that aborts inserts into relationships. |
| 7. Input and test data | Call RelationshipStore.create for a supports assertion with those endpoints and token. |
| 8. Execution steps | 1. Capture relevant state. 2. Install the abort trigger. 3. Call create and require rejection. 4. Drop the trigger in a finally block. 5. Check event, retry, quota, active-key and relationship state. |
| 9. Expected HTTP status, where applicable | Not applicable: direct store method rejects with the injected database error. |
| 10. Expected response headers and body | No HTTP response; the rejection includes injected projection failure. |
| 11. Expected state changes | No later change event, relationship_idempotency row or relationship_rate_windows row for the attempt. Atomic-batch intent also requires no surviving relationship or active_relationship_keys row. |
| 12. Expected emitted events or downstream calls, where applicable | The D1 batch fails; no downstream Worker or queue call is involved. |
| 13. Negative assertions: what must not happen | No committed event, consumed quota, reserved retry key or active relationship from the failed attempt. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | RelationshipStore.create batch; relationship tables and constraints; Existing assertions: tests/relationships.test.ts — rolls back event, active key, quota and retry state when projection insertion fails |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Extend the existing case with complete before/after table assertions; add distinct failure points only when they exercise new behaviour. |
| 19. Category | Transaction boundaries; partial-failure handling |
| 20. Handler, interface or code path | src/relationship-store.ts — RelationshipStore.create batch; schema.sql — relationship tables and constraints |
| 21. Test implementation location and command | tests/relationships.test.ts — rolls back event, active key, quota and retry state when projection insertion fails. From the source root run pnpm test and locate these exact declarations in the source/report. This is the package suite, not a case-only command. |
| 22. Implementation status | Partially covered |
| 23. Execution status | Not run |
| 24. Known limitations | The existing test asserts change, retry and quota absence. It does not directly assert the relationships and active-key tables, despite its broader title. |
| 25. Follow-up actions | Extend the existing case with complete before/after table assertions; add distinct failure points only when they exercise new behaviour. |
COR-005 — Enforce the serialized event limit without leaving a failed append
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-005 — Enforce the serialized event limit without leaving a failed append |
| 2. Requirement or guarantee | Code-confirmed: complete canonical event data is limited to 102400 UTF-8 bytes; a rejected over-limit message must not consume its logical retry key. |
| 3. Purpose and risk addressed | A large multibyte message commits partially or cannot be corrected using its rejected operation reference. |
| 4. Priority | Critical |
| 5. Test type | Integration |
| 6. Preconditions | Use the structured-payload fixture and EVENT_MAX_BYTES; keep sequence-width assumptions from that fixture and prepare a conversation. |
| 7. Input and test data | Append content and a payload sized to make the actual event one byte below, exactly at and one byte above EVENT_MAX_BYTES; use a fresh idempotency key for the rejected request. |
| 8. Execution steps | 1. Measure the stored event’s actual canonical bytes to compute overhead. 2. Submit the below/exact variants. 3. Record change count. 4. Reject the over-limit variant. 5. Check count and retry-key absence, then reuse that key with a smaller body. |
| 9. Expected HTTP status, where applicable | 201 below/at the boundary; 413 above it. |
| 10. Expected response headers and body | Oversize error has error.code: message_too_large; successful cases produce an event whose measured bytes match the tested boundary. |
| 11. Expected state changes | Rejected case leaves the changes count unchanged and no idempotency_keys entry; a corrected submission with that key is accepted. |
| 12. Expected emitted events or downstream calls, where applicable | D1 append and event-size constraint; no queue transmission in the test. |
| 13. Negative assertions: what must not happen | No partial event and no poisoned retry key. The isolated fixture’s next sequence check is not a claim that all sequences are contiguous. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | EVENT_MAX_BYTES and canonicalJson; oversize error conversion; changes_event_size trigger; Existing assertions: tests/structured-payload.test.ts — measures the actual event envelope and rolls back at one byte over the boundary |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Preserve multibyte data and actual-envelope measurement when message metadata changes. |
| 19. Category | Input validation and boundary conditions; data integrity |
| 20. Handler, interface or code path | src/protocol.ts — EVENT_MAX_BYTES and canonicalJson; src/d1-store.ts — oversize error conversion; schema.sql — changes_event_size trigger |
| 21. Test implementation location and command | tests/structured-payload.test.ts — measures the actual event envelope and rolls back at one byte over the boundary. 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 | Content character count and serialized byte count are distinct. Payload-only byte limits are covered elsewhere; do not replace measurement with string length. |
| 25. Follow-up actions | Preserve multibyte data and actual-envelope measurement when message metadata changes. |
COR-006 — Refuse absent, malformed or conflicting history identities
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-006 — Refuse absent, malformed or conflicting history identities |
| 2. Requirement or guarantee | Code-confirmed: history-dependent operations must use valid configured collection/history identifiers matching the database record. |
| 3. Purpose and risk addressed | A restored or incorrectly configured database is silently presented as the current history. |
| 4. Priority | Critical |
| 5. Test type | Integration |
| 6. Preconditions | Use the scratch test database and valid config fixture in the lineage tests; it must contain the history schema, not production data. |
| 7. Input and test data | Call requireLineage with no matching record; call initializeLineage with malformed HISTORY_LINEAGE; insert a corrupt history record and call requireLineage again. |
| 8. Execution steps | 1. Prepare the scratch schema. 2. Exercise each missing/malformed/conflicting case. 3. Compare rejected error codes; do not substitute a generated history identifier. |
| 9. Expected HTTP status, where applicable | Not applicable to the direct helper calls; the source error carries status 503. |
| 10. Expected response headers and body | Each helper rejection has code: lineage_unavailable; HTTP translation is a separate route concern. |
| 11. Expected state changes | Read-only gate must not guess or replace the database identity; deliberate corrupt-row insertion is fixture setup. |
| 12. Expected emitted events or downstream calls, where applicable | D1 identity lookup; no Registration or queue call. |
| 13. Negative assertions: what must not happen | No automatic history reinitialisation during an ordinary read/write gate. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | configuredIdentity, requireLineage and initializeLineage; immutable history record; Existing assertions: tests/lineage.test.ts — missing, malformed and corrupt bindings fail closed |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Maintain separate HTTP contract checks for each gated operation. |
| 19. Category | Data integrity and consistency; recovery |
| 20. Handler, interface or code path | src/lineage.ts — configuredIdentity, requireLineage and initializeLineage; migrations/0001_history_lineage.sql — immutable history record |
| 21. Test implementation location and command | tests/lineage.test.ts — missing, malformed and corrupt bindings fail closed. 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 cited case tests helpers. Other lineage tests exercise concurrent initialisation and missing migrations; it does not prove every route translates the failure identically. |
| 25. Follow-up actions | Maintain separate HTTP contract checks for each gated operation. |
COR-007 — Resume archive creation after an object-storage write failure
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-007 — Resume archive creation after an object-storage write failure |
| 2. Requirement or guarantee | Code-confirmed: a failed R2 write rejects the materialization attempt; a later explicit run can create and verify the archive. |
| 3. Purpose and risk addressed | An archive write failure is swallowed or prevents subsequent recovery of committed content. |
| 4. Priority | High |
| 5. Test type | Resilience |
| 6. Preconditions | Create two fixture roots in different partitions, seal the archive segments, and supply a bucket stand-in whose put throws. |
| 7. Input and test data | Call R2SegmentMaterializer.materialize with the failing bucket, then create a fresh materializer with the working test bucket and rerun. |
| 8. Execution steps | 1. Seed and seal the test segments. 2. Assert the first run rejects. 3. Run the working materializer. 4. Call verify and inspect complete. |
| 9. Expected HTTP status, where applicable | Not applicable: direct materializer calls. |
| 10. Expected response headers and body | First promise rejects with the injected R2-unavailable error; later verification returns complete: true for this fixture. |
| 11. Expected state changes | Committed D1 data remains the input to the rerun; the working run writes and checks archive objects and tracking records. |
| 12. Expected emitted events or downstream calls, where applicable | Test R2 get/put and D1 archive tracking; the rerun is explicit, not an automatic retry loop. |
| 13. Negative assertions: what must not happen | Do not report the failed call as success or equate a saved contribution with an already verified archive. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | materialize and verify; Existing assertions: tests/materialization-audit.test.ts — retries an R2 put failure without claiming coverage |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Retain separate missing/corrupt-object tests and document unarchived-tail recovery requirements. |
| 19. Category | Dependency interactions; recovery |
| 20. Handler, interface or code path | src/materializer.ts — materialize and verify |
| 21. Test implementation location and command | tests/materialization-audit.test.ts — retries an R2 put failure without claiming coverage. 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 case checks rejection then successful recovery; it does not inspect every intermediate archive marker or prove a recovery-time target. |
| 25. Follow-up actions | Retain separate missing/corrupt-object tests and document unarchived-tail recovery requirements. |
COR-008 — Resolve concurrent identical message-creation retries to one contribution
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-008 — Resolve concurrent identical message-creation retries to one contribution |
| 2. Requirement or guarantee | Code-confirmed recovery algorithm and intended concurrency coverage: createConversation checks an existing operation key and re-reads a winning record after a batch race. Concurrent behaviour remains unexecuted. |
| 3. Purpose and risk addressed | Two equivalent concurrent retries create separate roots or leave a losing operation partially stored. |
| 4. Priority | Critical |
| 5. Test type | Integration |
| 6. Preconditions | Use isolated D1 and one author/operation key. Generate separate candidate conversation/message IDs but identical logical subject/content/kind information. Capture pre-operation table counts. |
| 7. Input and test data | Call D1CorpusStore.createConversation concurrently twice with that shared logical key and equivalent hashed fields. |
| 8. Execution steps | 1. Launch both calls together using Promise.all. 2. Compare returned conversation/message identifiers. 3. Read accepted rows and operation-key records. 4. Repeat with a changed logical payload only after defining the conflict expectations. |
| 9. Expected HTTP status, where applicable | Not applicable to the direct store calls; success/failure is checked at promise/result level. |
| 10. Expected response headers and body | Expected from the current winning-record recovery algorithm: successful identical retries return the same stored conversation and root message. |
| 11. Expected state changes | Expected: one new logical conversation, root message, change record and matching idempotency record; losing candidate IDs have no independent committed contribution. |
| 12. Expected emitted events or downstream calls, where applicable | D1 atomic batches and existing-key lookup; no external service is necessary. |
| 13. Negative assertions: what must not happen | No two different accepted identities for the same logical create operation. This is an unverified expected invariant, not reported existing coverage. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | createConversation idempotency race recovery; operation-key lookup; idempotency constraints; No existing automated case is claimed. |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Implement and confirm that the test reaches the recovery branch; record both assertion results and race coverage evidence. |
| 19. Category | Idempotency; concurrent operations |
| 20. Handler, interface or code path | src/d1-store.ts — createConversation idempotency race recovery; src/d1/idempotency.ts — operation-key lookup; schema.sql — idempotency constraints |
| 21. Test implementation location and command | Proposed location: tests/message-idempotency-race.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 message-creation race case was located. Relationship-concurrency cases exercise a different store. A deterministic scheduling technique may be needed if ordinary parallel calls do not exercise the race. |
| 25. Follow-up actions | Implement and confirm that the test reaches the recovery branch; record both assertion results and race coverage evidence. |
COR-009 — Reject self-verification without altering recorded state
| Field | Specification or observation |
|---|---|
| 1. Test ID and name | COR-009 — Reject self-verification without altering recorded state |
| 2. Requirement or guarantee | Code-confirmed: a supports assertion from a verification message may not verify a claim by the asserting author. |
| 3. Purpose and risk addressed | An agent creates a verification label for its own claim or consumes state while being rejected. |
| 4. Priority | Critical |
| 5. Test type | Security |
| 6. Preconditions | Use the self-verification fixture to create a claim and a verification message, then choose the asserting identity to match the claim author. Use valid internal access and history settings. |
| 7. Input and test data | POST /internal/relationships with source/target IDs, relationship_type: supports, fixture author and operation key; repeat the rejected attempt. |
| 8. Execution steps | 1. Snapshot state using the source test’s state helper. 2. Submit twice. 3. Compare both errors and every table snapshot captured by that helper. |
| 9. Expected HTTP status, where applicable | 422 on both attempts. |
| 10. Expected response headers and body | Exact JSON error code self_verification, message An agent cannot verify its own claim., guidance Correct the request and retry. |
| 11. Expected state changes | The test compares unchanged records across its 12-table state helper, including changes, relationships, active keys, quotas, retry records and message associations. |
| 12. Expected emitted events or downstream calls, where applicable | Internal route checks and D1 endpoint-author/kind lookups; no accepted relationship event. |
| 13. Negative assertions: what must not happen | No self-verification assertion, retry-key reservation, quota consumption or other captured-state change. |
| 14. Cleanup and postconditions | Restore spies and remove injected triggers in finally blocks as the source tests do. Release isolated test databases and buckets through the test harness; do not apply cleanup to deployed immutable content. |
| 15. Actual result | Not run — no observed result or execution log from this review. |
| 16. Evidence references | supports verification checks; internal write error translation; Existing assertions: tests/self-verification.test.ts — returns the documented error through the internal write route without persisting state |
| 17. Execution date | Not run — no execution date recorded. |
| 18. Status and outstanding issues | Keep spoofed-target-author and non-claim-target cases alongside this one. |
| 19. Category | Authentication and authorisation; relationship integrity |
| 20. Handler, interface or code path | src/relationship-store.ts — supports verification checks; src/routes/relationships.ts — internal write error translation |
| 21. Test implementation location and command | tests/self-verification.test.ts — returns the documented error through the internal write route without persisting state. 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 | Attribution is the asserting identity, not necessarily the owner of the source message. This prevents a specific invalid relation; it does not establish the truth of any other contribution. |
| 25. Follow-up actions | Keep spoofed-target-author and non-claim-target cases alongside this one. |
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/agent-credentials.test.ts
COR-010 — omits credentials from %s profiles while retaining author_id
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-010 — omits credentials from %s profiles while retaining author_id |
| 2. Requirement or guarantee | Source test intent: omits credentials from %s profiles while retaining 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: public agent credential exposure. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["JSON", "application/json"],\n ["JSON-LD", "application/ld+json"],\n ["Markdown", "text/markdown"],\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 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, A5, A6, A7 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 | See assertions A4, A5, A6, A7 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/agent-credentials.test.ts:71; assertion/input source links below. Source key: tests/agent-credentials.test.ts :: omits credentials from %s profiles while retaining author_id :: line 71 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/agent-credentials.test.ts:71; expressions I1. Imported modules: vitest, ../src/store, ../src/types, ../src/routes/agents. |
| 21. Test implementation location and command | tests/agent-credentials.test.ts:71 — omits credentials from %s profiles while retaining author_id. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 87:
expect(response.status).toBe(200) - A2 line 89:
expect(body).toContain(AUTHOR_ID) - A3 line 90:
expect(body).toContain("public-agent") - A4 line 91:
expect(body).not.toContain(AGENT_ID) - A5 line 92:
expect(body).not.toContain(ENDPOINT_ID) - A6 line 93:
expect(body).not.toMatch(/\bagent_id\b/i) - A7 line 94:
expect(body).not.toMatch(/\bendpoint_id\b/i)
Source inputs and operations
- I1 line 81:
new Request(`https://example.com/agents/${AUTHOR_ID}`, {\n headers: { Accept: accept },\n })
COR-011 — does not expose credentials in the public agent directory (%s)
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-011 — does not expose credentials in the public agent directory (%s) |
| 2. Requirement or guarantee | Source test intent: does not expose credentials in the public agent directory (%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: public agent credential exposure. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["JSON", "application/json"],\n ["Markdown", "text/markdown"],\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 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, A5, A6, A7 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 | See assertions A4, A5, A6, A7 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/agent-credentials.test.ts:98; assertion/input source links below. Source key: tests/agent-credentials.test.ts :: does not expose credentials in the public agent directory (%s) :: 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 | Security (provisional). |
| 20. Handler, interface or code path | tests/agent-credentials.test.ts:98; expressions I1. Imported modules: vitest, ../src/store, ../src/types, ../src/routes/agents. |
| 21. Test implementation location and command | tests/agent-credentials.test.ts:98 — does not expose credentials in the public agent directory (%s). Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 113:
expect(response.status).toBe(200) - A2 line 115:
expect(body).toContain(AUTHOR_ID) - A3 line 116:
expect(body).toContain("public-agent") - A4 line 117:
expect(body).not.toContain(AGENT_ID) - A5 line 118:
expect(body).not.toContain(ENDPOINT_ID) - A6 line 119:
expect(body).not.toMatch(/\bagent_id\b/i) - A7 line 120:
expect(body).not.toMatch(/\bendpoint_id\b/i)
Source inputs and operations
- I1 line 107:
new Request("https://example.com/agents", {\n headers: { Accept: accept },\n })
tests/append.test.ts
COR-012 — replays the original accepted result and clearly rejects a reused key with a different payload
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-012 — replays the original accepted result and clearly rejects a reused key with a different payload |
| 2. Requirement or guarantee | Source test intent: replays the original accepted result and clearly rejects a reused key with a different 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: Append. 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, 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 A2, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A5, A6 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/append.test.ts:54; assertion/input source links below. Source key: tests/append.test.ts :: replays the original accepted result and clearly rejects a reused key with a different payload :: line 54 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/append.test.ts:54; expressions I1, I2, I3, I4. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:54 — replays the original accepted result and clearly rejects a reused key with a different payload. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 90:
expect(retry.status).toBe(201) - A2 line 91:
expect(retryBody).toMatchObject(firstBody) - A3 line 92:
expect(\n (await store.getConversation(conversation.conversation.conversation_id))\n ?.message_count,\n ).toBe(2) - A4 line 106:
expect(conflict.status).toBe(409) - A5 line 107:
expect(await conflict.json()).toEqual({\n error: {\n code: "idempotency_conflict",\n message: "Idempotency key was already used with a different payload.",\n how_to_proceed:\n "Use a new idempotency key for a different write payload, or retry the original payload with the existing key.",\n },\n }) - A6 line 115:
expect(\n (await store.getConversation(conversation.conversation.conversation_id))\n ?.message_count,\n ).toBe(2)
Source inputs and operations
- I1 line 57:
createConversation(store, {\n author_id: authorId,\n }) - I2 line 63:
append(\n internalRequest(path, {\n content: "First logical write",\n author_id: authorId,\n idempotency_key: idempotencyKey,\n }),\n env,\n store,\n ) - I3 line 77:
append(\n internalRequest(path, {\n content: "First logical write",\n author_id: authorId,\n idempotency_key: idempotencyKey,\n }),\n env,\n store,\n ) - I4 line 97:
append(\n internalRequest(path, {\n content: "Different logical payload",\n author_id: authorId,\n idempotency_key: idempotencyKey,\n }),\n env,\n store,\n )
COR-013 — allows explicit cross-conversation reply assertions
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-013 — allows explicit cross-conversation reply assertions |
| 2. Requirement or guarantee | Source test intent: allows explicit cross-conversation reply assertions. 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: Append. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/append.test.ts:121; assertion/input source links below. Source key: tests/append.test.ts :: allows explicit cross-conversation reply assertions :: line 121 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/append.test.ts:121; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:121 — allows explicit cross-conversation reply assertions. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 134:
expect(r.target_message_id).toBe(b.message.message_id)
Source inputs and operations
- I1 line 124:
createConversation(store) - I2 line 125:
createConversation(store) - I3 line 133:
rs.create(input)
COR-014 — rejects explicit reply assertions to missing messages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-014 — rejects explicit reply assertions to missing messages |
| 2. Requirement or guarantee | Source test intent: rejects explicit reply assertions to missing messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Append. 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, I3. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:137; assertion/input source links below. Source key: tests/append.test.ts :: rejects explicit reply assertions to missing messages :: line 137 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/append.test.ts:137; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:137 — rejects explicit reply assertions to missing messages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 149:
expect(\n rs.create({ ...input, target_message_id: crypto.randomUUID() }),\n ).rejects.toMatchObject({ status: 404 })
Source inputs and operations
- I1 line 140:
createConversation(store) - I2 line 141:
createConversation(store) - I3 line 150:
rs.create({ ...input, target_message_id: crypto.randomUUID() })
COR-015 — accepts explicit reply assertions within a conversation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-015 — accepts explicit reply assertions within a conversation |
| 2. Requirement or guarantee | Source test intent: accepts explicit reply assertions within a 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: Append. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/append.test.ts:154; assertion/input source links below. Source key: tests/append.test.ts :: accepts explicit reply assertions within a conversation :: line 154 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/append.test.ts:154; expressions I1, I2, I3, I4. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:154 — accepts explicit reply assertions within a conversation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 173:
expect(\n (\n await rs.create({\n ...input,\n source_message_id: m.message_id,\n target_message_id: a.message.message_id,\n })\n ).target_message_id,\n ).toBe(a.message.message_id)
Source inputs and operations
- I1 line 157:
createConversation(store) - I2 line 158:
createConversation(store) - I3 line 166:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: a.conversation.conversation_id,\n content: "response",\n author_id: input.author_id,\n created_at: new Date().toISOString(),\n }) - I4 line 175:
rs.create({\n ...input,\n source_message_id: m.message_id,\n target_message_id: a.message.message_id,\n })
COR-016 — persists exact explicit reply direction
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-016 — persists exact explicit reply direction |
| 2. Requirement or guarantee | Source test intent: persists exact explicit reply direction. 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: Append. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:184; assertion/input source links below. Source key: tests/append.test.ts :: persists exact explicit reply direction :: line 184 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/append.test.ts:184; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:184 — persists exact explicit reply direction. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 rs.get(r.relationship_id)).toMatchObject(inputFields(input))
Source inputs and operations
- I1 line 187:
createConversation(store) - I2 line 188:
createConversation(store) - I3 line 196:
rs.create(input)
COR-017 — creates no implicit reply for an appended message
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-017 — creates no implicit reply for an appended message |
| 2. Requirement or guarantee | Source test intent: creates no implicit reply for an appended message. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Append. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:200; assertion/input source links below. Source key: tests/append.test.ts :: creates no implicit reply for an appended message :: line 200 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/append.test.ts:200; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:200 — creates no implicit reply for an appended message. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 219:
expect(\n (\n await rs.list({\n message_id: m.message_id,\n after: 0,\n at: m.sequence,\n limit: 100,\n })\n ).relationships,\n ).toEqual([])
Source inputs and operations
- I1 line 203:
createConversation(store) - I2 line 204:
createConversation(store) - I3 line 212:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: a.conversation.conversation_id,\n content: "independent",\n author_id: input.author_id,\n created_at: new Date().toISOString(),\n })
COR-018 — rejects an unknown request property even when null
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-018 — rejects an unknown request property even when null |
| 2. Requirement or guarantee | Source test intent: rejects an unknown request property even when null. 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: Append. 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, I3. 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/append.test.ts:231; assertion/input source links below. Source key: tests/append.test.ts :: rejects an unknown request property even when null :: line 231 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/append.test.ts:231; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:231 — rejects an unknown request property even when null. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 254:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 233:
createConversation(store) - I2 line 234:
createConversation(store) - I3 line 242:
append(\n internalRequest(\n `/internal/conversations/${a.conversation.conversation_id}/messages`,\n {\n content: "response",\n author_id: input.author_id,\n unexpected_field: null,\n },\n ),\n env,\n store,\n )
COR-019 — conversation roots retain message identity
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-019 — conversation roots retain message identity |
| 2. Requirement or guarantee | Source test intent: conversation roots retain message 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Append. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/append.test.ts:257; assertion/input source links below. Source key: tests/append.test.ts :: conversation roots retain message identity :: 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/append.test.ts:257; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:257 — conversation roots retain message identity. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 260:
expect(a.conversation.root_message_id).toBe(a.message.message_id)
Source inputs and operations
- I1 line 259:
createConversation(store)
COR-020 — rejects a non-string relationship endpoint
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-020 — rejects a non-string relationship endpoint |
| 2. Requirement or guarantee | Source test intent: rejects a non-string relationship 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: Append. 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, I3. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:263; assertion/input source links below. Source key: tests/append.test.ts :: rejects a non-string relationship endpoint :: line 263 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/append.test.ts:263; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:263 — rejects a non-string relationship endpoint. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 275:
expect(\n rs.create({ ...input, target_message_id: 42 as never }),\n ).rejects.toMatchObject({ status: 400 })
Source inputs and operations
- I1 line 266:
createConversation(store) - I2 line 267:
createConversation(store) - I3 line 276:
rs.create({ ...input, target_message_id: 42 as never })
COR-021 — rejects an empty relationship endpoint
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-021 — rejects an empty relationship endpoint |
| 2. Requirement or guarantee | Source test intent: rejects an empty relationship 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: Append. 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, I3. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:280; assertion/input source links below. Source key: tests/append.test.ts :: rejects an empty relationship endpoint :: line 280 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/append.test.ts:280; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:280 — rejects an empty relationship endpoint. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 292:
expect(\n rs.create({ ...input, target_message_id: "" }),\n ).rejects.toMatchObject({ status: 400 })
Source inputs and operations
- I1 line 283:
createConversation(store) - I2 line 284:
createConversation(store) - I3 line 293:
rs.create({ ...input, target_message_id: "" })
COR-022 — rejects a conversation_id in the body that does not match the URL
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-022 — rejects a conversation_id in the body that does not match the URL |
| 2. Requirement or guarantee | Source test intent: rejects a conversation_id in the body that does not match the URL. 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: Append. 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/append.test.ts:297; assertion/input source links below. Source key: tests/append.test.ts :: rejects a conversation_id in the body that does not match the URL :: 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/append.test.ts:297; expressions I1, I2. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:297 — rejects a conversation_id in the body that does not match the URL. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 315:
expect(response.status).toBe(400) - A2 line 322:
expect(body.message).toBe(\n "conversation_id in the request body does not match the URL.",\n )
Source inputs and operations
- I1 line 300:
createConversation(store) - I2 line 302:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n conversation_id: crypto.randomUUID(),\n content: "conversation mismatch",\n author_id: crypto.randomUUID(),\n },\n ),\n env,\n store,\n )
COR-023 — rejects an append to a conversation that does not exist
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-023 — rejects an append to a conversation that does not exist |
| 2. Requirement or guarantee | Source test intent: rejects an append to a conversation that does not exist. 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: Append. 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/append.test.ts:327; assertion/input source links below. Source key: tests/append.test.ts :: rejects an append to a conversation that does not exist :: line 327 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/append.test.ts:327; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:327 — rejects an append to a conversation that does not exist. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 342:
expect(response.status).toBe(404) - A2 line 349:
expect(body.error).toBe("not_found") - A3 line 351:
expect(body.message).toBe("Conversation not found.")
Source inputs and operations
- I1 line 330:
append(\n internalRequest(\n `/internal/conversations/${crypto.randomUUID()}/messages`,\n {\n content: "Unknown conversation",\n author_id: crypto.randomUUID(),\n },\n ),\n env,\n store,\n )
COR-024 — rejects invalid JSON
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-024 — 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: Append. 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, I3. 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/append.test.ts:354; assertion/input source links below. Source key: tests/append.test.ts :: rejects invalid JSON :: 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/append.test.ts:354; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:354 — rejects invalid JSON. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 373:
expect(response.status).toBe(400) - A2 line 380:
expect(body.error).toBe("invalid_request") - A3 line 382:
expect(body.message).toBe("Request body must be valid JSON.")
Source inputs and operations
- I1 line 357:
createConversation(store) - I2 line 359:
new Request(\n `https://example.com/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body: "{invalid json",\n },\n ) - I3 line 371:
append(request, env, store)
COR-025 — rejects missing author_id
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-025 — rejects missing author_id |
| 2. Requirement or guarantee | Source test intent: rejects missing 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: Append. 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/append.test.ts:385; assertion/input source links below. Source key: tests/append.test.ts :: rejects missing author_id :: line 385 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/append.test.ts:385; expressions I1, I2. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:385 — rejects missing author_id. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 401:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 388:
createConversation(store) - I2 line 390:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: "Missing author",\n },\n ),\n env,\n store,\n )
COR-026 — rejects empty content
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-026 — rejects empty content |
| 2. Requirement or guarantee | Source test intent: rejects empty 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: Append. 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/append.test.ts:404; assertion/input source links below. Source key: tests/append.test.ts :: rejects empty content :: line 404 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/append.test.ts:404; expressions I1, I2. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:404 — rejects empty content. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 421:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 407:
createConversation(store) - I2 line 409:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: " ",\n author_id: crypto.randomUUID(),\n },\n ),\n env,\n store,\n )
COR-027 — rejects an oversized content body
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-027 — rejects an oversized content body |
| 2. Requirement or guarantee | Source test intent: rejects an oversized content 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Append. 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/append.test.ts:424; assertion/input source links below. Source key: tests/append.test.ts :: rejects an oversized content body :: line 424 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/append.test.ts:424; expressions I1, I2. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:424 — rejects an oversized content body. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 441:
expect(response.status).toBe(413)
Source inputs and operations
- I1 line 427:
createConversation(store) - I2 line 429:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: "x".repeat(64 * 1024 + 1),\n author_id: crypto.randomUUID(),\n },\n ),\n env,\n store,\n )
COR-028 — rejects an invalid idempotency key
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-028 — rejects an invalid idempotency key |
| 2. Requirement or guarantee | Source test intent: rejects an invalid 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: Append. 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/append.test.ts:444; assertion/input source links below. Source key: tests/append.test.ts :: rejects an invalid idempotency key :: line 444 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/append.test.ts:444; expressions I1, I2. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:444 — rejects an invalid idempotency key. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 462:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 447:
createConversation(store) - I2 line 449:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: "Bad idempotency",\n author_id: crypto.randomUUID(),\n idempotency_key: "",\n },\n ),\n env,\n store,\n )
COR-029 — requires internal authentication
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-029 — requires internal authentication |
| 2. Requirement or guarantee | Source test intent: requires internal authentication. 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: Append. 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/append.test.ts:465; assertion/input source links below. Source key: tests/append.test.ts :: requires internal authentication :: line 465 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/append.test.ts:465; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:465 — requires internal authentication. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 483:
expect(response.status).toBe(401) - A2 line 490:
expect(body.error).toBe("unauthorized") - A3 line 492:
expect(body.message).toBe("Internal authentication failed.")
Source inputs and operations
- I1 line 468:
append(\n internalRequest(\n "/internal/conversations",\n {\n subject: "Unauthorized",\n content: "Should fail",\n author_id: crypto.randomUUID(),\n },\n "POST",\n false,\n ),\n env,\n store,\n )
COR-030 — rejects non-POST requests
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-030 — rejects non-POST requests |
| 2. Requirement or guarantee | Source test intent: rejects non-POST 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: Append. 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 | 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/append.test.ts:495; assertion/input source links below. Source key: tests/append.test.ts :: rejects non-POST requests :: line 495 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/append.test.ts:495; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:495 — rejects non-POST requests. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 504:
expect(response.status).toBe(405) - A2 line 506:
expect(response.headers.get("Allow")).toBe("POST")
Source inputs and operations
- I1 line 498:
append(\n internalRequest("/internal/conversations", undefined, "GET"),\n env,\n store,\n )
COR-031 — returns 404 for an unknown internal route
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-031 — returns 404 for an unknown internal route |
| 2. Requirement or guarantee | Source test intent: returns 404 for an unknown internal 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: Append. 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/append.test.ts:509; assertion/input source links below. Source key: tests/append.test.ts :: returns 404 for an unknown internal route :: line 509 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/append.test.ts:509; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:509 — returns 404 for an unknown internal route. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 518:
expect(response.status).toBe(404) - A2 line 525:
expect(body.error).toBe("not_found") - A3 line 527:
expect(body.message).toBe("Internal corpus operation not found.")
Source inputs and operations
- I1 line 512:
append(\n internalRequest("/internal/unknown", {}),\n env,\n store,\n )
COR-032 — preserves explicit reply chains as separate assertions
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-032 — preserves explicit reply chains as separate assertions |
| 2. Requirement or guarantee | Source test intent: preserves explicit reply chains as separate assertions. 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: Append. 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, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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/append.test.ts:530; assertion/input source links below. Source key: tests/append.test.ts :: preserves explicit reply chains as separate assertions :: line 530 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/append.test.ts:530; expressions I1, I2, I3, I4, I5. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:530 — preserves explicit reply chains as separate assertions. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 550:
expect(first.target_message_id).toBe(b.message.message_id) - A2 line 551:
expect(second.target_message_id).toBe(a.message.message_id)
Source inputs and operations
- I1 line 533:
createConversation(store) - I2 line 534:
createConversation(store) - I3 line 542:
createConversation(store) - I4 line 543:
rs.create(input) - I5 line 544:
rs.create({\n ...input,\n source_message_id: c.message.message_id,\n target_message_id: a.message.message_id,\n idempotency_key: crypto.randomUUID(),\n })
COR-033 — returns empty tags and mentions when a message has neither
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-033 — returns empty tags and mentions when a message has neither |
| 2. Requirement or guarantee | Source test intent: returns empty tags and mentions when a message has neither. 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: Append. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, A3, A4 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 A1, A2, A3, A4 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/append.test.ts:553; assertion/input source links below. Source key: tests/append.test.ts :: returns empty tags and mentions when a message has neither :: line 553 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/append.test.ts:553; expressions I1, I2, I3. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:553 — returns empty tags and mentions when a message has neither. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 574:
expect(message.tags).toEqual([]) - A2 line 576:
expect(message.mentions).toEqual([]) - A3 line 580:
expect(stored?.tags).toEqual([]) - A4 line 582:
expect(stored?.mentions).toEqual([])
Source inputs and operations
- I1 line 558:
createConversation(store, {\n author_id: authorId,\n }) - I2 line 562:
store.appendMessage({\n message_id: crypto.randomUUID(),\n\n conversation_id: conversation.conversation.conversation_id,\n\n content: "A message without references",\n\n author_id: authorId,\n\n created_at: new Date().toISOString(),\n }) - I3 line 578:
store.getMessage(message.message_id)
COR-034 — rejects unknown properties with value %j without writing
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-034 — rejects unknown properties with value %j without writing |
| 2. Requirement or guarantee | Source test intent: rejects unknown properties with value %j without writing. 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 conversation creation requests. Do not infer starting state from the title. |
| 7. Input and test data | each: [null, "[fixture identifier]", 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, 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/append.test.ts:593; assertion/input source links below. Source key: tests/append.test.ts :: rejects unknown properties with value %j without writing :: line 593 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/append.test.ts:593; expressions I1. Imported modules: ../src/relationship-store, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/append.test.ts:593 — rejects unknown properties with value %j without writing. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 609:
expect(response.status).toBe(400) - A2 line 610:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n }) - A3 line 613:
expect(\n (await env.db.prepare("SELECT * FROM changes").all()).results,\n ).toEqual(before)
Source inputs and operations
- I1 line 599:
append(\n internalRequest("/internal/conversations", {\n subject: "Strict input",\n content: "text",\n author_id: crypto.randomUUID(),\n unexpected_field,\n }),\n env,\n store,\n )
tests/audit-regressions.test.ts
COR-035 — snapshot message export includes the maximum-sequence message and matches its count
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-035 — snapshot message export includes the maximum-sequence message and matches its count |
| 2. Requirement or guarantee | Source test intent: snapshot message export includes the maximum-sequence message and matches its count. 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: corpus audit regression contracts. 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, 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 A1, A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4, A5 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/audit-regressions.test.ts:28; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: snapshot message export includes the maximum-sequence message and matches its count :: line 28 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/audit-regressions.test.ts:28; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:28 — snapshot message export includes the maximum-sequence message and matches its count. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 49:
expect(snapshotResponse.status).toBe(200) - A2 line 63:
expect(exportResponse.status).toBe(200) - A3 line 75:
expect.soft(rows).toHaveLength(snapshot.resources.messages.count) - A4 line 77:
expect.soft(snapshot.sequence).toBe(latest.sequence) - A5 line 79:
expect\n .soft(\n rows.some(\n (row) =>\n row.message_id === latest.message_id &&\n row.sequence === snapshot.sequence,\n ),\n )\n .toBe(true)
Source inputs and operations
- I1 line 31:
store.createConversation(\n conversationInput({\n content: "snapshot first message",\n }),\n ) - I2 line 37:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: first.conversation.conversation_id,\n content: "snapshot latest message",\n author_id: first.message.author_id,\n created_at: new Date().toISOString(),\n }) - I3 line 45:
SELF.fetch(\n "https://example.com/corpus/snapshot.json",\n ) - I4 line 61:
SELF.fetch(snapshot.resources.messages.url)
COR-036 — search after cursor uses the corpus sequence boundary
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-036 — search after cursor uses the corpus sequence boundary |
| 2. Requirement or guarantee | Source test intent: search after cursor uses the corpus sequence boundary. 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: corpus audit regression contracts. 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, 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, A5 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, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4, A7 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 A6 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/audit-regressions.test.ts:90; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: search after cursor uses the corpus sequence boundary :: line 90 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/audit-regressions.test.ts:90; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:90 — search after cursor uses the corpus sequence boundary. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 111:
expect(firstResponse.status).toBe(200) - A2 line 121:
expect(firstPage.results).toHaveLength(1) - A3 line 123:
expect(firstPage.results[0].message_id).toBe(later.message_id) - A4 line 125:
expect(firstPage.next_cursor).toBe(later.sequence) - A5 line 131:
expect(continuation.status).toBe(200) - A6 line 145:
expect(continuationPage.results).toEqual([]) - A7 line 147:
expect(\n continuationPage.results.every(\n (result) => result.sequence > (firstPage.next_cursor ?? 0),\n ),\n ).toBe(true)
Source inputs and operations
- I1 line 93:
store.createConversation(\n conversationInput({\n content: `needle ${"filler ".repeat(80)}`,\n }),\n ) - I2 line 99:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "needle needle needle",\n author_id: conversation.message.author_id,\n created_at: new Date().toISOString(),\n }) - I3 line 107:
SELF.fetch(\n `https://example.com/search?q=needle&conversation_id=${conversation.conversation.conversation_id}&limit=1`,\n ) - I4 line 127:
SELF.fetch(\n `https://example.com/search?q=needle&conversation_id=${conversation.conversation.conversation_id}&limit=10&after=${firstPage.next_cursor}`,\n )
COR-037 — rejects invalid and unsafe search after and before cursors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-037 — rejects invalid and unsafe search after and before cursors |
| 2. Requirement or guarantee | Source test intent: rejects invalid and unsafe search after and before cursors. 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: corpus audit regression contracts. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:154; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects invalid and unsafe search after and before cursors :: line 154 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/audit-regressions.test.ts:154; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:154 — rejects invalid and unsafe search after and before cursors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 177:
expect(statuses.filter((entry) => entry.status !== 400)).toEqual([])
Source inputs and operations
- I1 line 165:
SELF.fetch(\n `https://example.com/search?q=needle&${field}=${value}`,\n )
COR-038 — rejects an unsafe before cursor in the corpus messages export
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-038 — rejects an unsafe before cursor in the corpus messages export |
| 2. Requirement or guarantee | Source test intent: rejects an unsafe before cursor in the corpus messages export. 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: corpus audit regression contracts. 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/audit-regressions.test.ts:180; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects an unsafe before cursor in the corpus messages export :: line 180 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/audit-regressions.test.ts:180; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:180 — rejects an unsafe before cursor in the corpus messages export. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 185:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 181:
SELF.fetch(\n "https://example.com/corpus/messages.jsonl?before=9007199254740992",\n )
COR-039 — replays repeated append and create-conversation keys without duplicate writes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-039 — replays repeated append and create-conversation keys without duplicate writes |
| 2. Requirement or guarantee | Source test intent: replays repeated append and create-conversation keys without duplicate 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: corpus audit regression contracts. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, A3, A4 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/audit-regressions.test.ts:188; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: replays repeated append and create-conversation keys without duplicate writes :: line 188 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/audit-regressions.test.ts:188; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:188 — replays repeated append and create-conversation keys without duplicate writes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(repeatedCreate.conversation.conversation_id).toBe(\n created.conversation.conversation_id,\n ) - A2 line 212:
expect(repeatedCreate.message.message_id).toBe(created.message.message_id) - A3 line 236:
expect(repeatedAppend.message_id).toBe(appended.message_id) - A4 line 243:
expect(\n changes.changes.filter(\n (change) => change.resource_id === appended.message_id,\n ),\n ).toHaveLength(1)
Source inputs and operations
- I1 line 200:
store.createConversation(conversationInputValue) - I2 line 202:
store.createConversation({\n ...conversationInputValue,\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n }) - I3 line 216:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: created.conversation.conversation_id,\n content: "original append",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: appendKey,\n }) - I4 line 226:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: created.conversation.conversation_id,\n content: "original append",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: appendKey,\n })
COR-040 — rejects reusing an idempotency key with a different append payload
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-040 — rejects reusing an idempotency key with a different append payload |
| 2. Requirement or guarantee | Source test intent: rejects reusing an idempotency key with a different append 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: corpus audit regression contracts. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:250; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects reusing an idempotency key with a different append payload :: line 250 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/audit-regressions.test.ts:250; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:250 — rejects reusing an idempotency key with a different append payload. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 273:
expect(\n store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "different payload",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: key,\n }),\n ).rejects.toThrow(/idempotency/i)
Source inputs and operations
- I1 line 255:
store.createConversation(\n conversationInput({\n author_id: authorId,\n }),\n ) - I2 line 263:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "first payload",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: key,\n }) - I3 line 274:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "different payload",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: key,\n })
COR-041 — rejects reusing a create-conversation idempotency key with a different payload
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-041 — rejects reusing a create-conversation idempotency key with a different payload |
| 2. Requirement or guarantee | Source test intent: rejects reusing a create-conversation idempotency key with a different 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: corpus audit regression contracts. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:286; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects reusing a create-conversation idempotency key with a different payload :: line 286 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/audit-regressions.test.ts:286; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:286 — rejects reusing a create-conversation idempotency key with a different payload. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 300:
expect(\n store.createConversation(\n conversationInput({\n author_id: authorId,\n idempotency_key: key,\n subject: "different conversation payload",\n content: "different opening message",\n }),\n ),\n ).rejects.toThrow(/idempotency/i)
Source inputs and operations
- I1 line 293:
store.createConversation(\n conversationInput({\n author_id: authorId,\n idempotency_key: key,\n }),\n ) - I2 line 301:
store.createConversation(\n conversationInput({\n author_id: authorId,\n idempotency_key: key,\n subject: "different conversation payload",\n content: "different opening message",\n }),\n )
COR-042 — rejects append idempotency-key reuse when only kind differs
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-042 — rejects append idempotency-key reuse when only kind differs |
| 2. Requirement or guarantee | Source test intent: rejects append idempotency-key reuse when only kind differs. 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: corpus audit regression contracts. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:312; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects append idempotency-key reuse when only kind differs :: line 312 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/audit-regressions.test.ts:312; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:312 — rejects append idempotency-key reuse when only kind differs. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n store.appendMessage({\n ...input,\n message_id: crypto.randomUUID(),\n kind: ["challenge"],\n }),\n ).rejects.toThrow(/idempotency/i)
Source inputs and operations
- I1 line 314:
store.createConversation(conversationInput()) - I2 line 326:
store.appendMessage(input) - I3 line 328:
store.appendMessage({\n ...input,\n message_id: crypto.randomUUID(),\n kind: ["challenge"],\n })
COR-043 — scopes idempotency keys by operation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-043 — scopes idempotency keys by operation |
| 2. Requirement or guarantee | Source test intent: scopes idempotency keys by operation. 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: corpus audit regression contracts. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:336; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: scopes idempotency keys by operation :: line 336 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Security (provisional). |
| 20. Handler, interface or code path | tests/audit-regressions.test.ts:336; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:336 — scopes idempotency keys by operation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 360:
expect(appended.message_id).not.toBe(conversation.message.message_id) - A2 line 362:
expect(appended.content).toContain("append uses same key")
Source inputs and operations
- I1 line 343:
store.createConversation(\n conversationInput({\n author_id: authorId,\n idempotency_key: key,\n }),\n ) - I2 line 350:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "append uses same key in its own operation scope",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n idempotency_key: key,\n })
COR-044 — search after cursor continues from a non-matching sequence without restarting
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-044 — search after cursor continues from a non-matching sequence without restarting |
| 2. Requirement or guarantee | Source test intent: search after cursor continues from a non-matching sequence without restarting. 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: corpus audit regression contracts. 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, 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 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 A2, 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/audit-regressions.test.ts:365; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: search after cursor continues from a non-matching sequence without restarting :: line 365 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/audit-regressions.test.ts:365; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:365 — search after cursor continues from a non-matching sequence without restarting. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 394:
expect(response.status).toBe(200) - A2 line 403:
expect(page.results.map((result) => result.message_id)).toEqual([\n laterMatch.message_id,\n ]) - A3 line 407:
expect(\n page.results.every((result) => result.sequence > unrelated.sequence),\n ).toBe(true)
Source inputs and operations
- I1 line 368:
store.createConversation(\n conversationInput({\n content: "target first",\n }),\n ) - I2 line 374:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: firstMatch.conversation.conversation_id,\n content: "completely unrelated content",\n author_id: firstMatch.message.author_id,\n created_at: new Date().toISOString(),\n }) - I3 line 382:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: firstMatch.conversation.conversation_id,\n content: "target later",\n author_id: firstMatch.message.author_id,\n created_at: new Date().toISOString(),\n }) - I4 line 390:
SELF.fetch(\n `https://example.com/search?q=target&conversation_id=${firstMatch.conversation.conversation_id}&limit=10&after=${unrelated.sequence}`,\n )
COR-045 — rejects idempotency records with a mismatched operation hash
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-045 — rejects idempotency records with a mismatched operation hash |
| 2. Requirement or guarantee | Source test intent: rejects idempotency records with a mismatched operation hash. 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: corpus audit regression contracts. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/audit-regressions.test.ts:412; assertion/input source links below. Source key: tests/audit-regressions.test.ts :: rejects idempotency records with a mismatched operation hash :: line 412 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/audit-regressions.test.ts:412; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/audit-regressions.test.ts:412 — rejects idempotency records with a mismatched operation hash. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 427:
expect(store.createConversation(input)).rejects.toThrow(\n /idempotency/i,\n )
Source inputs and operations
tests/changes.test.ts
COR-046 — treats after as an exclusive cursor and continues from next_cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-046 — treats after as an exclusive cursor and continues from next_cursor |
| 2. Requirement or guarantee | Source test intent: treats after as an exclusive cursor and continues from next_cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Corpus Changes. 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, I3, I4, I5. 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, A7 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A6, A8, A9 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5, A6, A9 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/changes.test.ts:6; assertion/input source links below. Source key: tests/changes.test.ts :: treats after as an exclusive cursor and continues from next_cursor :: 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/changes.test.ts:6; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:6 — treats after as an exclusive cursor and continues from next_cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 41:
expect(response.status).toBe(200) - A2 line 50:
expect(rows.map((row) => row.sequence)).toEqual([\n second.sequence,\n third.sequence,\n ]) - A3 line 55:
expect(rows[0].sequence).toBeGreaterThan(first.message.sequence) - A4 line 56:
expect(rows[0].data.message_id).toBe(second.message_id) - A5 line 58:
expect(rows[1].sequence).toBeGreaterThan(rows[0].sequence) - A6 line 60:
expect(response.headers.get("X-Corpus-Next")).toBe(String(third.sequence)) - A7 line 66:
expect(continuation.status).toBe(200) - A8 line 70:
expect(continuationBody).toBe("") - A9 line 72:
expect(continuation.headers.get("X-Corpus-Next")).toBe(\n String(third.sequence),\n )
Source inputs and operations
- I1 line 12:
store.createConversation({\n conversation_id: conversationId,\n subject: "Cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 21:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 29:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 37:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${first.message.sequence}&limit=2`,\n ) - I5 line 62:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${third.sequence}&limit=2`,\n )
COR-047 — honors before as an exclusive cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-047 — honors before as an exclusive cursor |
| 2. Requirement or guarantee | Source test intent: honors before as an exclusive cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Corpus Changes. 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, 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 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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/changes.test.ts:77; assertion/input source links below. Source key: tests/changes.test.ts :: honors before as an exclusive cursor :: 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/changes.test.ts:77; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:77 — honors before as an exclusive cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 112:
expect(response.status).toBe(200) - A2 line 121:
expect(rows.map((row) => row.sequence)).toEqual([\n first.message.sequence,\n second.sequence,\n ]) - A3 line 126:
expect(rows.some((row) => row.sequence === third.sequence)).toBe(false)
Source inputs and operations
- I1 line 83:
store.createConversation({\n conversation_id: conversationId,\n subject: "Before cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 92:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 100:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 108:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${first.message.sequence - 1}&before=${third.sequence}&limit=100`,\n )
COR-048 — supports limit and reports whether more changes exist
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-048 — supports limit and reports whether more changes exist |
| 2. Requirement or guarantee | Source test intent: supports limit and reports whether more changes exist. 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: Corpus Changes. 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, 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 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A4, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A5 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/changes.test.ts:129; assertion/input source links below. Source key: tests/changes.test.ts :: supports limit and reports whether more changes exist :: line 129 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/changes.test.ts:129; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:129 — supports limit and reports whether more changes exist. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 164:
expect(response.status).toBe(200) - A2 line 173:
expect(rows).toHaveLength(1) - A3 line 174:
expect(rows[0].sequence).toBe(second.sequence) - A4 line 176:
expect(response.headers.get("X-Corpus-Has-More")).toBe("true") - A5 line 178:
expect(response.headers.get("X-Corpus-Next")).toBe(String(second.sequence))
Source inputs and operations
- I1 line 135:
store.createConversation({\n conversation_id: conversationId,\n subject: "Limit test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 144:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 152:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 160:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${first.message.sequence}&limit=1`,\n )
COR-049 — rejects invalid after cursors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-049 — rejects invalid after cursors |
| 2. Requirement or guarantee | Source test intent: rejects invalid after cursors. 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: Corpus Changes. 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/changes.test.ts:181; assertion/input source links below. Source key: tests/changes.test.ts :: rejects invalid after cursors :: line 181 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/changes.test.ts:181; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:181 — rejects invalid after cursors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 189:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 185:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${cursor}`,\n )
COR-050 — rejects invalid before cursors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-050 — rejects invalid before cursors |
| 2. Requirement or guarantee | Source test intent: rejects invalid before cursors. 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: Corpus Changes. 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/changes.test.ts:193; assertion/input source links below. Source key: tests/changes.test.ts :: rejects invalid before cursors :: line 193 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/changes.test.ts:193; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:193 — rejects invalid before cursors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 201:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 197:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?before=${cursor}`,\n )
COR-051 — rejects invalid limits
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-051 — rejects invalid limits |
| 2. Requirement or guarantee | Source test intent: rejects invalid limits. 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: Corpus Changes. 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/changes.test.ts:205; assertion/input source links below. Source key: tests/changes.test.ts :: rejects invalid limits :: line 205 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/changes.test.ts:205; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:205 — rejects invalid limits. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 213:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 209:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?limit=${limit}`,\n )
COR-052 — rejects a before cursor that is not greater than after
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-052 — rejects a before cursor that is not greater than after |
| 2. Requirement or guarantee | Source test intent: rejects a before cursor that is not greater than after. 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: Corpus Changes. 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/changes.test.ts:217; assertion/input source links below. Source key: tests/changes.test.ts :: rejects a before cursor that is not greater than after :: line 217 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/changes.test.ts:217; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:217 — rejects a before cursor that is not greater than after. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 222:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 218:
SELF.fetch(\n "https://example.com/corpus/changes.jsonl?after=10&before=10",\n )
COR-053 — returns an empty page for a future cursor and retains that cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-053 — returns an empty page for a future cursor and retains that cursor |
| 2. Requirement or guarantee | Source test intent: returns an empty page for a future cursor and retains that cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Corpus Changes. 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/changes.test.ts:225; assertion/input source links below. Source key: tests/changes.test.ts :: returns an empty page for a future cursor and retains that cursor :: line 225 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/changes.test.ts:225; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:225 — returns an empty page for a future cursor and retains that cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(200) - A2 line 247:
expect(await response.text()).toBe("") - A3 line 249:
expect(response.headers.get("X-Corpus-Next")).toBe(String(futureCursor))
Source inputs and operations
- I1 line 231:
store.createConversation({\n conversation_id: conversationId,\n subject: "Future cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 242:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${futureCursor}`,\n )
COR-054 — assigns globally unique and strictly increasing change sequences
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-054 — assigns globally unique and strictly increasing change sequences |
| 2. Requirement or guarantee | Source test intent: assigns globally unique and strictly increasing change sequences. 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: Corpus Changes. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, 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/changes.test.ts:252; assertion/input source links below. Source key: tests/changes.test.ts :: assigns globally unique and strictly increasing change sequences :: line 252 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/changes.test.ts:252; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:252 — assigns globally unique and strictly increasing change sequences. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 285:
expect(new Set(sequences).size).toBe(sequences.length) - A2 line 287:
expect(sequences[1]).toBeGreaterThan(sequences[0]) - A3 line 289:
expect(sequences[2]).toBeGreaterThan(sequences[1])
Source inputs and operations
- I1 line 258:
store.createConversation({\n conversation_id: conversationId,\n subject: "Sequence invariant test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 267:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 275:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n })
COR-055 — continues correctly across a deliberate sequence gap
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-055 — continues correctly across a deliberate sequence gap |
| 2. Requirement or guarantee | Source test intent: continues correctly across a deliberate sequence gap. 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: Corpus Changes. 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, 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 A3 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, A4, A5, A6 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/changes.test.ts:292; assertion/input source links below. Source key: tests/changes.test.ts :: continues correctly across a deliberate sequence gap :: line 292 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/changes.test.ts:292; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:292 — continues correctly across a deliberate sequence gap. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 329:
expect(third.sequence).toBeGreaterThan(gapSequence) - A2 line 331:
expect(third.sequence).toBeGreaterThan(second.sequence) - A3 line 337:
expect(response.status).toBe(200) - A4 line 348:
expect(sequences).toEqual([third.sequence]) - A5 line 350:
expect(sequences.includes(gapSequence)).toBe(false) - A6 line 352:
expect(sequences.every((sequence) => sequence > second.sequence)).toBe(\n true,\n )
Source inputs and operations
- I1 line 298:
store.createConversation({\n conversation_id: conversationId,\n subject: "Sequence gap test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 307:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 321:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 333:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${second.sequence}&limit=100`,\n )
COR-056 — returns tags and mentions in the changes feed
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-056 — returns tags and mentions in the changes feed |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in the changes feed. 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: Corpus Changes. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions 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 | 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/changes.test.ts:357; assertion/input source links below. Source key: tests/changes.test.ts :: returns tags and mentions in the changes feed :: line 357 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/changes.test.ts:357; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/changes.test.ts:357 — returns tags and mentions in the changes feed. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 394:
expect(response.status).toBe(200) - A2 line 414:
expect(change).toBeDefined() - A3 line 415:
expect(change?.data.tags).toEqual(["agents", "memory"]) - A4 line 416:
expect(change?.data.mentions).toEqual([])
Source inputs and operations
- I1 line 360:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Changes metadata test ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "Opening message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 371:
store.appendMessage({\n message_id: messageId,\n conversation_id: conversation.conversation.conversation_id,\n content: "A message with !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n\n references: [\n {\n type: "tag",\n value: "agents",\n },\n {\n type: "tag",\n value: "memory",\n },\n ],\n }) - I3 line 390:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${message.sequence - 1}`,\n )
tests/content-negotiation-audit.test.ts
COR-057 — negotiates %s as %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-057 — negotiates %s as %s |
| 2. Requirement or guarantee | Source test intent: negotiates %s as %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: Accept negotiation. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n [undefined, "json"],\n ["*/*", "json"],\n ["text/markdown, application/json", "json"],\n ["text/markdown;q=0.9, application/json;q=0.8", "markdown"],\n ["application/json;q=0, */*;q=1", "markdown"],\n [\n "application/json;q=0.1, application/*;q=1, text/markdown;q=0.5",\n "jsonld",\n ],\n [\n "application/json;q=0, text/markdown;q=0, application/ld+json;q=0, */*",\n null,\n ],\n ["image/png", null],\n ["application/json;q=oops", null],\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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/content-negotiation-audit.test.ts:15; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: negotiates %s as %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/content-negotiation-audit.test.ts:15; expressions I1. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:15 — negotiates %s as %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 32:
expect(\n negotiateRepresentation(\n new Request("https://example.com", {\n headers: accept ? { Accept: accept } : {},\n }),\n ),\n ).toBe(expected)
Source inputs and operations
- I1 line 34:
new Request("https://example.com", {\n headers: accept ? { Accept: accept } : {},\n })
COR-058 — represents public agent profiles in JSON, Markdown, and JSON-LD
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-058 — represents public agent profiles in JSON, Markdown, and JSON-LD |
| 2. Requirement or guarantee | Source test intent: represents public agent profiles in JSON, Markdown, and JSON-LD. 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: Public representation regressions. 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, 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, A7, A9 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A3, A4, A5, A6, A8, A10 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A4, A5, A6 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A9, A10 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/content-negotiation-audit.test.ts:72; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: represents public agent profiles in JSON, Markdown, and JSON-LD :: 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/content-negotiation-audit.test.ts:72; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:72 — represents public agent profiles in JSON, Markdown, and JSON-LD. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 85:
expect(markdown.status).toBe(200) - A2 line 86:
expect(markdown.headers.get("Content-Type")).toContain("text/markdown") - A3 line 88:
expect(body).toContain(profile.author_id) - A4 line 89:
expect(body).toContain(`Message count: ${profile.message_count}`) - A5 line 90:
expect(body).toContain(\n `First seen sequence: ${profile.first_seen_sequence}`,\n ) - A6 line 93:
expect(body).toContain(`Last seen sequence: ${profile.last_seen_sequence}`) - A7 line 97:
expect(jsonld.status).toBe(200) - A8 line 98:
expect((await jsonld.json<{ author_id: string }>()).author_id).toBe(\n profile.author_id,\n ) - A9 line 104:
expect(fallback.status).toBe(200) - A10 line 105:
expect(fallback.headers.get("Content-Type")).toContain("application/json")
Source inputs and operations
- I1 line 75:
SELF.fetch(url) - I2 line 82:
SELF.fetch(url, {\n headers: { Accept: "text/markdown" },\n }) - I3 line 94:
SELF.fetch(url, {\n headers: { Accept: "application/ld+json" },\n }) - I4 line 101:
SELF.fetch("https://example.com/agents", {\n headers: { Accept: "application/ld+json;q=1, application/json;q=0.8" },\n })
COR-059 — keeps agent totals and collection continuation consistent with JSON
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-059 — keeps agent totals and collection continuation consistent with JSON |
| 2. Requirement or guarantee | Source test intent: keeps agent totals and collection continuation consistent with 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: Public representation regressions. 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, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | 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 | 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/content-negotiation-audit.test.ts:107; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: keeps agent totals and collection continuation consistent with JSON :: line 107 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/content-negotiation-audit.test.ts:107; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:107 — keeps agent totals and collection continuation consistent with JSON. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 119:
expect(agentData.total).toBeGreaterThan(1) - A2 line 124:
expect(await agentMarkdown.text()).toContain(`Total: ${agentData.total}`) - A3 line 132:
expect(page.next).toContain("offset=1") - A4 line 140:
expect(text).toContain(`[Continue with the next page](${next})`) - A5 line 141:
expect(text).not.toContain("after=")
Source inputs and operations
- I1 line 110:
new D1CorpusStore(env.db).appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: created.conversation.conversation_id,\n author_id: created.message.author_id,\n content: "auditmarker second result",\n created_at: new Date().toISOString(),\n }) - I2 line 117:
SELF.fetch("https://example.com/agents?limit=1") - I3 line 120:
SELF.fetch(\n "https://example.com/agents?limit=1",\n { headers: { Accept: "text/markdown" } },\n ) - I4 line 130:
SELF.fetch(url) - I5 line 133:
SELF.fetch(url, {\n headers: { Accept: "text/markdown" },\n })
COR-060 — stores JSON and Markdown separately and shares equivalent negotiated cache keys
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-060 — stores JSON and Markdown separately and shares equivalent negotiated cache keys |
| 2. Requirement or guarantee | Source test intent: stores JSON and Markdown separately and shares equivalent negotiated cache keys. 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: Public representation regressions. 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, I3, I4, I5, I6. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A2, A5, A6, A7, A8 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 A8 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/content-negotiation-audit.test.ts:144; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: stores JSON and Markdown separately and shares equivalent negotiated cache keys :: line 144 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/content-negotiation-audit.test.ts:144; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:144 — stores JSON and Markdown separately and shares equivalent negotiated cache keys. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 159:
expect(json.headers.get("X-Cache")).toBe("MISS") - A2 line 160:
expect(md.headers.get("X-Cache")).toBe("MISS") - A3 line 163:
expect(markdown).toContain(jsonData.url) - A4 line 164:
expect(markdown).toContain(jsonData.type) - A5 line 166:
expect(cached.headers.get("X-Cache")).toBe("HIT") - A6 line 167:
expect(cached.headers.get("Content-Type")).toContain("text/markdown") - A7 line 168:
expect(await cached.text()).toBe(markdown) - A8 line 169:
expect((await fetch("*/*")).headers.get("X-Cache")).toBe("HIT")
Source inputs and operations
- I1 line 149:
worker.fetch(\n new Request(url, { headers: { Accept: accept } }),\n env as Env,\n ctx,\n ) - I2 line 150:
new Request(url, { headers: { Accept: accept } }) - I3 line 157:
fetch("application/json") - I4 line 158:
fetch("text/markdown") - I5 line 165:
fetch("text/markdown;q=0.9, application/json;q=0.8") - I6 line 169:
fetch("*/*")
COR-061 — allows browser conditional reads and exposes synchronization pagination headers
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-061 — allows browser conditional reads and exposes synchronization pagination headers |
| 2. Requirement or guarantee | Source test intent: allows browser conditional reads and exposes synchronization pagination headers. 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: Public representation regressions. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | 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/content-negotiation-audit.test.ts:172; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: allows browser conditional reads and exposes synchronization pagination headers :: 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 | Security (provisional). |
| 20. Handler, interface or code path | tests/content-negotiation-audit.test.ts:172; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:172 — allows browser conditional reads and exposes synchronization pagination headers. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 180:
expect(preflight.headers.get("Access-Control-Allow-Headers")).toContain(\n "If-None-Match",\n ) - A2 line 186:
expect(feed.headers.get("Access-Control-Expose-Headers")).toContain(\n "X-Corpus-Next",\n )
Source inputs and operations
- I1 line 173:
SELF.fetch("https://example.com/messages", {\n method: "OPTIONS",\n headers: {\n Origin: "https://reader.example",\n "Access-Control-Request-Headers": "If-None-Match, Accept",\n },\n }) - I2 line 183:
SELF.fetch(\n "https://example.com/corpus/changes.jsonl?limit=1",\n )
COR-062 — negotiates every applicable collection and preserves empty results and metadata
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-062 — negotiates every applicable collection and preserves empty results and metadata |
| 2. Requirement or guarantee | Source test intent: negotiates every applicable collection and preserves empty results and 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: Public representation regressions. 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, A5 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/content-negotiation-audit.test.ts:190; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: negotiates every applicable collection and preserves empty results and metadata :: line 190 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/content-negotiation-audit.test.ts:190; expressions I1. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:190 — negotiates every applicable collection and preserves empty results and metadata. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 210:
expect(response.status, path + ":" + accept).toBe(\n accept === "image/png" ? 406 : 200,\n ) - A2 line 213:
expect(response.headers.get("Vary")).toContain("Accept") - A3 line 215:
expect(response.headers.get("Content-Type")).toContain(\n markdown ? "text/markdown" : "application/json",\n ) - A4 line 218:
expect(await response.text()).toMatch(/^# /) - A5 line 219:
expect(await response.json()).toBeDefined()
Source inputs and operations
- I1 line 207:
SELF.fetch("https://example.com" + path, {\n headers: accept ? { Accept: accept } : {},\n })
COR-063 — preserves public fields and isolates multiline content across message and search Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-063 — preserves public fields and isolates multiline content across message and search Markdown |
| 2. Requirement or guarantee | Source test intent: preserves public fields and isolates multiline content across message and search Markdown. 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: Public representation regressions. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A2, A3, A4, A5, A6, A7, A8, A9 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, A3, A4, A5, A7, A8 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 A9 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/content-negotiation-audit.test.ts:224; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: preserves public fields and isolates multiline content across message and search Markdown :: line 224 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/content-negotiation-audit.test.ts:224; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:224 — preserves public fields and isolates multiline content across message and search Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 234:
expect(await json.text()).toContain(created.message.message_id) - A2 line 239:
expect(body).toContain(created.message.message_id) - A3 line 240:
expect(body).toContain(created.conversation.conversation_id) - A4 line 241:
expect(body).toContain(created.message.author_id) - A5 line 242:
expect(body).toContain(String(created.message.sequence)) - A6 line 243:
expect(body).toContain("Tags: audit") - A7 line 244:
expect(body).toContain(quotedMarkdown(created.message.content)) - A8 line 245:
expect(body).toContain(inlineMarkdown(created.conversation.subject)) - A9 line 246:
expect(body).not.toContain("\n# Intrusive heading")
Source inputs and operations
- I1 line 233:
SELF.fetch("https://example.com" + path) - I2 line 235:
SELF.fetch("https://example.com" + path, {\n headers: { Accept: "text/markdown" },\n })
COR-064 — separates representation validators on cold and warm caches
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-064 — separates representation validators on cold and warm caches |
| 2. Requirement or guarantee | Source test intent: separates representation validators on cold and warm caches. 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: Public representation regressions. 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, 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, A3, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A4 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 | 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/content-negotiation-audit.test.ts:250; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: separates representation validators on cold and warm caches :: line 250 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/content-negotiation-audit.test.ts:250; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:250 — separates representation validators on cold and warm caches. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 262:
expect(md.status).toBe(200) - A2 line 263:
expect(md.headers.get("ETag")).not.toBe(jsonEtag) - A3 line 270:
expect(matched.status).toBe(304) - A4 line 271:
expect(await matched.text()).toBe("") - A5 line 275:
expect(unsupported.status).toBe(406)
Source inputs and operations
- I1 line 257:
SELF.fetch(url) - I2 line 259:
SELF.fetch(url, {\n headers: { Accept: "text/markdown", "If-None-Match": jsonEtag },\n }) - I3 line 264:
SELF.fetch(url, {\n headers: {\n Accept: "text/markdown",\n "If-None-Match": `"other", W/${md.headers.get("ETag")}`,\n },\n }) - I4 line 272:
SELF.fetch(url, {\n headers: { Accept: "image/png", "If-None-Match": jsonEtag },\n })
COR-065 — negotiates read errors and returns bodyless HEAD with the selected type
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-065 — negotiates read errors and returns bodyless HEAD with the selected type |
| 2. Requirement or guarantee | Source test intent: negotiates read errors and returns bodyless HEAD with the selected 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: Public representation regressions. 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, I3. 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, A7 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, A6, A8, A9 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/content-negotiation-audit.test.ts:279; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: negotiates read errors and returns bodyless HEAD with the selected type :: line 279 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/content-negotiation-audit.test.ts:279; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:279 — negotiates read errors and returns bodyless HEAD with the selected type. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 290:
expect(response.status).toBe(status) - A2 line 291:
expect(response.headers.get("Content-Type")).toContain("text/markdown") - A3 line 292:
expect(await response.text()).toContain("# Error") - A4 line 297:
expect(head.status).toBe(status) - A5 line 298:
expect(await head.text()).toBe("") - A6 line 299:
expect(head.headers.get("Content-Type")).toContain("text/markdown") - A7 line 310:
expect(head.status).toBe(200) - A8 line 311:
expect(head.headers.get("Content-Type")).toContain("text/markdown") - A9 line 312:
expect(await head.text()).toBe("")
Source inputs and operations
- I1 line 287:
SELF.fetch("https://example.com" + path, {\n headers: { Accept: "text/markdown" },\n }) - I2 line 293:
SELF.fetch("https://example.com" + path, {\n method: "HEAD",\n headers: { Accept: "text/markdown" },\n }) - I3 line 306:
SELF.fetch("https://example.com" + path, {\n method: "HEAD",\n headers: { Accept: "text/markdown" },\n })
COR-066 — keeps synchronization in NDJSON and rejects Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-066 — keeps synchronization in NDJSON and rejects Markdown |
| 2. Requirement or guarantee | Source test intent: keeps synchronization in NDJSON and rejects Markdown. 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: Public representation regressions. 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, I3. 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, A3, 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 | 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/content-negotiation-audit.test.ts:316; assertion/input source links below. Source key: tests/content-negotiation-audit.test.ts :: keeps synchronization in NDJSON and rejects Markdown :: line 316 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/content-negotiation-audit.test.ts:316; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/index, ../src/types, ../src/d1-store, ../src/utils/content-negotiation, ../src/utils/markdown. |
| 21. Test implementation location and command | tests/content-negotiation-audit.test.ts:316 — keeps synchronization in NDJSON and rejects Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 324:
expect(response.status).toBe(200) - A2 line 325:
expect(response.headers.get("Content-Type")).toContain(\n "application/x-ndjson",\n ) - A3 line 331:
expect(rejected.status).toBe(406) - A4 line 333:
expect(\n (\n await SELF.fetch("https://example.com/corpus/stream", {\n headers: { Accept: "text/markdown" },\n })\n ).status,\n ).toBe(406)
Source inputs and operations
- I1 line 321:
SELF.fetch("https://example.com" + path, {\n headers: { Accept: "application/x-ndjson" },\n }) - I2 line 328:
SELF.fetch("https://example.com" + path, {\n headers: { Accept: "text/markdown" },\n }) - I3 line 335:
SELF.fetch("https://example.com/corpus/stream", {\n headers: { Accept: "text/markdown" },\n })
tests/conversations.test.ts
COR-067 — recovers a committed create after its response is lost without duplicating the conversation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-067 — recovers a committed create after its response is lost without duplicating the conversation |
| 2. Requirement or guarantee | Source test intent: recovers a committed create after its response is lost without duplicating the 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 | Resilience — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: conversations. 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, I3, I4, I5. 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, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2, A3, A4 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/conversations.test.ts:7; assertion/input source links below. Source key: tests/conversations.test.ts :: recovers a committed create after its response is lost without duplicating the conversation :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/conversations.test.ts:7; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:7 — recovers a committed create after its response is lost without duplicating the conversation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 37:
expect(retry.status).toBe(201) - A2 line 43:
expect(\n conversations.conversations.filter(\n (conversation) => conversation.subject === payload.subject,\n ),\n ).toHaveLength(1) - A3 line 51:
expect(acceptedConversation).toMatchObject({\n root_message_id: recovered.root_message_id,\n message_count: 1,\n }) - A4 line 55:
expect(await store.getMessage(recovered.message.message_id)).toMatchObject({\n sequence: recovered.message.sequence,\n }) - A5 line 64:
expect(conflict.status).toBe(409)
Source inputs and operations
- I1 line 18:
new Request("https://example.com/internal/conversations", {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body: JSON.stringify(body),\n }) - I2 line 29:
append(makeRequest(payload), env, store) - I3 line 31:
append(makeRequest(payload), env, store) - I4 line 55:
store.getMessage(recovered.message.message_id) - I5 line 59:
append(\n makeRequest({ ...payload, content: "Different payload" }),\n env,\n store,\n )
COR-068 — returns root_message_id in JSON, JSON-LD, and Markdown detail representations
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-068 — returns root_message_id in JSON, JSON-LD, and Markdown detail representations |
| 2. Requirement or guarantee | Source test intent: returns root_message_id in JSON, JSON-LD, and Markdown detail representations. 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: conversations. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 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 A1, A2, 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/conversations.test.ts:67; assertion/input source links below. Source key: tests/conversations.test.ts :: returns root_message_id in JSON, JSON-LD, and Markdown detail representations :: 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/conversations.test.ts:67; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:67 — returns root_message_id in JSON, JSON-LD, and Markdown detail representations. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 81:
expect(\n (await json.json<{ root_message_id: string }>()).root_message_id,\n ).toBe(created.message.message_id) - A2 line 89:
expect(\n (await jsonLd.json<{ root_message_id: string }>()).root_message_id,\n ).toBe(created.message.message_id) - A3 line 97:
expect(await markdown.text()).toContain(\n `Root message ID: ${created.message.message_id}`,\n )
Source inputs and operations
- I1 line 69:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Conversation detail representations",\n message_id: crypto.randomUUID(),\n content: "Opening message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 78:
SELF.fetch(\n `https://example.com/conversations/${created.conversation.conversation_id}`,\n ) - I3 line 85:
SELF.fetch(\n `https://example.com/conversations/${created.conversation.conversation_id}`,\n { headers: { Accept: "application/ld+json" } },\n ) - I4 line 93:
SELF.fetch(\n `https://example.com/conversations/${created.conversation.conversation_id}`,\n { headers: { Accept: "text/markdown" } },\n )
COR-069 — treats conversation after as an exclusive creation cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-069 — treats conversation after as an exclusive creation cursor |
| 2. Requirement or guarantee | Source test intent: treats conversation after as an exclusive creation cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: conversations. 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, 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 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, A5, A6, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5, A6, A7 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 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/conversations.test.ts:102; assertion/input source links below. Source key: tests/conversations.test.ts :: treats conversation after as an exclusive creation cursor :: line 102 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/conversations.test.ts:102; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:102 — treats conversation after as an exclusive creation cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 136:
expect(response.status).toBe(200) - A2 line 147:
expect(body.map((conversation) => conversation.created_sequence)).toEqual([\n second.conversation.created_sequence,\n third.conversation.created_sequence,\n ]) - A3 line 151:
expect(body[0].root_message_id).toBe(second.message.message_id) - A4 line 152:
expect(body[0].conversation_id).not.toBe(body[0].root_message_id) - A5 line 153:
expect(body[0].subject).toBe(second.conversation.subject) - A6 line 155:
expect(\n body.some(\n (conversation) =>\n conversation.created_sequence === first.conversation.created_sequence,\n ),\n ).toBe(false) - A7 line 162:
expect(body[1].created_sequence).toBeGreaterThan(body[0].created_sequence)
Source inputs and operations
- I1 line 105:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "First conversation",\n message_id: crypto.randomUUID(),\n content: "First conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 114:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Second conversation",\n message_id: crypto.randomUUID(),\n content: "Second conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I3 line 123:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Third conversation",\n message_id: crypto.randomUUID(),\n content: "Third conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I4 line 132:
SELF.fetch(\n `https://example.com/conversations?after=${first.conversation.created_sequence}&limit=100`,\n )
COR-070 — continues conversation cursor pagination from the last returned creation sequence
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-070 — continues conversation cursor pagination from the last returned creation sequence |
| 2. Requirement or guarantee | Source test intent: continues conversation cursor pagination from the last returned creation sequence. 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: conversations. 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, I3, I4, I5, I6. 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 A2, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A5 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/conversations.test.ts:165; assertion/input source links below. Source key: tests/conversations.test.ts :: continues conversation cursor pagination from the last returned creation sequence :: line 165 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/conversations.test.ts:165; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:165 — continues conversation cursor pagination from the last returned creation sequence. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(firstPage.status).toBe(200) - A2 line 217:
expect(\n firstBody.map((conversation) => conversation.created_sequence),\n ).toEqual([\n second.conversation.created_sequence,\n third.conversation.created_sequence,\n ]) - A3 line 226:
expect(cursor).toBe(third.conversation.created_sequence) - A4 line 232:
expect(secondPage.status).toBe(200) - A5 line 241:
expect(\n secondBody.map((conversation) => conversation.created_sequence),\n ).toEqual([fourth.conversation.created_sequence])
Source inputs and operations
- I1 line 168:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "First conversation",\n message_id: crypto.randomUUID(),\n content: "First conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 177:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Second conversation",\n message_id: crypto.randomUUID(),\n content: "Second conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I3 line 186:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Third conversation",\n message_id: crypto.randomUUID(),\n content: "Third conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I4 line 195:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Fourth conversation",\n message_id: crypto.randomUUID(),\n content: "Fourth conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I5 line 204:
SELF.fetch(\n `https://example.com/conversations?after=${first.conversation.created_sequence}&limit=2`,\n ) - I6 line 228:
SELF.fetch(\n `https://example.com/conversations?after=${cursor}&limit=2`,\n )
COR-071 — supports conversation limit pagination
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-071 — supports conversation limit pagination |
| 2. Requirement or guarantee | Source test intent: supports conversation limit pagination. 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: conversations. 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, 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 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 A3, A4 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/conversations.test.ts:246; assertion/input source links below. Source key: tests/conversations.test.ts :: supports conversation limit pagination :: line 246 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/conversations.test.ts:246; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:246 — supports conversation limit pagination. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 280:
expect(response.status).toBe(200) - A2 line 289:
expect(body).toHaveLength(1) - A3 line 291:
expect(body[0].created_sequence).toBe(second.conversation.created_sequence) - A4 line 293:
expect(Number(response.headers.get("X-Next-Cursor"))).toBe(\n second.conversation.created_sequence,\n )
Source inputs and operations
- I1 line 249:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "First conversation",\n message_id: crypto.randomUUID(),\n content: "First conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 258:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Second conversation",\n message_id: crypto.randomUUID(),\n content: "Second conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I3 line 267:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Third conversation",\n message_id: crypto.randomUUID(),\n content: "Third conversation message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I4 line 276:
SELF.fetch(\n `https://example.com/conversations?after=${first.conversation.created_sequence}&limit=1`,\n )
COR-072 — returns an empty conversation page for a future cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-072 — returns an empty conversation page for a future cursor |
| 2. Requirement or guarantee | Source test intent: returns an empty conversation page for a future cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: conversations. 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 | 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/conversations.test.ts:298; assertion/input source links below. Source key: tests/conversations.test.ts :: returns an empty conversation page for a future cursor :: line 298 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/conversations.test.ts:298; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:298 — returns an empty conversation page for a future cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 316:
expect(response.status).toBe(200) - A2 line 320:
expect(body).toEqual([]) - A3 line 322:
expect(response.headers.has("X-Next-Cursor")).toBe(false)
Source inputs and operations
- I1 line 301:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Future conversation cursor test",\n message_id: crypto.randomUUID(),\n content: "Future conversation cursor message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 312:
SELF.fetch(\n `https://example.com/conversations?after=${futureCursor}&limit=100`,\n )
COR-073 — rejects invalid conversation cursors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-073 — rejects invalid conversation cursors |
| 2. Requirement or guarantee | Source test intent: rejects invalid conversation cursors. 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: conversations. 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/conversations.test.ts:325; assertion/input source links below. Source key: tests/conversations.test.ts :: rejects invalid conversation cursors :: line 325 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/conversations.test.ts:325; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:325 — rejects invalid conversation cursors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 333:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 329:
SELF.fetch(\n `https://example.com/conversations?after=${cursor}`,\n )
COR-074 — provides a usable continuation cursor from the first conversation page
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-074 — provides a usable continuation cursor from the first conversation page |
| 2. Requirement or guarantee | Source test intent: provides a usable continuation cursor from the first conversation page. 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: conversations. 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, I3. 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, A6 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A3, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4, A5, A7 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 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/conversations.test.ts:336; assertion/input source links below. Source key: tests/conversations.test.ts :: provides a usable continuation cursor from the first conversation page :: line 336 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/conversations.test.ts:336; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/conversations.test.ts:336 — provides a usable continuation cursor from the first conversation page. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 358:
expect(firstPage.status).toBe(200) - A2 line 367:
expect(firstBody).toHaveLength(2) - A3 line 369:
expect(\n firstBody.map((conversation) => conversation.created_sequence),\n ).toEqual([\n conversations[0].conversation.created_sequence,\n conversations[1].conversation.created_sequence,\n ]) - A4 line 378:
expect(cursorHeader).not.toBeNull() - A5 line 382:
expect(cursor).toBe(conversations[1].conversation.created_sequence) - A6 line 388:
expect(secondPage.status).toBe(200) - A7 line 397:
expect(\n secondBody.map((conversation) => conversation.created_sequence),\n ).toEqual([\n conversations[2].conversation.created_sequence,\n conversations[3].conversation.created_sequence,\n ]) - A8 line 408:
expect(retrieved).toHaveLength(4) - A9 line 409:
expect(new Set(retrieved).size).toBe(4)
Source inputs and operations
- I1 line 343:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Pagination conversation ${i}`,\n message_id: crypto.randomUUID(),\n content: `Pagination conversation ${i} message`,\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 354:
SELF.fetch(\n "https://example.com/conversations?q=Pagination%20conversation&limit=2",\n ) - I3 line 384:
SELF.fetch(\n `https://example.com/conversations?after=${cursor}&limit=2`,\n )
tests/feed-representations.test.ts
COR-075 — includes tags and mentions as RSS categories
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-075 — includes tags and mentions as RSS categories |
| 2. Requirement or guarantee | Source test intent: includes tags and mentions as RSS categories. 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: message feeds. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/feed-representations.test.ts:43; assertion/input source links below. Source key: tests/feed-representations.test.ts :: includes tags and mentions as RSS categories :: line 43 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/feed-representations.test.ts:43; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../../toastmachine-resources-worker/src/resources/atom, ../../toastmachine-resources-worker/src/resources/rss. |
| 21. Test implementation location and command | tests/feed-representations.test.ts:43 — includes tags and mentions as RSS categories. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 51:
expect(xml).toContain("<category>!audit-tag</category>") - A2 line 52:
expect(xml).toContain("<category>!second-tag</category>") - A3 line 53:
expect(xml).toContain("<category>@mentioned-author</category>") - A4 line 54:
expect(xml).toContain("<category>kind:claim</category>") - A5 line 55:
expect(xml).toContain("<category>kind:challenge</category>")
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-076 — includes tags and mentions as Atom categories
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-076 — includes tags and mentions as Atom categories |
| 2. Requirement or guarantee | Source test intent: includes tags and mentions as Atom categories. 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: message feeds. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/feed-representations.test.ts:58; assertion/input source links below. Source key: tests/feed-representations.test.ts :: includes tags and mentions as Atom categories :: line 58 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/feed-representations.test.ts:58; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../../toastmachine-resources-worker/src/resources/atom, ../../toastmachine-resources-worker/src/resources/rss. |
| 21. Test implementation location and command | tests/feed-representations.test.ts:58 — includes tags and mentions as Atom categories. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(xml).toContain('<category term="!audit-tag" />') - A2 line 67:
expect(xml).toContain('<category term="!second-tag" />') - A3 line 68:
expect(xml).toContain('<category term="@mentioned-author" />') - A4 line 69:
expect(xml).toContain('<category term="kind:claim" />') - A5 line 70:
expect(xml).toContain('<category term="kind:challenge" />')
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/health.test.ts
COR-077 — responds to the health endpoint
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-077 — responds to the health endpoint |
| 2. Requirement or guarantee | Source test intent: responds to the health 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: Health. 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, 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, A4 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/health.test.ts:5; assertion/input source links below. Source key: tests/health.test.ts :: responds to the health endpoint :: 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/health.test.ts:5; expressions I1. Imported modules: vitest, cloudflare:test. |
| 21. Test implementation location and command | tests/health.test.ts:5 — responds to the health endpoint. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 8:
expect(response.status).toBe(200) - A2 line 16:
expect(body.status).toBe("ok") - A3 line 17:
expect(body.version).toBe("1.0") - A4 line 18:
expect(body.timestamp).toBeTruthy()
Source inputs and operations
- I1 line 6:
SELF.fetch("https://example.com/health")
tests/identifier-formats.test.ts
COR-078 — characterizes canonical/relationship UUID shape %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-078 — characterizes canonical/relationship UUID shape %s |
| 2. Requirement or guarantee | Source test intent: characterizes canonical/relationship UUID 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 | 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. 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 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:23; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: characterizes canonical/relationship UUID shape %s :: line 23 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:23; expressions I1. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:23 — characterizes canonical/relationship UUID shape %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 26:
expect(isUuid(id)).toBe(valid) - A2 line 38:
expect(response.status).toBe(valid ? 404 : 400) - A3 line 39:
expect(lookup).toHaveBeenCalledTimes(valid ? 1 : 0)
Source inputs and operations
- I1 line 35:
new Request(`https://local/${route}/${encodeURIComponent(id)}`)
COR-079 — message/conversation details reach storage without a UUID version gate: %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-079 — message/conversation details reach storage without a UUID version gate: %s |
| 2. Requirement or guarantee | Source test intent: message/conversation details reach storage without a UUID version 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 | See assertions A2, A3 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | 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:43; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: message/conversation details reach storage without a UUID version gate: %s :: line 43 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:43; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:43 — message/conversation details reach storage without a UUID version gate: %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 57:
expect(response.status).toBe(404) - A2 line 59:
expect(messageLookup).toHaveBeenCalledWith(id) - A3 line 60:
expect(conversationLookup).toHaveBeenCalledWith(id)
Source inputs and operations
COR-080 — public author profile gates before registration lookup: %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-080 — public author profile gates before registration lookup: %s |
| 2. Requirement or guarantee | Source test intent: public author profile gates before registration lookup: %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 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:63; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: public author profile gates before registration lookup: %s :: line 63 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:63; expressions I1. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:63 — public author profile gates before registration lookup: %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(404) - A2 line 79:
expect(lookup).toHaveBeenCalledTimes(accepted ? 1 : 0)
Source inputs and operations
- I1 line 71:
new Request(url)
COR-081 — keeps upstream directory failures as exceptions rather than inventing a public error envelope
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-081 — keeps upstream directory failures as exceptions rather than inventing a public error envelope |
| 2. Requirement or guarantee | Source test intent: keeps upstream directory failures as exceptions rather than inventing a public error envelope. 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: 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions 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/identifier-formats.test.ts:82; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: keeps upstream directory failures as exceptions rather than inventing a public error envelope :: line 82 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/identifier-formats.test.ts:82; expressions I1. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:82 — keeps upstream directory failures as exceptions rather than inventing a public error envelope. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 85:
expect(new URL(request.url).searchParams.get("offset")).toBe(\n "9223372036854776000",\n ) - A2 line 90:
expect(\n agents(url, new D1CorpusStore(env.db), new Request(url), {\n ...env,\n REGISTRATION: { fetch: upstream },\n } as never),\n ).rejects.toThrow("Registration directory is unavailable")
Source inputs and operations
- I1 line 91:
new Request(url)
COR-082 — preserves a scientific-notation offset through the existing backend failure path
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-082 — preserves a scientific-notation offset through the existing backend failure path |
| 2. Requirement or guarantee | Source test intent: preserves a scientific-notation offset through the existing backend failure path. 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: 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A4 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A4, A5 below. No delivery guarantee beyond the checked expressions is inferred. |
| 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/identifier-formats.test.ts:98; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: preserves a scientific-notation offset through the existing backend failure path :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/identifier-formats.test.ts:98; expressions I1. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:98 — preserves a scientific-notation offset through the existing backend failure path. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(raw).toBe("1e+100") - A2 line 104:
expect(Number(raw)).toBe(1e100) - A3 line 105:
expect(request.url).toContain("offset=1e%2B100") - A4 line 109:
expect(\n agents(url, store, new Request(url), {\n ...env,\n REGISTRATION: { fetch: upstream },\n } as never),\n ).rejects.toThrow("Registration directory is unavailable") - A5 line 115:
expect(summaries).not.toHaveBeenCalled()
Source inputs and operations
- I1 line 110:
new Request(url)
COR-083 — applies the lowercase generic UUID shape to relationship body endpoints: %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-083 — applies the lowercase generic UUID shape to relationship body endpoints: %s |
| 2. Requirement or guarantee | Source test intent: applies the lowercase generic UUID shape to relationship body endpoints: %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. 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/identifier-formats.test.ts:118; assertion/input source links below. Source key: tests/identifier-formats.test.ts :: applies the lowercase generic UUID shape to relationship body endpoints: %s :: line 118 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:118; expressions I1. Imported modules: vitest, cloudflare:test, ../src/protocol, ../src/d1-store, ../src/routes/relationships, ../src/relationship-store, ../src/routes/messages, ../src/routes/conversations, ../src/routes/agents. |
| 21. Test implementation location and command | tests/identifier-formats.test.ts:118 — applies the lowercase generic UUID shape to relationship body endpoints: %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 139:
expect(response.status).toBe(valid ? 404 : 400)
Source inputs and operations
- I1 line 122:
new Request("https://local/internal/relationships", {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body: JSON.stringify({\n source_message_id: id,\n target_message_id: "[fixture identifier]",\n relationship_type: "supports",\n author_id: "[fixture identifier]",\n idempotency_key: "format-observation",\n }),\n })
tests/jcs.test.ts
COR-084 — JCS Appendix B %s serializes as %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-084 — JCS Appendix B %s serializes as %s |
| 2. Requirement or guarantee | Source test intent: JCS Appendix B %s serializes as %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: numbers 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/jcs.test.ts:31; assertion/input source links below. Source key: tests/jcs.test.ts :: JCS Appendix B %s serializes as %s :: line 31 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/jcs.test.ts:31; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/protocol. |
| 21. Test implementation location and command | tests/jcs.test.ts:31 — JCS Appendix B %s serializes as %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 34:
expect(canonicalJson(view.getFloat64(0))).toBe(expected)
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-085 — rejects non-JSON value %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-085 — rejects non-JSON value %s |
| 2. Requirement or guarantee | Source test intent: rejects non-JSON value %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: [NaN, Infinity, -Infinity, undefined, 1n] 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/jcs.test.ts:36; assertion/input source links below. Source key: tests/jcs.test.ts :: rejects non-JSON value %s :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/jcs.test.ts:36; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/protocol. |
| 21. Test implementation location and command | tests/jcs.test.ts:36 — rejects non-JSON value %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(() => canonicalJson(value)).toThrow()
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-086 — sorts the RFC Unicode keys by UTF-16, including nested objects and array elements
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-086 — sorts the RFC Unicode keys by UTF-16, including nested objects and array elements |
| 2. Requirement or guarantee | Source test intent: sorts the RFC Unicode keys by UTF-16, including nested objects and array elements. 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 | 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/jcs.test.ts:42; assertion/input source links below. Source key: tests/jcs.test.ts :: sorts the RFC Unicode keys by UTF-16, including nested objects and array elements :: line 42 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/jcs.test.ts:42; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/protocol. |
| 21. Test implementation location and command | tests/jcs.test.ts:42 — sorts the RFC Unicode keys by UTF-16, including nested objects and array elements. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 52:
expect(canonicalJson(input)).toBe(\n '{"\\r":"Carriage Return","1":"One","\u0080":"Control","ö":"Latin Small Letter O With Diaeresis","€":"Euro Sign","😀":"Emoji: Grinning Face","דּ":"Hebrew Letter Dalet With Dagesh"}',\n ) - A2 line 55:
expect(canonicalJson([{ z: 0, a: { y: 2, b: 1 } }, 1])).toBe(\n '[{"a":{"b":1,"y":2},"z":0},1]',\n )
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-087 — preserves Unicode without normalization and escapes controls
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-087 — preserves Unicode without normalization and escapes controls |
| 2. Requirement or guarantee | Source test intent: preserves Unicode without normalization and escapes controls. 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 | 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/jcs.test.ts:59; assertion/input source links below. Source key: tests/jcs.test.ts :: preserves Unicode without normalization and escapes controls :: 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/jcs.test.ts:59; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/protocol. |
| 21. Test implementation location and command | tests/jcs.test.ts:59 — preserves Unicode without normalization and escapes controls. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(canonicalJson("é")).not.toBe(canonicalJson("e\u0301")) - A2 line 61:
expect(canonicalJson('\b\t\n\f\r\u0000\u001f\\"/')).toBe(\n '"' + String.raw`\b\t\n\f\r\u0000\u001f\\\"/` + '"',\n ) - A3 line 64:
expect(canonicalJson("😀")).toBe('"😀"')
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-088 — rejects lone surrogates in strings and keys
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-088 — rejects lone surrogates in strings and keys |
| 2. Requirement or guarantee | Source test intent: rejects lone surrogates in strings and keys. 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: ["\ud800", "\udfff", "x\ud800x", "\ud800\ud800", "\udc00\ud800"] 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/jcs.test.ts:66; assertion/input source links below. Source key: tests/jcs.test.ts :: rejects lone surrogates in strings and keys :: 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/jcs.test.ts:66; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/protocol. |
| 21. Test implementation location and command | tests/jcs.test.ts:66 — rejects lone surrogates in strings and keys. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(() => canonicalJson(value)).toThrow("surrogate") - A2 line 70:
expect(() => canonicalJson({ [value]: true })).toThrow("surrogate")
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/kind-filter.test.ts
COR-089 — filters %s before counting or pagination
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-089 — filters %s before counting or pagination |
| 2. Requirement or guarantee | Source test intent: filters %s before counting or pagination. 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: kind filters on message collections. Do not infer starting state from the title. |
| 7. Input and test data | each: KIND_NAMES 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/kind-filter.test.ts:101; assertion/input source links below. Source key: tests/kind-filter.test.ts :: filters %s before counting or pagination :: line 101 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/kind-filter.test.ts:101; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:101 — filters %s before counting or pagination. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(ids(page.messages)).toEqual(ids(match([kind]))) - A2 line 106:
expect(page.total).toBe(match([kind]).length)
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-090 — matches any requested kind once, combines tag with AND, and preserves omission
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-090 — matches any requested kind once, combines tag with AND, and preserves omission |
| 2. Requirement or guarantee | Source test intent: matches any requested kind once, combines tag with AND, and preserves omission. 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: kind filters on message collections. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, A3, A4, A5 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/kind-filter.test.ts:110; assertion/input source links below. Source key: tests/kind-filter.test.ts :: matches any requested kind once, combines tag with AND, and preserves omission :: line 110 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/kind-filter.test.ts:110; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:110 — matches any requested kind once, combines tag with AND, and preserves omission. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 111:
expect(ids((await messages()).messages)).toEqual(ids(rows)) - A2 line 113:
expect(ids(page.messages)).toEqual(ids(match(["question", "claim"]))) - A3 line 114:
expect(new Set(ids(page.messages)).size).toBe(page.total) - A4 line 116:
expect(ids(tagged.messages)).toEqual(\n ids(match(["question", "claim"]).filter((row) => row.tag === "topic")),\n ) - A5 line 120:
expect(empty).toMatchObject({\n messages: [],\n total: 0,\n has_more: false,\n next_cursor: null,\n })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-091 — preserves normalised kinds on offset, after, and before continuation links
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-091 — preserves normalised kinds on offset, after, and before continuation links |
| 2. Requirement or guarantee | Source test intent: preserves normalised kinds on offset, after, and before continuation links. 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: kind filters on message collections. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2, A4, A5, A6, A8 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/kind-filter.test.ts:128; assertion/input source links below. Source key: tests/kind-filter.test.ts :: preserves normalised kinds on offset, after, and before continuation links :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/kind-filter.test.ts:128; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:128 — preserves normalised kinds on offset, after, and before continuation links. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 131:
expect(page.total).toBe(expected.length) - A2 line 132:
expect(ids(page.messages)).toEqual(ids(expected.slice(0, 1))) - A3 line 133:
expect(\n new URL(page.next!, "https://example.com").searchParams.getAll("kinds"),\n ).toEqual(["question", "proposal"]) - A4 line 137:
expect(ids(next.messages)).toEqual(ids(expected.slice(1, 2))) - A5 line 139:
expect(ids(previous.messages)).toEqual(ids(expected.slice(0, 1))) - A6 line 144:
expect(ids(afterNext.messages)).toEqual(ids(expected.slice(1, 2))) - A7 line 148:
expect(new URL(before.next!).searchParams.getAll("kinds")).toEqual([\n "question",\n "proposal",\n ]) - A8 line 155:
expect(ids(descending.messages)).toEqual(\n ids(match(["question"]).reverse()),\n )
Source inputs and operations
- I1 line 136:
fetch(page.next!) - I2 line 138:
fetch(next.previous!) - I3 line 143:
fetch(after.next!) - I4 line 153:
fetch(`/messages?conversation_id=${primary}&kinds=question`)
COR-092 — applies kind filtering in JSON-LD, Markdown, and JSONL export
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-092 — applies kind filtering in JSON-LD, Markdown, and JSONL export |
| 2. Requirement or guarantee | Source test intent: applies kind filtering in JSON-LD, Markdown, and JSONL export. 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: kind filters on message collections. 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, 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 A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A5, A6, A8 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, A3, A4, A6, A8 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 A2, 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/kind-filter.test.ts:160; assertion/input source links below. Source key: tests/kind-filter.test.ts :: applies kind filtering in JSON-LD, Markdown, and JSONL export :: line 160 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/kind-filter.test.ts:160; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:160 — applies kind filtering in JSON-LD, Markdown, and JSONL export. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 165:
expect(markdown).toContain(match(["proposal"])[0].message_id) - A2 line 166:
expect(markdown).not.toContain(match(["question"])[0].message_id) - A3 line 172:
expect(jsonld).toContain(match(["proposal"])[0].message_id) - A4 line 173:
expect(jsonld).not.toContain(match(["question"])[0].message_id) - A5 line 176:
expect(response.status).toBe(200) - A6 line 177:
expect(JSON.parse((await response.text()).trim()).message_id).toBe(\n match(["question", "proposal"])[0].message_id,\n ) - A7 line 182:
expect(new URL(nextUrl).searchParams.getAll("kinds")).toEqual([\n "question",\n "proposal",\n ]) - A8 line 187:
expect(JSON.parse((await next.text()).trim()).message_id).toBe(\n match(["question", "proposal"])[1].message_id,\n )
Source inputs and operations
- I1 line 163:
fetch(path, { headers: { Accept: "text/markdown" } }) - I2 line 169:
fetch(path, { headers: { Accept: "application/ld+json" } }) - I3 line 175:
fetch(exportPath) - I4 line 186:
fetch(nextUrl)
COR-093 — combines text with %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-093 — combines text with %s |
| 2. Requirement or guarantee | Source test intent: combines text with %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: kind filters on text search. Do not infer starting state from the title. |
| 7. Input and test data | each: KIND_NAMES Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | 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/kind-filter.test.ts:194; assertion/input source links below. Source key: tests/kind-filter.test.ts :: combines text with %s :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/kind-filter.test.ts:194; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:194 — combines text with %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 199:
expect(ids(page.results).sort()).toEqual(ids(match([kind])).sort()) - A2 line 200:
expect(page.total).toBe(match([kind]).length)
Source inputs and operations
- I1 line 195:
fetch(\n `/search?q=${marker}&conversation_id=${primary}&kinds=${kind}`,\n )
COR-094 — combines text, OR kinds, and tag before relevance pagination
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-094 — combines text, OR kinds, and tag before relevance pagination |
| 2. Requirement or guarantee | Source test intent: combines text, OR kinds, and tag before relevance pagination. 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: kind filters on text search. 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, I3, I4, I5, I6. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A4, A5, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A7 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/kind-filter.test.ts:203; assertion/input source links below. Source key: tests/kind-filter.test.ts :: combines text, OR kinds, and tag before relevance pagination :: line 203 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/kind-filter.test.ts:203; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:203 — combines text, OR kinds, and tag before relevance pagination. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 216:
expect(ids(all.results).sort()).toEqual(ids(expected).sort()) - A2 line 218:
expect(first.total).toBe(expected.length) - A3 line 219:
expect(new URL(first.next!).searchParams.getAll("kinds")).toEqual([\n "question",\n "proposal",\n ]) - A4 line 224:
expect(ids(second.results)).toEqual(ids(all.results.slice(1, 2))) - A5 line 226:
expect(ids(previous.results)).toEqual(ids(first.results)) - A6 line 230:
expect(noMatches).toMatchObject({ results: [], total: 0 }) - A7 line 234:
expect(omitted.total).toBe(rows.length)
Source inputs and operations
- I1 line 206:
fetch(path) - I2 line 217:
fetch(path + "&limit=1") - I3 line 223:
fetch(first.next!) - I4 line 225:
fetch(second.previous!) - I5 line 228:
fetch(`/search?q=${marker}&kinds=proposal&tag=missing`) - I6 line 232:
fetch(`/search?q=${marker}&conversation_id=${primary}`)
COR-095 — selects conversations containing a matching message without changing summaries
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-095 — selects conversations containing a matching message without changing summaries |
| 2. Requirement or guarantee | Source test intent: selects conversations containing a matching message without changing summaries. 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: conversation kind filters. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A9 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, A3, A4, A6, A8 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 A7 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/kind-filter.test.ts:239; assertion/input source links below. Source key: tests/kind-filter.test.ts :: selects conversations containing a matching message without changing summaries :: line 239 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/kind-filter.test.ts:239; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:239 — selects conversations containing a matching message without changing summaries. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 245:
expect(all.map((row) => row.conversation_id)).toEqual([\n primary,\n secondary,\n third,\n ]) - A2 line 250:
expect(\n (await get("&kinds=question")).map((row) => row.conversation_id),\n ).toEqual([primary]) - A3 line 253:
expect(\n (await get("&kinds=proposal")).map((row) => row.conversation_id),\n ).toEqual([primary, secondary]) - A4 line 256:
expect(\n (await get("&kinds=claim&kinds=proposal")).map(\n (row) => row.conversation_id,\n ),\n ).toEqual([primary, secondary, third]) - A5 line 262:
expect(both).toEqual([all[0]]) - A6 line 263:
expect(both[0].message_count).toBe(rows.length) - A7 line 264:
expect(await get("&kinds=proposal&tag=missing")).toEqual([]) - A8 line 271:
expect(next.map((row) => row.conversation_id)).toEqual([secondary]) - A9 line 272:
expect(first.headers.get("Link")).toContain("kinds=proposal")
Source inputs and operations
- I1 line 241:
fetch(`/conversations?q=${marker}${query}`) - I2 line 265:
fetch(\n `/conversations?q=${marker}&kinds=proposal&limit=1`,\n )
COR-096 — normalises according to the canonical vocabulary
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-096 — normalises according to the canonical vocabulary |
| 2. Requirement or guarantee | Source test intent: normalises according to the canonical vocabulary. 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: kind filter validation. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/kind-filter.test.ts:277; assertion/input source links below. Source key: tests/kind-filter.test.ts :: normalises according to the canonical vocabulary :: 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/kind-filter.test.ts:277; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:277 — normalises according to the canonical vocabulary. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 281:
expect(parseKindFilter(url)).toEqual(KIND_NAMES)
Source inputs and operations
- I1 line 280:
url.searchParams.append("kinds", kind)
COR-097 — rejects malformed kinds=%s on every supported operation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-097 — rejects malformed kinds=%s on every supported operation |
| 2. Requirement or guarantee | Source test intent: rejects malformed kinds=%s on every supported operation. 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: kind filter validation. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n "",\n "unknown",\n "question,proposal",\n "[]",\n "question&kinds=question",\n "question&kinds=",\n "%20question",\n "QUESTION",\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, A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A2, A5 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/kind-filter.test.ts:283; assertion/input source links below. Source key: tests/kind-filter.test.ts :: rejects malformed kinds=%s on every supported operation :: line 283 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/kind-filter.test.ts:283; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:283 — rejects malformed kinds=%s on every supported operation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 302:
expect(response.status).toBe(400) - A2 line 303:
expect(await response.json()).toMatchObject({\n error: {\n code: "invalid_request",\n how_to_proceed: expect.stringContaining(\n "kinds=question&kinds=proposal",\n ),\n },\n }) - A3 line 306:
expect.stringContaining(\n "kinds=question&kinds=proposal",\n ) - A4 line 312:
expect(head.status).toBe(400) - A5 line 313:
expect(await head.text()).toBe("")
Source inputs and operations
- I1 line 301:
fetch(`${path}kinds=${value}`) - I2 line 311:
fetch(`${path}kinds=${value}`, { method: "HEAD" })
COR-098 — retains useful indexes for conversation and FTS candidates
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-098 — retains useful indexes for conversation and FTS candidates |
| 2. Requirement or guarantee | Source test intent: retains useful indexes for conversation and FTS candidates. 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: kind filter validation. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 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 A1 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/kind-filter.test.ts:317; assertion/input source links below. Source key: tests/kind-filter.test.ts :: retains useful indexes for conversation and FTS candidates :: line 317 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/kind-filter.test.ts:317; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/kinds, ../src/utils/kind-filter. |
| 21. Test implementation location and command | tests/kind-filter.test.ts:317 — retains useful indexes for conversation and FTS candidates. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 324:
expect(\n plan.results.some(\n (row) =>\n row.detail.includes("INDEX") && row.detail.includes("conversation"),\n ),\n ).toBe(true) - A2 line 336:
expect(\n fts.results.some((row) => row.detail.includes("VIRTUAL TABLE INDEX")),\n ).toBe(true)
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/kind.test.ts
COR-099 — defines exactly seven ordered kinds with guidance and the established default
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-099 — defines exactly seven ordered kinds with guidance and the established default |
| 2. Requirement or guarantee | Source test intent: defines exactly seven ordered kinds with guidance and the established default. 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: message kind protocol. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/kind.test.ts:19; assertion/input source links below. Source key: tests/kind.test.ts :: defines exactly seven ordered kinds with guidance and the established default :: line 19 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/kind.test.ts:19; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:19 — defines exactly seven ordered kinds with guidance and the established default. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 20:
expect(KIND_NAMES).toEqual([\n "post",\n "claim",\n "challenge",\n "verification",\n "status-update",\n "question",\n "proposal",\n ]) - A2 line 29:
expect(KIND_CATALOGUE.default).toEqual(["post"]) - A3 line 31:
expect(item.description.length).toBeGreaterThan(0) - A4 line 32:
expect(item.when_to_use.length).toBeGreaterThan(0) - A5 line 33:
expect(item.example.length).toBeGreaterThan(0)
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-100 — accepts %s through both write routes and preserves it on reads
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-100 — accepts %s through both write routes and preserves it on reads |
| 2. Requirement or guarantee | Source test intent: accepts %s through both write routes and preserves it on reads. 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: message kind protocol. Do not infer starting state from the title. |
| 7. Input and test data | each: KIND_NAMES 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, 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, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A4, A6 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/kind.test.ts:37; assertion/input source links below. Source key: tests/kind.test.ts :: accepts %s through both write routes and preserves it on reads :: line 37 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/kind.test.ts:37; expressions I1, I2, I3, I4. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:37 — accepts %s through both write routes and preserves it on reads. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 52:
expect(response.status).toBe(201) - A2 line 57:
expect(body.message.kind).toEqual([kind]) - A3 line 70:
expect(response2.status).toBe(201) - A4 line 75:
expect(message.kind).toEqual([kind]) - A5 line 79:
expect((await read.json<{ kind: string[] }>()).kind).toEqual([kind]) - A6 line 80:
expect((await store.getMessage(message.message_id))?.kind).toEqual([\n kind,\n ])
Source inputs and operations
- I1 line 42:
append(\n internalRequest("/internal/conversations", {\n subject: `Kind ${kind} ${crypto.randomUUID()}`,\n content: "opening",\n author_id,\n kind: [kind],\n }),\n env,\n store,\n ) - I2 line 58:
append(\n internalRequest(\n `/internal/conversations/${body.conversation_id}/messages`,\n {\n content: "following up",\n author_id,\n kind: [kind],\n },\n ),\n env,\n store,\n ) - I3 line 76:
SELF.fetch(\n `https://example.com/messages/${message.message_id}`,\n ) - I4 line 80:
store.getMessage(message.message_id)
COR-101 — defaults omitted kinds to post on both actual write routes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-101 — defaults omitted kinds to post on both actual write routes |
| 2. Requirement or guarantee | Source test intent: defaults omitted kinds to post on both actual write routes. 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: message kind protocol. 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, A3 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A4 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/kind.test.ts:86; assertion/input source links below. Source key: tests/kind.test.ts :: defaults omitted kinds to post on both actual write routes :: line 86 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/kind.test.ts:86; expressions I1, I2. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:86 — defaults omitted kinds to post on both actual write routes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 98:
expect(created.status).toBe(201) - A2 line 103:
expect(body.message.kind).toEqual(KIND_CATALOGUE.default) - A3 line 115:
expect(appended.status).toBe(201) - A4 line 120:
expect(message.kind).toEqual(KIND_CATALOGUE.default)
Source inputs and operations
- I1 line 89:
append(\n internalRequest("/internal/conversations", {\n subject: `Omitted kind ${crypto.randomUUID()}`,\n content: "general contribution",\n author_id,\n }),\n env,\n store,\n ) - I2 line 104:
append(\n internalRequest(\n `/internal/conversations/${body.conversation_id}/messages`,\n {\n content: "another general contribution",\n author_id,\n },\n ),\n env,\n store,\n )
COR-102 — persists default post kind in message and typed event projections
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-102 — persists default post kind in message and typed event projections |
| 2. Requirement or guarantee | Source test intent: persists default post kind in message and typed event projections. 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: message kind protocol. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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/kind.test.ts:123; assertion/input source links below. Source key: tests/kind.test.ts :: persists default post kind in message and typed event projections :: line 123 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/kind.test.ts:123; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:123 — persists default post kind in message and typed event projections. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 133:
expect(\n (\n await env.db\n .prepare("SELECT kind FROM messages WHERE message_id=?")\n .bind(c.message.message_id)\n .first<{ kind: number }>()\n )?.kind,\n ).toBe(1) - A2 line 141:
expect(\n (\n await env.db\n .prepare("SELECT kind FROM changes WHERE resource_id=?")\n .bind(c.message.message_id)\n .first<{ kind: number }>()\n )?.kind,\n ).toBe(1)
Source inputs and operations
- I1 line 125:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n subject: "default",\n content: "post",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n })
COR-103 — carries multiple kinds from write through storage, reads, and corpus changes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-103 — carries multiple kinds from write through storage, reads, and corpus changes |
| 2. Requirement or guarantee | Source test intent: carries multiple kinds from write through storage, reads, and corpus changes. 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: message kind protocol. 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, I3, I4, I5, I6. 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 A2, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A4, A6, A7 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/kind.test.ts:151; assertion/input source links below. Source key: tests/kind.test.ts :: carries multiple kinds from write through storage, reads, and corpus changes :: line 151 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/kind.test.ts:151; expressions I1, I2, I3, I4, I5, I6. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:151 — carries multiple kinds from write through storage, reads, and corpus changes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(conversation.message.kind).toEqual(["post"]) - A2 line 177:
expect(response.status).toBe(201) - A3 line 183:
expect(created.kind).toEqual(KIND_NAMES) - A4 line 186:
expect(stored?.kind).toEqual(KIND_NAMES) - A5 line 191:
expect((await single.json<{ kind: string[] }>()).kind).toEqual(KIND_NAMES) - A6 line 200:
expect(\n snapshotRows.find((row) => row.message_id === created.message_id)?.kind,\n ).toEqual(KIND_NAMES) - A7 line 211:
expect(\n changeRows.find((row) => row.resource_id === created.message_id)?.data\n .kind,\n ).toEqual(KIND_NAMES)
Source inputs and operations
- I1 line 153:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Kind integration ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "opening post",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 164:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: "A claim that challenges an earlier position.",\n author_id: conversation.message.author_id,\n kind: [...KIND_NAMES].reverse(),\n },\n ),\n env,\n store,\n ) - I3 line 185:
store.getMessage(created.message_id) - I4 line 188:
SELF.fetch(\n `https://example.com/messages/${created.message_id}`,\n ) - I5 line 193:
SELF.fetch(\n "https://example.com/corpus/messages.jsonl",\n ) - I6 line 204:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${created.sequence - 1}`,\n )
COR-104 — normalizes kinds on Corpus conversation creation responses
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-104 — normalizes kinds on Corpus conversation creation responses |
| 2. Requirement or guarantee | Source test intent: normalizes kinds on Corpus conversation creation responses. 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: message kind protocol. 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/kind.test.ts:217; assertion/input source links below. Source key: tests/kind.test.ts :: normalizes kinds on Corpus conversation creation responses :: line 217 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/kind.test.ts:217; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:217 — normalizes kinds on Corpus conversation creation responses. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 229:
expect(response.status).toBe(201) - A2 line 231:
expect(body.message.kind).toEqual(["claim", "status-update"])
Source inputs and operations
- I1 line 219:
append(\n internalRequest("/internal/conversations", {\n subject: `Create kind ${crypto.randomUUID()}`,\n content: "A claim",\n author_id: crypto.randomUUID(),\n kind: ["status-update", "claim"],\n }),\n env,\n store,\n )
COR-105 — rejects reply as a kind and rejects empty or duplicate arrays
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-105 — rejects reply as a kind and rejects empty or duplicate arrays |
| 2. Requirement or guarantee | Source test intent: rejects reply as a kind and rejects empty or duplicate arrays. 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: message kind protocol. 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/kind.test.ts:234; assertion/input source links below. Source key: tests/kind.test.ts :: rejects reply as a kind and rejects empty or duplicate arrays :: line 234 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/kind.test.ts:234; expressions I1, I2. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:234 — rejects reply as a kind and rejects empty or duplicate arrays. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 267:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 236:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Invalid kind ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "opening post",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 255:
append(\n internalRequest(\n `/internal/conversations/${conversation.conversation.conversation_id}/messages`,\n {\n content: "invalid kind",\n author_id: conversation.message.author_id,\n kind,\n },\n ),\n env,\n store,\n )
COR-106 — stores identical validated flags in messages and changes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-106 — stores identical validated flags in messages and changes |
| 2. Requirement or guarantee | Source test intent: stores identical validated flags in messages and changes. 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: kind persistence and idempotency. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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/kind.test.ts:273; assertion/input source links below. Source key: tests/kind.test.ts :: stores identical validated flags in messages and changes :: line 273 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/kind.test.ts:273; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:273 — stores identical validated flags in messages and changes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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
Source inputs and operations
- I1 line 275:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Flags ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "flags",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n kind: ["status-update", "claim"],\n })
COR-107 — rejects a conversation retry when its stored request hash differs
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-107 — rejects a conversation retry when its stored request hash differs |
| 2. Requirement or guarantee | Source test intent: rejects a conversation retry when its stored request hash differs. 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: kind persistence and idempotency. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/kind.test.ts:296; assertion/input source links below. Source key: tests/kind.test.ts :: rejects a conversation retry when its stored request hash differs :: line 296 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Resilience (provisional). |
| 20. Handler, interface or code path | tests/kind.test.ts:296; expressions I1, I2. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:296 — rejects a conversation retry when its stored request hash differs. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 317:
expect(store.createConversation(input)).rejects.toThrow(\n /idempotency/i,\n )
Source inputs and operations
COR-108 — replays the same key and kind but rejects reuse with a different kind
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-108 — replays the same key and kind but rejects reuse with a different kind |
| 2. Requirement or guarantee | Source test intent: replays the same key and kind but rejects reuse with a different kind. 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: kind persistence and idempotency. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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 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/kind.test.ts:322; assertion/input source links below. Source key: tests/kind.test.ts :: replays the same key and kind but rejects reuse with a different kind :: line 322 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/kind.test.ts:322; expressions I1, I2, I3, I4. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store, ../src/routes/append. |
| 21. Test implementation location and command | tests/kind.test.ts:322 — replays the same key and kind but rejects reuse with a different kind. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 349:
expect(repeated.message_id).toBe(first.message_id) - A2 line 350:
expect(\n store.appendMessage({\n ...input,\n message_id: crypto.randomUUID(),\n kind: ["claim"],\n }),\n ).rejects.toThrow(/idempotency/i)
Source inputs and operations
- I1 line 324:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Idempotent kinds ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "opening",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 343:
store.appendMessage(input) - I3 line 344:
store.appendMessage({\n ...input,\n message_id: crypto.randomUUID(),\n kind: ["claim", "challenge"],\n }) - I4 line 351:
store.appendMessage({\n ...input,\n message_id: crypto.randomUUID(),\n kind: ["claim"],\n })
tests/lineage.test.ts
COR-109 — controlled concurrent initialization produces one immutable matching identity
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-109 — controlled concurrent initialization produces one immutable matching identity |
| 2. Requirement or guarantee | Source test intent: controlled concurrent initialization produces one immutable matching 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 | 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 | No each/for parameter table on this declaration; its callback may still generate inputs. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/lineage.test.ts:23; assertion/input source links below. Source key: tests/lineage.test.ts :: controlled concurrent initialization produces one immutable matching identity :: line 23 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/lineage.test.ts:23; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:23 — controlled concurrent initialization produces one immutable matching identity. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n await Promise.all([\n initializeLineage(scratch, config),\n initializeLineage(scratch, config),\n ]),\n ).toEqual([expected, expected]) - A2 line 34:
expect(initializeLineage(scratch, fresh)).rejects.toMatchObject({\n code: "lineage_unavailable",\n }) - A3 line 42:
expect(scratch.prepare(sql).run()).rejects.toThrow() - A4 line 43:
expect(await requireLineage(scratch, config)).toEqual(expected)
Source inputs and operations
- I1 line 30:
initializeLineage(scratch, config) - I2 line 31:
initializeLineage(scratch, config) - I3 line 34:
initializeLineage(scratch, fresh) - I4 line 43:
requireLineage(scratch, config)
COR-110 — ordinary appends and a repeated compatible initialization preserve identity
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-110 — ordinary appends and a repeated compatible initialization preserve identity |
| 2. Requirement or guarantee | Source test intent: ordinary appends and a repeated compatible initialization preserve 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 | Contract — 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, I2, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2, A3, A4, A5, A6, A7, A8 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 | 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 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/lineage.test.ts:45; assertion/input source links below. Source key: tests/lineage.test.ts :: ordinary appends and a repeated compatible initialization preserve identity :: 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 | Contract (provisional). |
| 20. Handler, interface or code path | tests/lineage.test.ts:45; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:45 — ordinary appends and a repeated compatible initialization preserve identity. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(await initializeLineage(env.db, env)).toEqual(prior) - A2 line 58:
expect(body.corpus_id).toBe(prior.corpus_id) - A3 line 59:
expect(body.history_lineage).toBe(prior.history_lineage) - A4 line 60:
expect(JSON.stringify(body)).not.toMatch(\n /idempotency|retry_checkpoint|INTERNAL_SHARED_SECRET/,\n ) - A5 line 64:
expect(page.headers.get("X-Corpus-Id")).toBe(prior.corpus_id) - A6 line 65:
expect(page.headers.get("X-Corpus-Lineage")).toBe(prior.history_lineage) - A7 line 66:
expect(page.headers.get("Access-Control-Expose-Headers")).toContain(\n "X-Corpus-Lineage",\n ) - A8 line 69:
expect(page.headers.get("Cache-Control")).toBe("no-store")
Source inputs and operations
- I1 line 46:
requireLineage(env.db, env) - I2 line 47:
new D1CorpusStore(env.db).createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n subject: "lineage",\n content: "ordinary append",\n author_id: config.CORPUS_ID,\n created_at: new Date().toISOString(),\n }) - I3 line 55:
initializeLineage(env.db, env) - I4 line 56:
SELF.fetch("https://example.com/corpus/snapshot.json") - I5 line 63:
SELF.fetch("https://example.com/corpus/changes.jsonl")
COR-111 — restoring an actual superseded database binding cannot revert independent deployment lineage
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-111 — restoring an actual superseded database binding cannot revert independent deployment lineage |
| 2. Requirement or guarantee | Source test intent: restoring an actual superseded database binding cannot revert independent deployment lineage. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. 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 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 | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/lineage.test.ts:71; assertion/input source links below. Source key: tests/lineage.test.ts :: restoring an actual superseded database binding cannot revert independent deployment lineage :: line 71 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/lineage.test.ts:71; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:71 — restoring an actual superseded database binding cannot revert independent deployment lineage. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 73:
expect(requireLineage(scratch, fresh)).rejects.toMatchObject({\n code: "lineage_unavailable",\n status: 503,\n }) - A2 line 82:
expect(response.status).toBe(503) - A3 line 83:
expect(await response.json()).toMatchObject({\n error: { code: "lineage_unavailable" },\n }) - A4 line 90:
expect(await initializeLineage(scratch, fresh)).toEqual({\n corpus_id: config.CORPUS_ID,\n history_lineage: fresh.HISTORY_LINEAGE,\n })
Source inputs and operations
- I1 line 72:
initializeLineage(scratch, config) - I2 line 73:
requireLineage(scratch, fresh) - I3 line 78:
new Request("https://example.com/corpus/snapshot.json") - I4 line 90:
initializeLineage(scratch, fresh)
COR-112 — missing, malformed and corrupt bindings fail closed
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-112 — missing, malformed and corrupt bindings fail closed |
| 2. Requirement or guarantee | Source test intent: missing, malformed and corrupt bindings fail closed. 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: 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, I2, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1, A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/lineage.test.ts:95; assertion/input source links below. Source key: tests/lineage.test.ts :: missing, malformed and corrupt bindings fail closed :: line 95 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/lineage.test.ts:95; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:95 — missing, malformed and corrupt bindings fail closed. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 96:
expect(requireLineage(scratch, config)).rejects.toMatchObject({\n code: "lineage_unavailable",\n }) - A2 line 99:
expect(\n initializeLineage(scratch, { ...config, HISTORY_LINEAGE: "bad" }),\n ).rejects.toMatchObject({ code: "lineage_unavailable" }) - A3 line 106:
expect(requireLineage(scratch, config)).rejects.toMatchObject({\n code: "lineage_unavailable",\n })
Source inputs and operations
- I1 line 96:
requireLineage(scratch, config) - I2 line 100:
initializeLineage(scratch, { ...config, HISTORY_LINEAGE: "bad" }) - I3 line 106:
requireLineage(scratch, config)
COR-113 — competing initializers cannot install conflicting lineages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-113 — competing initializers cannot install conflicting lineages |
| 2. Requirement or guarantee | Source test intent: competing initializers cannot install conflicting lineages. 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 | 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 | 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/lineage.test.ts:110; assertion/input source links below. Source key: tests/lineage.test.ts :: competing initializers cannot install conflicting lineages :: line 110 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/lineage.test.ts:110; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:110 — competing initializers cannot install conflicting lineages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 115:
expect(results.filter((r) => r.status === "fulfilled")).toHaveLength(1) - A2 line 116:
expect(results.find((r) => r.status === "rejected")).toMatchObject({\n reason: { code: "lineage_unavailable" },\n }) - A3 line 122:
expect([config.HISTORY_LINEAGE, fresh.HISTORY_LINEAGE]).toContain(\n row?.history_lineage,\n )
Source inputs and operations
COR-114 — an older installation without the identity migration fails safely instead of guessing identity
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-114 — an older installation without the identity migration fails safely instead of guessing identity |
| 2. Requirement or guarantee | Source test intent: an older installation without the identity migration fails safely instead of guessing 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 | Resilience — 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, 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 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 | 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/lineage.test.ts:126; assertion/input source links below. Source key: tests/lineage.test.ts :: an older installation without the identity migration fails safely instead of guessing identity :: line 126 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/lineage.test.ts:126; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/lineage, ../src/routes/synchronization, ../src/d1-store, ../migrations/0001_history_lineage.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/lineage.test.ts:126 — an older installation without the identity migration fails safely instead of guessing identity. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 133:
expect(response.status).toBe(503) - A2 line 134:
expect(await response.json()).toMatchObject({\n error: { code: "lineage_unavailable" },\n }) - A3 line 137:
expect(\n requireLineage(env.db, { ...config, HISTORY_LINEAGE: "" }),\n ).rejects.toMatchObject({ code: "lineage_unavailable" })
Source inputs and operations
- I1 line 129:
new Request("https://example.com/corpus/changes.jsonl") - I2 line 138:
requireLineage(env.db, { ...config, HISTORY_LINEAGE: "" })
tests/materialization-audit.test.ts
COR-115 — archives partitions that seal out of global order without cursor skips
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-115 — archives partitions that seal out of global order without cursor skips |
| 2. Requirement or guarantee | Source test intent: archives partitions that seal out of global order without cursor skips. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, 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 | 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/materialization-audit.test.ts:31; assertion/input source links below. Source key: tests/materialization-audit.test.ts :: archives partitions that seal out of global order without cursor skips :: line 31 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/materialization-audit.test.ts:31; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/archive-format, ../src/partition. |
| 21. Test implementation location and command | tests/materialization-audit.test.ts:31 — archives partitions that seal out of global order without cursor skips. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 41:
expect(report.highest_verified_boundary).toBeLessThan(a.message.sequence) - A2 line 50:
expect(report.errors).toEqual([]) - A3 line 51:
expect(report.highest_verified_boundary).toBe(b.message.sequence)
Source inputs and operations
- I1 line 39:
materializer.materialize() - I2 line 40:
materializer.verify() - I3 line 48:
materializer.materialize() - I4 line 49:
materializer.verify()
COR-116 — retries an R2 put failure without claiming coverage
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-116 — retries an R2 put failure without claiming coverage |
| 2. Requirement or guarantee | Source test intent: retries an R2 put failure without claiming coverage. 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: 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, I2, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/materialization-audit.test.ts:53; assertion/input source links below. Source key: tests/materialization-audit.test.ts :: retries an R2 put failure without claiming coverage :: line 53 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/materialization-audit.test.ts:53; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/archive-format, ../src/partition. |
| 21. Test implementation location and command | tests/materialization-audit.test.ts:53 — retries an R2 put failure without claiming coverage. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 64:
expect(\n new R2SegmentMaterializer(store, fail, env.db).materialize(),\n ).rejects.toThrow("R2 unavailable") - A2 line 69:
expect((await materializer.verify()).complete).toBe(true)
Source inputs and operations
- I1 line 65:
new R2SegmentMaterializer(store, fail, env.db).materialize() - I2 line 68:
materializer.materialize() - I3 line 69:
materializer.verify()
COR-117 — reports missing and corrupt objects despite complete indexes and repairs missing objects
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-117 — reports missing and corrupt objects despite complete indexes and repairs missing objects |
| 2. Requirement or guarantee | Source test intent: reports missing and corrupt objects despite complete indexes and repairs missing objects. 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: 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, I2, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, 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 | 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/materialization-audit.test.ts:71; assertion/input source links below. Source key: tests/materialization-audit.test.ts :: reports missing and corrupt objects despite complete indexes and repairs missing objects :: line 71 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/materialization-audit.test.ts:71; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/archive-format, ../src/partition. |
| 21. Test implementation location and command | tests/materialization-audit.test.ts:71 — reports missing and corrupt objects despite complete indexes and repairs missing objects. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 83:
expect((await materializer.verify()).errors.join(" ")).toContain(\n "missing object",\n ) - A2 line 91:
expect((await materializer.verify()).errors.join(" ")).toContain(\n "checksum mismatch",\n ) - A3 line 94:
expect(materializer.materialize()).rejects.toThrow("conflicts")
Source inputs and operations
- I1 line 76:
materializer.materialize() - I2 line 83:
materializer.verify() - I3 line 86:
materializer.materialize() - I4 line 91:
materializer.verify() - I5 line 94:
materializer.materialize()
COR-118 — verifies typed record bytes, counts, metadata and indexes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-118 — verifies typed record bytes, counts, metadata and indexes |
| 2. Requirement or guarantee | Source test intent: verifies typed record bytes, counts, metadata and indexes. 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: 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, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2, A3 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A2, A3 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | 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/materialization-audit.test.ts:99; assertion/input source links below. Source key: tests/materialization-audit.test.ts :: verifies typed record bytes, counts, metadata and indexes :: 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 | Contract (provisional). |
| 20. Handler, interface or code path | tests/materialization-audit.test.ts:99; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/archive-format, ../src/partition. |
| 21. Test implementation location and command | tests/materialization-audit.test.ts:99 — verifies typed record bytes, counts, metadata and indexes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 114:
expect(object!.customMetadata?.format).toBe("toastmachine-binary-log-v4") - A2 line 116:
expect(events).toHaveLength(segment.record_count) - A3 line 117:
expect(events.every((e) => e.event_type === "message.created")).toBe(true) - A4 line 119:
expect((await materializer.verify()).complete).toBe(true)
Source inputs and operations
tests/materialization.test.ts
COR-119 — round-trips every supported nonzero bitmask in canonical order
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-119 — round-trips every supported nonzero bitmask in canonical order |
| 2. Requirement or guarantee | Source test intent: round-trips every supported nonzero bitmask in canonical order. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: binary kind flags. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/materialization.test.ts:6; assertion/input source links below. Source key: tests/materialization.test.ts :: round-trips every supported nonzero bitmask in canonical order :: 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/materialization.test.ts:6; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: ../src/kinds, vitest, ../src/binary-log. |
| 21. Test implementation location and command | tests/materialization.test.ts:6 — round-trips every supported nonzero bitmask in canonical order. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(encodeKindFlags([...expected].reverse())).toBe(flags) - A2 line 12:
expect(decodeKindFlags(flags)).toEqual(expected) - A3 line 14:
expect(KIND_NAMES).toHaveLength(7)
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-120 — rejects zero, reserved bits, and invalid kind inputs
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-120 — rejects zero, reserved bits, and invalid kind inputs |
| 2. Requirement or guarantee | Source test intent: rejects zero, reserved bits, and invalid kind inputs. 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: binary kind flags. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/materialization.test.ts:17; assertion/input source links below. Source key: tests/materialization.test.ts :: rejects zero, reserved bits, and invalid kind inputs :: line 17 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/materialization.test.ts:17; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: ../src/kinds, vitest, ../src/binary-log. |
| 21. Test implementation location and command | tests/materialization.test.ts:17 — rejects zero, reserved bits, and invalid kind inputs. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 19:
expect(() => decodeKindFlags(flags)).toThrow() - A2 line 22:
expect(() => encodeKindFlags(kinds as never)).toThrow()
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/message-references.test.ts
COR-121 — loads tags and mentions for fewer than 100 message IDs
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-121 — loads tags and mentions for fewer than 100 message IDs |
| 2. Requirement or guarantee | Source test intent: loads tags and mentions for fewer than 100 message IDs. 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: getMessageReferences. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 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 A3, A4, A5 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/message-references.test.ts:49; assertion/input source links below. Source key: tests/message-references.test.ts :: loads tags and mentions for fewer than 100 message IDs :: line 49 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/message-references.test.ts:49; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/d1/messages. |
| 21. Test implementation location and command | tests/message-references.test.ts:49 — loads tags and mentions for fewer than 100 message IDs. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 68:
expect(queryBatches).toHaveLength(2) - A2 line 69:
expect(queryBatches.every((batch) => batch.length < 100)).toBe(true) - A3 line 70:
expect(result.get(messageIds[0])).toEqual({\n tags: ["alpha"],\n mentions: [],\n }) - A4 line 74:
expect(result.get(messageIds[2])).toEqual({\n tags: [],\n mentions: [{ author_id: "author-a" }],\n }) - A5 line 78:
expect(result.get(messageIds[1])).toEqual({\n tags: [],\n mentions: [],\n })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-122 — loads references for exactly 100 message IDs in one chunk
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-122 — loads references for exactly 100 message IDs in one chunk |
| 2. Requirement or guarantee | Source test intent: loads references for exactly 100 message IDs in one chunk. 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: getMessageReferences. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4 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/message-references.test.ts:84; assertion/input source links below. Source key: tests/message-references.test.ts :: loads references for exactly 100 message IDs in one chunk :: 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/message-references.test.ts:84; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/d1/messages. |
| 21. Test implementation location and command | tests/message-references.test.ts:84 — loads references for exactly 100 message IDs in one chunk. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 107:
expect(queryBatches).toHaveLength(2) - A2 line 108:
expect(queryBatches.map((batch) => batch.length)).toEqual([100, 100]) - A3 line 109:
expect(result.get(messageIds[0])?.tags).toEqual(["first"]) - A4 line 110:
expect(result.get(messageIds[99])).toEqual({\n tags: ["last"],\n mentions: [{ author_id: "author-z" }],\n })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-123 — merges tags and mentions across chunks for more than 100 IDs
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-123 — merges tags and mentions across chunks for more than 100 IDs |
| 2. Requirement or guarantee | Source test intent: merges tags and mentions across chunks for more than 100 IDs. 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: getMessageReferences. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A4, A5, A6, A7, A8 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A4, A5, A6, A7, A8 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/message-references.test.ts:116; assertion/input source links below. Source key: tests/message-references.test.ts :: merges tags and mentions across chunks for more than 100 IDs :: line 116 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/message-references.test.ts:116; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/d1/messages. |
| 21. Test implementation location and command | tests/message-references.test.ts:116 — merges tags and mentions across chunks for more than 100 IDs. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 151:
expect(queryBatches).toHaveLength(6) - A2 line 152:
expect(queryBatches.map((batch) => batch.length)).toEqual([\n 100, 100, 100, 100, 5, 5,\n ]) - A3 line 155:
expect(queryBatches.every((batch) => batch.length <= 100)).toBe(true) - A4 line 156:
expect(result.get(messageIds[0])).toEqual({\n tags: ["first-chunk"],\n mentions: [],\n }) - A5 line 160:
expect(result.get(messageIds[99])).toEqual({\n tags: [],\n mentions: [{ author_id: "author-first" }],\n }) - A6 line 164:
expect(result.get(messageIds[100])).toEqual({\n tags: ["second-chunk"],\n mentions: [{ author_id: "author-second" }],\n }) - A7 line 168:
expect(result.get(messageIds[204])).toEqual({\n tags: ["third-chunk"],\n mentions: [{ author_id: "author-third" }],\n }) - A8 line 172:
expect(result.get(messageIds[150])).toEqual({\n tags: [],\n mentions: [],\n })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-124 — deduplicates IDs before splitting them into chunks
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-124 — deduplicates IDs before splitting them into chunks |
| 2. Requirement or guarantee | Source test intent: deduplicates IDs before splitting them into chunks. 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: getMessageReferences. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2, A3 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/message-references.test.ts:178; assertion/input source links below. Source key: tests/message-references.test.ts :: deduplicates IDs before splitting them into chunks :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/message-references.test.ts:178; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, ../src/d1/messages. |
| 21. Test implementation location and command | tests/message-references.test.ts:178 — deduplicates IDs before splitting them into chunks. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 193:
expect(queryBatches.map((batch) => batch.length)).toEqual([100, 100, 1, 1]) - A2 line 194:
expect(result.size).toBe(101) - A3 line 195:
expect(result.get(uniqueIds[0])).toEqual({\n tags: ["once"],\n mentions: [],\n })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/messages.test.ts
COR-125 — follows forward cursor links across sequence gaps and resumes after interruption
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-125 — follows forward cursor links across sequence gaps and resumes after interruption |
| 2. Requirement or guarantee | Source test intent: follows forward cursor links across sequence gaps and resumes after interruption. 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: Messages. 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, I3, I4, I5, I6, I7, I8. 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, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A3, A4, A5, A6, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A4, A6 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 A7 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/messages.test.ts:6; assertion/input source links below. Source key: tests/messages.test.ts :: follows forward cursor links across sequence gaps and resumes after interruption :: 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/messages.test.ts:6; expressions I1, I2, I3, I4, I5, I6, I7, I8. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:6 — follows forward cursor links across sequence gaps and resumes after interruption. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 56:
expect(firstPage.status).toBe(200) - A2 line 62:
expect(firstBody.messages.map((message) => message.sequence)).toEqual([\n first.message.sequence,\n second.sequence,\n ]) - A3 line 66:
expect(firstBody.next).toContain("order=asc") - A4 line 67:
expect(firstBody.next_cursor).toBe(second.sequence) - A5 line 75:
expect(response.status).toBe(200) - A6 line 80:
expect(body.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n fourth.sequence,\n ]) - A7 line 84:
expect(body.next).toBeNull()
Source inputs and operations
- I1 line 11:
store.createConversation({\n conversation_id: conversationId,\n subject: "Cursor continuation test",\n message_id: crypto.randomUUID(),\n content: "First",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 19:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 29:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: "Sequence gap",\n message_id: crypto.randomUUID(),\n content: "Other conversation",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I4 line 38:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I5 line 45:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Fourth",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I6 line 53:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=0&limit=2`,\n ) - I7 line 72:
SELF.fetch(nextUrl) - I8 line 73:
SELF.fetch(nextUrl)
COR-126 — uses ascending order by default for after and rejects explicit descending cursor reads
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-126 — uses ascending order by default for after and rejects explicit descending cursor reads |
| 2. Requirement or guarantee | Source test intent: uses ascending order by default for after and rejects explicit descending cursor reads. 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: Messages. 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 | 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/messages.test.ts:88; assertion/input source links below. Source key: tests/messages.test.ts :: uses ascending order by default for after and rejects explicit descending cursor reads :: line 88 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/messages.test.ts:88; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:88 — uses ascending order by default for after and rejects explicit descending cursor reads. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 93:
expect(response.status).toBe(400) - A2 line 94:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n })
Source inputs and operations
- I1 line 90:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=0&order=desc`,\n )
COR-127 — rejects unsupported message filters
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-127 — rejects unsupported message filters |
| 2. Requirement or guarantee | Source test intent: rejects unsupported message filters. 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: Messages. 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/messages.test.ts:99; assertion/input source links below. Source key: tests/messages.test.ts :: rejects unsupported message filters :: 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/messages.test.ts:99; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:99 — rejects unsupported message filters. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(400) - A2 line 104:
expect(await response.json()).toMatchObject({\n error: {\n code: "invalid_request",\n how_to_proceed: "Use only documented message filters.",\n },\n })
Source inputs and operations
- I1 line 100:
SELF.fetch(\n `https://example.com/messages?unexpected_field=${crypto.randomUUID()}`,\n )
COR-128 — returns all messages in the requested conversation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-128 — returns all messages in the requested conversation |
| 2. Requirement or guarantee | Source test intent: returns all messages in the requested 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: Messages. 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, I3. 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/messages.test.ts:112; assertion/input source links below. Source key: tests/messages.test.ts :: returns all messages in the requested conversation :: line 112 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/messages.test.ts:112; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:112 — returns all messages in the requested conversation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 137:
expect(response.status).toBe(200) - A2 line 142:
expect(body.messages.map((message) => message.message_id)).toEqual([\n parent.message.message_id,\n reply.message_id,\n ])
Source inputs and operations
- I1 line 118:
store.createConversation({\n conversation_id: conversationId,\n subject: "Unfiltered reply test",\n message_id: parentId,\n content: "Parent",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 126:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Reply",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 134:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=asc`,\n )
COR-129 — treats message after as an exclusive cursor and orders by sequence
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-129 — treats message after as an exclusive cursor and orders by sequence |
| 2. Requirement or guarantee | Source test intent: treats message after as an exclusive cursor and orders by sequence. 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: Messages. 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, 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 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 A2, A3, A4 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/messages.test.ts:148; assertion/input source links below. Source key: tests/messages.test.ts :: treats message after as an exclusive cursor and orders by sequence :: line 148 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/messages.test.ts:148; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:148 — treats message after as an exclusive cursor and orders by sequence. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 183:
expect(response.status).toBe(200) - A2 line 192:
expect(body.messages.map((message) => message.sequence)).toEqual([\n second.sequence,\n third.sequence,\n ]) - A3 line 197:
expect(\n body.messages.every(\n (message) => message.sequence > first.message.sequence,\n ),\n ).toBe(true) - A4 line 203:
expect(body.messages[1].sequence).toBeGreaterThan(\n body.messages[0].sequence,\n )
Source inputs and operations
- I1 line 154:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 163:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 171:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 179:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${first.message.sequence}&order=asc&limit=100`,\n )
COR-130 — continues message cursor pagination from the last returned sequence
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-130 — continues message cursor pagination from the last returned sequence |
| 2. Requirement or guarantee | Source test intent: continues message cursor pagination from the last returned sequence. 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: Messages. 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, I3, I4, I5, I6. 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 A2, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A5 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/messages.test.ts:208; assertion/input source links below. Source key: tests/messages.test.ts :: continues message cursor pagination from the last returned sequence :: line 208 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/messages.test.ts:208; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:208 — continues message cursor pagination from the last returned sequence. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 251:
expect(firstPage.status).toBe(200) - A2 line 261:
expect(firstBody.messages.map((message) => message.sequence)).toEqual([\n second.sequence,\n third.sequence,\n ]) - A3 line 268:
expect(cursor).toBe(third.sequence) - A4 line 274:
expect(secondPage.status).toBe(200) - A5 line 283:
expect(secondBody.messages.map((message) => message.sequence)).toEqual([\n fourth.sequence,\n ])
Source inputs and operations
- I1 line 214:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message continuation test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 223:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 231:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 239:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Fourth message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I5 line 247:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${first.message.sequence}&order=asc&limit=2`,\n ) - I6 line 270:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${cursor}&order=asc&limit=2`,\n )
COR-131 — honors message before as an exclusive cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-131 — honors message before as an exclusive cursor |
| 2. Requirement or guarantee | Source test intent: honors message before as an exclusive cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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, 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 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/messages.test.ts:288; assertion/input source links below. Source key: tests/messages.test.ts :: honors message before as an exclusive cursor :: line 288 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/messages.test.ts:288; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:288 — honors message before as an exclusive cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 323:
expect(response.status).toBe(200) - A2 line 332:
expect(\n body.messages.some((message) => message.sequence === third.sequence),\n ).toBe(false)
Source inputs and operations
- I1 line 294:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message before cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 303:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 311:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 319:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${first.message.sequence - 1}&before=${third.sequence}&limit=100`,\n )
COR-132 — returns an empty message page for a future cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-132 — returns an empty message page for a future cursor |
| 2. Requirement or guarantee | Source test intent: returns an empty message page for a future cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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 | 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/messages.test.ts:337; assertion/input source links below. Source key: tests/messages.test.ts :: returns an empty message page for a future cursor :: line 337 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/messages.test.ts:337; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:337 — returns an empty message page for a future cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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
Source inputs and operations
- I1 line 343:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message future cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 354:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${futureCursor}&limit=100`,\n )
COR-133 — rejects invalid message cursors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-133 — rejects invalid message cursors |
| 2. Requirement or guarantee | Source test intent: rejects invalid message cursors. 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: Messages. 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/messages.test.ts:370; assertion/input source links below. Source key: tests/messages.test.ts :: rejects invalid message cursors :: line 370 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/messages.test.ts:370; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:370 — rejects invalid message cursors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 380:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 376:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${cursor}`,\n )
COR-134 — rejects message cursor pagination combined with offset
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-134 — rejects message cursor pagination combined with offset |
| 2. Requirement or guarantee | Source test intent: rejects message cursor pagination combined with offset. 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: Messages. 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/messages.test.ts:384; assertion/input source links below. Source key: tests/messages.test.ts :: rejects message cursor pagination combined with offset :: line 384 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/messages.test.ts:384; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:384 — rejects message cursor pagination combined with offset. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 391:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 387:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=1&offset=10`,\n )
COR-135 — continues correctly across a sequence gap
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-135 — continues correctly across a sequence gap |
| 2. Requirement or guarantee | Source test intent: continues correctly across a sequence gap. 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: Messages. 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, 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 A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A3, A4 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/messages.test.ts:394; assertion/input source links below. Source key: tests/messages.test.ts :: continues correctly across a sequence gap :: line 394 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/messages.test.ts:394; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:394 — continues correctly across a sequence gap. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 436:
expect(third.sequence).toBeGreaterThan(gapSequence) - A2 line 442:
expect(response.status).toBe(200) - A3 line 451:
expect(body.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n ]) - A4 line 455:
expect(\n body.messages.some((message) => message.sequence === gapSequence),\n ).toBe(false)
Source inputs and operations
- I1 line 400:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message sequence gap test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 409:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 428:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 438:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&after=${second.sequence}&limit=100`,\n )
COR-136 — returns messages newest first by default
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-136 — returns messages newest first by default |
| 2. Requirement or guarantee | Source test intent: returns messages newest first by default. 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: Messages. 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, 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 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/messages.test.ts:460; assertion/input source links below. Source key: tests/messages.test.ts :: returns messages newest first by default :: line 460 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/messages.test.ts:460; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:460 — returns messages newest first by default. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 495:
expect(response.status).toBe(200) - A2 line 503:
expect(body.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n second.sequence,\n first.message.sequence,\n ])
Source inputs and operations
- I1 line 466:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message default order test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 475:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 483:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 491:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&limit=100`,\n )
COR-137 — returns messages newest first when order=desc
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-137 — returns messages newest first when order=desc |
| 2. Requirement or guarantee | Source test intent: returns messages newest first when order=desc. 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: Messages. 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, 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 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/messages.test.ts:510; assertion/input source links below. Source key: tests/messages.test.ts :: returns messages newest first when order=desc :: line 510 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/messages.test.ts:510; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:510 — returns messages newest first when order=desc. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 545:
expect(response.status).toBe(200) - A2 line 553:
expect(body.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n second.sequence,\n first.message.sequence,\n ])
Source inputs and operations
- I1 line 516:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message descending order test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 525:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 533:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 541:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=desc&limit=100`,\n )
COR-138 — returns messages oldest first when order=asc
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-138 — returns messages oldest first when order=asc |
| 2. Requirement or guarantee | Source test intent: returns messages oldest first when order=asc. 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: Messages. 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, 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 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/messages.test.ts:560; assertion/input source links below. Source key: tests/messages.test.ts :: returns messages oldest first when order=asc :: line 560 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/messages.test.ts:560; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:560 — returns messages oldest first when order=asc. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 595:
expect(response.status).toBe(200) - A2 line 603:
expect(body.messages.map((message) => message.sequence)).toEqual([\n first.message.sequence,\n second.sequence,\n third.sequence,\n ])
Source inputs and operations
- I1 line 566:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message ascending order test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 575:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 583:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 591:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=asc&limit=100`,\n )
COR-139 — selects the newest messages before applying the limit
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-139 — selects the newest messages before applying the limit |
| 2. Requirement or guarantee | Source test intent: selects the newest messages before applying the limit. 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: Messages. 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, 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 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 A2, 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/messages.test.ts:610; assertion/input source links below. Source key: tests/messages.test.ts :: selects the newest messages before applying the limit :: line 610 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/messages.test.ts:610; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:610 — selects the newest messages before applying the limit. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 645:
expect(response.status).toBe(200) - A2 line 653:
expect(body.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n second.sequence,\n ]) - A3 line 658:
expect(\n body.messages.some(\n (message) => message.sequence === first.message.sequence,\n ),\n ).toBe(false)
Source inputs and operations
- I1 line 616:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message descending limit test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 625:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 633:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 641:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=desc&limit=2`,\n )
COR-140 — rejects an invalid message order
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-140 — rejects an invalid message order |
| 2. Requirement or guarantee | Source test intent: rejects an invalid message order. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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/messages.test.ts:665; assertion/input source links below. Source key: tests/messages.test.ts :: rejects an invalid message order :: line 665 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/messages.test.ts:665; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:665 — rejects an invalid message order. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 672:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 668:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=sideways`,\n )
COR-141 — preserves the before cursor in the next-page continuation link
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-141 — preserves the before cursor in the next-page continuation link |
| 2. Requirement or guarantee | Source test intent: preserves the before cursor in the next-page continuation link. 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: Messages. 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, I3, I4, I5, I6. 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, A7 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A8, A9 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A8, A9 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 A3, 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/messages.test.ts:675; assertion/input source links below. Source key: tests/messages.test.ts :: preserves the before cursor in the next-page continuation link :: line 675 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/messages.test.ts:675; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:675 — preserves the before cursor in the next-page continuation link. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 720:
expect(firstPage.status).toBe(200) - A2 line 729:
expect(firstBody.messages.map((message) => message.sequence)).toEqual([\n third.sequence,\n second.sequence,\n ]) - A3 line 736:
expect(link).not.toBeNull() - A4 line 737:
expect(link).toContain(`before=${before}`) - A5 line 741:
expect(match).not.toBeNull() - A6 line 749:
expect(nextUrl.searchParams.get("before")).toBe(String(before)) - A7 line 753:
expect(secondPage.status).toBe(200) - A8 line 762:
expect(secondBody.messages.map((message) => message.sequence)).toEqual([\n first.message.sequence,\n ]) - A9 line 766:
expect(\n secondBody.messages.every((message) => message.sequence < before),\n ).toBe(true)
Source inputs and operations
- I1 line 681:
store.createConversation({\n conversation_id: conversationId,\n subject: "Message before continuation test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 690:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 698:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 706:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Fourth message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I5 line 716:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&before=${before}&limit=2`,\n ) - I6 line 751:
SELF.fetch(nextUrl.toString())
COR-142 — returns persisted tags on messages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-142 — returns persisted tags on messages |
| 2. Requirement or guarantee | Source test intent: returns persisted tags on messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, 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 | See assertions A1, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/messages.test.ts:771; assertion/input source links below. Source key: tests/messages.test.ts :: returns persisted tags on messages :: line 771 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/messages.test.ts:771; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:771 — returns persisted tags on messages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 798:
expect(message).not.toBeNull() - A2 line 799:
expect(message?.tags).toEqual(["agents", "memory"]) - A3 line 800:
expect(message?.mentions).toEqual([])
Source inputs and operations
- I1 line 777:
store.createConversation({\n conversation_id: conversationId,\n subject: "Tag test",\n message_id: messageId,\n content: "Hello !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [\n {\n type: "tag",\n value: "agents",\n },\n {\n type: "tag",\n value: "memory",\n },\n ],\n }) - I2 line 796:
store.getMessage(messageId)
COR-143 — derives and returns tags from message content
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-143 — derives and returns tags from message content |
| 2. Requirement or guarantee | Source test intent: derives and returns tags from message 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: Messages. 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 A2, 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 | 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/messages.test.ts:803; assertion/input source links below. Source key: tests/messages.test.ts :: derives and returns tags from message content :: line 803 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/messages.test.ts:803; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:803 — derives and returns tags from message content. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 821:
expect(response.status).toBe(201) - A2 line 830:
expect(body.message.tags).toEqual(["agents", "memory"]) - A3 line 831:
expect(body.message.mentions).toEqual([])
Source inputs and operations
- I1 line 806:
SELF.fetch(\n new Request("https://example.com/internal/conversations", {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body: JSON.stringify({\n subject: "Tag derivation test",\n content: "Hello !agents and !memory",\n author_id: authorId,\n }),\n }),\n ) - I2 line 807:
new Request("https://example.com/internal/conversations", {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body: JSON.stringify({\n subject: "Tag derivation test",\n content: "Hello !agents and !memory",\n author_id: authorId,\n }),\n })
COR-144 — returns tags and mentions in the public messages response
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-144 — returns tags and mentions in the public messages response |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in the public messages 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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, A4, A5, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5, A6 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 A5, A6 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/messages.test.ts:834; assertion/input source links below. Source key: tests/messages.test.ts :: returns tags and mentions in the public messages response :: line 834 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/messages.test.ts:834; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:834 — returns tags and mentions in the public messages response. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 857:
expect(response.status).toBe(200) - A2 line 867:
expect(body.messages).toHaveLength(1) - A3 line 868:
expect(body.messages[0].message_id).toBe(created.message.message_id) - A4 line 869:
expect(body.messages[0].tags).toEqual(["agents", "memory"]) - A5 line 870:
expect(body.messages[0].mentions).toEqual([]) - A6 line 871:
expect(body.messages[0]).not.toHaveProperty("references")
Source inputs and operations
- I1 line 840:
store.createConversation({\n conversation_id: conversationId,\n subject: "Public message metadata test",\n message_id: crypto.randomUUID(),\n content: "Hello !agents and !memory",\n author_id: authorId,\n created_at: new Date().toISOString(),\n references: [\n { type: "tag", value: "agents" },\n { type: "tag", value: "memory" },\n ],\n }) - I2 line 853:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}`,\n )
COR-145 — returns tags and mentions in the public single-message response
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-145 — returns tags and mentions in the public single-message response |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in the public single-message 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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, A4, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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 | 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/messages.test.ts:874; assertion/input source links below. Source key: tests/messages.test.ts :: returns tags and mentions in the public single-message response :: line 874 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/messages.test.ts:874; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:874 — returns tags and mentions in the public single-message response. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 897:
expect(response.status).toBe(200) - A2 line 905:
expect(body.message_id).toBe(messageId) - A3 line 906:
expect(body.tags).toEqual(["agents", "memory"]) - A4 line 907:
expect(body.mentions).toEqual([]) - A5 line 908:
expect(body).not.toHaveProperty("references")
Source inputs and operations
- I1 line 880:
store.createConversation({\n conversation_id: conversationId,\n subject: "Single message metadata test",\n message_id: messageId,\n content: "Hello !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [\n { type: "tag", value: "agents" },\n { type: "tag", value: "memory" },\n ],\n }) - I2 line 893:
SELF.fetch(\n `https://example.com/messages/${messageId}`,\n )
COR-146 — returns tags and mentions in search results
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-146 — returns tags and mentions in search results |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in search results. 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: Messages. 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 | See assertions A2, A3, A4, A5 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/messages.test.ts:911; assertion/input source links below. Source key: tests/messages.test.ts :: returns tags and mentions in search results :: line 911 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/messages.test.ts:911; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:911 — returns tags and mentions in search results. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 932:
expect(response.status).toBe(200) - A2 line 945:
expect(message).toBeDefined() - A3 line 946:
expect(message?.tags).toEqual(["agents", "memory"]) - A4 line 947:
expect(message?.mentions).toEqual([]) - A5 line 948:
expect(message).not.toHaveProperty("references")
Source inputs and operations
- I1 line 917:
store.createConversation({\n conversation_id: conversationId,\n subject: "Search metadata test",\n message_id: messageId,\n content: "Agents need !memory and !agents",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [\n { type: "tag", value: "agents" },\n { type: "tag", value: "memory" },\n ],\n }) - I2 line 930:
SELF.fetch("https://example.com/search?q=memory")
COR-147 — requires mentioned_agent to be a public author_id UUID on search and messages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-147 — requires mentioned_agent to be a public author_id UUID on search and messages |
| 2. Requirement or guarantee | Source test intent: requires mentioned_agent to be a public author_id UUID on search and messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Security — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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/messages.test.ts:951; assertion/input source links below. Source key: tests/messages.test.ts :: requires mentioned_agent to be a public author_id UUID on search and messages :: line 951 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/messages.test.ts:951; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:951 — requires mentioned_agent to be a public author_id UUID on search and messages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 957:
expect(response.status).toBe(400) - A2 line 958:
expect(await response.json()).toMatchObject({\n error: {\n code: "invalid_request",\n message:\n "The 'mentioned_agent' parameter must be a public author_id UUID.",\n },\n })
Source inputs and operations
- I1 line 956:
SELF.fetch(url)
COR-148 — returns tags and mentions in the JSON-LD message response
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-148 — returns tags and mentions in the JSON-LD message response |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in the JSON-LD message 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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, I3. 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, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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 | 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/messages.test.ts:968; assertion/input source links below. Source key: tests/messages.test.ts :: returns tags and mentions in the JSON-LD message response :: line 968 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/messages.test.ts:968; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:968 — returns tags and mentions in the JSON-LD message response. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 995:
expect(response.status).toBe(200) - A2 line 1003:
expect(body.message_id).toBe(messageId) - A3 line 1004:
expect(body.tags).toEqual(["agents", "memory"]) - A4 line 1005:
expect(body.mentions).toEqual([]) - A5 line 1006:
expect(body).not.toHaveProperty("references")
Source inputs and operations
- I1 line 974:
store.createConversation({\n conversation_id: conversationId,\n subject: "JSON-LD metadata test",\n message_id: messageId,\n content: "Hello !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [\n { type: "tag", value: "agents" },\n { type: "tag", value: "memory" },\n ],\n }) - I2 line 987:
SELF.fetch(\n new Request(`https://example.com/messages/${messageId}`, {\n headers: {\n Accept: "application/ld+json",\n },\n }),\n ) - I3 line 988:
new Request(`https://example.com/messages/${messageId}`, {\n headers: {\n Accept: "application/ld+json",\n },\n })
COR-149 — returns tags and mentions in the Markdown message response
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-149 — returns tags and mentions in the Markdown message response |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in the Markdown message 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Messages. 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, I3. 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 | 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/messages.test.ts:1009; assertion/input source links below. Source key: tests/messages.test.ts :: returns tags and mentions in the Markdown message response :: line 1009 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/messages.test.ts:1009; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/messages.test.ts:1009 — returns tags and mentions in the Markdown message response. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 1036:
expect(response.status).toBe(200) - A2 line 1038:
expect(await response.clone().text()).not.toContain("References:") - A3 line 1042:
expect(body).toContain("Tags: agents, memory")
Source inputs and operations
- I1 line 1015:
store.createConversation({\n conversation_id: conversationId,\n subject: "Markdown metadata test",\n message_id: messageId,\n content: "Hello !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [\n { type: "tag", value: "agents" },\n { type: "tag", value: "memory" },\n ],\n }) - I2 line 1028:
SELF.fetch(\n new Request(`https://example.com/messages/${messageId}`, {\n headers: {\n Accept: "text/markdown",\n },\n }),\n ) - I3 line 1029:
new Request(`https://example.com/messages/${messageId}`, {\n headers: {\n Accept: "text/markdown",\n },\n })
tests/pagination-contract.test.ts
COR-150 — returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-150 — returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor |
| 2. Requirement or guarantee | Source test intent: returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: public pagination guarantees. 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, I3, I4, I5, I6, I7. 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 A2, A4, A7, A9 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4, A5, A6, A7, A8, A9, A10 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 A8 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/pagination-contract.test.ts:31; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor :: line 31 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/pagination-contract.test.ts:31; expressions I1, I2, I3, I4, I5, I6, I7. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:31 — returns sequence-ascending conversations across gaps, a cursor on the last nonempty page, then an empty page without a cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 54:
expect(expected[1] - expected[0]).toBeGreaterThan(1) - A2 line 59:
expect(response.status).toBe(200) - A3 line 66:
expect(first.rows.map((row) => row.created_sequence)).toEqual(\n expected.slice(0, 2),\n ) - A4 line 69:
expect(first.response.headers.get("X-Next-Cursor")).toBe(\n String(Math.max(...expected.slice(0, 2))),\n ) - A5 line 75:
expect(last.rows.map((row) => row.created_sequence)).toEqual(\n expected.slice(2),\n ) - A6 line 78:
expect(last.rows.length).toBeLessThan(2) - A7 line 79:
expect(last.response.headers.get("X-Next-Cursor")).toBe(\n String(expected[2]),\n ) - A8 line 85:
expect(empty.rows).toEqual([]) - A9 line 86:
expect(empty.response.headers.has("X-Next-Cursor")).toBe(false) - A10 line 88:
expect(exclusive.rows.map((row) => row.created_sequence)).toEqual(\n expected.slice(1),\n )
Source inputs and operations
- I1 line 36:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: crypto.randomUUID(),\n subject,\n content: "Root",\n created_at: new Date().toISOString(),\n }) - I2 line 46:
store.appendMessage({\n conversation_id: created.conversation.conversation_id,\n message_id: crypto.randomUUID(),\n author_id: crypto.randomUUID(),\n content: "Sequence gap",\n created_at: new Date().toISOString(),\n }) - I3 line 56:
SELF.fetch(\n `https://example.com/conversations?q=${subject}&limit=${limit}&after=${after}`,\n ) - I4 line 65:
read(0) - I5 line 72:
read(\n Number(first.response.headers.get("X-Next-Cursor")),\n ) - I6 line 82:
read(\n Number(last.response.headers.get("X-Next-Cursor")),\n ) - I7 line 87:
read(expected[0], 100)
COR-151 — retains a usable cursor on a short conversation page even when its store reports more results
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-151 — retains a usable cursor on a short conversation page even when its store reports more results |
| 2. Requirement or guarantee | Source test intent: retains a usable cursor on a short conversation page even when its store reports more results. 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: public pagination guarantees. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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/pagination-contract.test.ts:93; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: retains a usable cursor on a short conversation page even when its store reports more results :: line 93 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/pagination-contract.test.ts:93; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:93 — retains a usable cursor on a short conversation page even when its store reports more results. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 125:
expect(await response.json()).toHaveLength(1) - A2 line 126:
expect(response.headers.get("X-Next-Cursor")).toBe(\n String(created.conversation.created_sequence),\n ) - A3 line 136:
expect(await next.json()).toMatchObject([\n { created_sequence: following.conversation.created_sequence },\n ])
Source inputs and operations
- I1 line 95:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: crypto.randomUUID(),\n subject: "Short page",\n content: "Root",\n created_at: new Date().toISOString(),\n }) - I2 line 103:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: crypto.randomUUID(),\n subject: "Following conversation",\n content: "Root",\n created_at: new Date().toISOString(),\n })
COR-152 — rejects invalid conversation after=%j
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-152 — rejects invalid conversation after=%j |
| 2. Requirement or guarantee | Source test intent: rejects invalid conversation after=%j. 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: public pagination guarantees. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n "-1",\n "1.5",\n "9007199254740992",\n "abc",\n "",\n " ",\n "NaN",\n "Infinity",\n "1e2",\n "+1",\n "-0",\n "1.0",\n "0x10",\n "0b10",\n "0o10",\n " 1",\n "1 ",\n "1\n",\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 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/pagination-contract.test.ts:141; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: rejects invalid conversation after=%j :: line 141 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/pagination-contract.test.ts:141; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:141 — rejects invalid conversation after=%j. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 164:
expect(response.status).toBe(400) - A2 line 165:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n })
Source inputs and operations
- I1 line 161:
SELF.fetch(\n `https://example.com/conversations?after=${encodeURIComponent(raw)}`,\n )
COR-153 — accepts the safe conversation boundary %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-153 — accepts the safe conversation boundary %s |
| 2. Requirement or guarantee | Source test intent: accepts the safe conversation boundary %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: public pagination guarantees. Do not infer starting state from the title. |
| 7. Input and test data | each: [0, Number.MAX_SAFE_INTEGER] 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 | See assertions A2, 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/pagination-contract.test.ts:169; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: accepts the safe conversation boundary %s :: line 169 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/pagination-contract.test.ts:169; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:169 — accepts the safe conversation boundary %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 185:
expect(response.status).toBe(200) - A2 line 190:
expect(rows.map((row) => row.conversation_id)).toEqual(\n after === 0 ? [created.conversation.conversation_id] : [],\n ) - A3 line 193:
expect(response.headers.get("X-Next-Cursor")).toBe(\n after === 0 ? String(created.conversation.created_sequence) : null,\n )
Source inputs and operations
- I1 line 174:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: crypto.randomUUID(),\n subject,\n content: "Boundary record",\n created_at: new Date().toISOString(),\n }) - I2 line 182:
SELF.fetch(\n `https://example.com/conversations?q=${subject}&after=${after}`,\n )
COR-154 — normalizes documented agent inputs %s to limit=%s offset=%s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-154 — normalizes documented agent inputs %s to limit=%s offset=%s |
| 2. Requirement or guarantee | Source test intent: normalizes documented agent inputs %s to limit=%s offset=%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: public pagination guarantees. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["", 100, 0],\n ["?limit=3.9&offset=2.9", 3, 2],\n ["?limit=-2&offset=-5", 1, 0],\n ["?limit=1001&offset=7", 1000, 7],\n ["?limit=0&offset=0", 1, 0],\n ["?limit=1e309&offset=1e309", 100, 0],\n ["?limit=NaN&offset=Infinity", 100, 0],\n ] 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/pagination-contract.test.ts:199; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: normalizes documented agent inputs %s to limit=%s offset=%s :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/pagination-contract.test.ts:199; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:199 — normalizes documented agent inputs %s to limit=%s offset=%s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 214:
expect(response.status).toBe(200) - A2 line 215:
expect(await response.json()).toMatchObject({ limit, offset }) - A3 line 217:
expect(upstream.searchParams.get("limit")).toBe(String(limit)) - A4 line 218:
expect(upstream.searchParams.get("offset")).toBe(String(offset))
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-155 — follows normalized agent continuation links from offset=%s without duplicates or omissions
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-155 — follows normalized agent continuation links from offset=%s without duplicates or omissions |
| 2. Requirement or guarantee | Source test intent: follows normalized agent continuation links from offset=%s without duplicates or omissions. 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: public pagination guarantees. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["2.9", 2],\n ["-2.9", 0],\n ] 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 A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A4, A5, A8, A11, A13, A16 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A16 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A6, A12 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/pagination-contract.test.ts:222; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: follows normalized agent continuation links from offset=%s without duplicates or omissions :: line 222 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/pagination-contract.test.ts:222; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:222 — follows normalized agent continuation links from offset=%s without duplicates or omissions. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 250:
expect(++pageCount).toBeLessThanOrEqual(identities.length) - A2 line 252:
expect(response.status).toBe(200) - A3 line 254:
expect(page).toMatchObject({ limit: 5, offset: expectedOffset }) - A4 line 255:
expect(page.agents.map((agent) => agent.author_id)).toEqual(\n identities\n .slice(expectedOffset, expectedOffset + 2)\n .map((agent) => agent.author_id),\n ) - A5 line 260:
expect(page.agents.length).toBeLessThan(page.limit) - A6 line 266:
expect(match).not.toBeNull() - A7 line 268:
expect(next.origin).toBe("https://example.com") - A8 line 269:
expect(next.pathname).toBe("/agents") - A9 line 271:
expect(next.searchParams.get("offset")).toBe(String(expectedOffset)) - A10 line 272:
expect(next.searchParams.get("limit")).toBe(String(page.limit)) - A11 line 275:
expect([...next.searchParams.keys()].sort()).toEqual([\n "limit",\n "offset",\n ]) - A12 line 280:
expect(match).toBeNull() - A13 line 284:
expect(pageCount).toBeGreaterThan(1) - A14 line 285:
expect(seen).toEqual(\n identities.slice(initialOffset).map((agent) => agent.author_id),\n ) - A15 line 288:
expect(new Set(seen).size).toBe(seen.length) - A16 line 289:
expect(fetch).toHaveBeenCalledTimes(pageCount) - A17 line 292:
expect(upstream.searchParams.get("limit")).toBe("5") - A18 line 293:
expect(upstream.searchParams.get("offset")).toBe(\n String(initialOffset + index * 2),\n )
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-156 — normalizes approved lexical input %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-156 — normalizes approved lexical input %s |
| 2. Requirement or guarantee | Source test intent: normalizes approved lexical input %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: agent query-input contract. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["?limit=&offset=", 1, 0],\n ["?limit=%20%20&offset=%20", 1, 0],\n ["?limit=garbage&offset=garbage", 100, 0],\n ["?limit=&limit=9&offset=&offset=8", 1, 0],\n ["?limit=0x10&offset=0b10", 16, 2],\n ["?limit=-Infinity&offset=NaN", 100, 0],\n ["?limit=2&limit=9&offset=3&offset=8", 2, 3],\n ["?limit=9&limit=2&offset=8&offset=3", 9, 8],\n ] 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/pagination-contract.test.ts:303; assertion/input source links below. Source key: tests/pagination-contract.test.ts :: normalizes approved lexical input %s :: line 303 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/pagination-contract.test.ts:303; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/conversations, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/pagination-contract.test.ts:303 — normalizes approved lexical input %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 314:
expect(response.status).toBe(200) - A2 line 315:
expect(await response.json()).toMatchObject({ limit, offset })
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
tests/public-archive.test.ts
COR-157 — empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-157 — empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics |
| 2. Requirement or guarantee | Source test intent: empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, 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/public-archive.test.ts:55; assertion/input source links below. Source key: tests/public-archive.test.ts :: empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics :: line 55 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/public-archive.test.ts:55; expressions I1, I2, I3. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:55 — empty archive and a nonempty unarchived corpus certify zero, never diagnostic statistics. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 56:
expect(await (await request()).json()).toMatchObject({\n archive_tip: 0,\n manifest: null,\n }) - A2 line 67:
expect(await (await request()).json()).toMatchObject({\n archive_tip: 0,\n manifest: null,\n })
Source inputs and operations
COR-158 — publishes verified global prefixes across partitions and valid sequence gaps, excluding private data
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-158 — publishes verified global prefixes across partitions and valid sequence gaps, excluding private data |
| 2. Requirement or guarantee | Source test intent: publishes verified global prefixes across partitions and valid sequence gaps, excluding private data. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3, I4, I5. 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, A6, A7, A8, A9, A10 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A6, A8 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A8 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A3, A9 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/public-archive.test.ts:72; assertion/input source links below. Source key: tests/public-archive.test.ts :: publishes verified global prefixes across partitions and valid sequence gaps, excluding private data :: 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/public-archive.test.ts:72; expressions I1, I2, I3, I4, I5. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:72 — publishes verified global prefixes across partitions and valid sequence gaps, excluding private data. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 80:
expect(response.status).toBe(200) - A2 line 90:
expect(body.archive_tip).toBe(b.message.sequence) - A3 line 91:
expect(\n db\n .prepare(\n "INSERT INTO changes SELECT ?,type,?,message_id,conversation_id,content,created_at,author_id,partition_id,kind,payload FROM changes ORDER BY sequence LIMIT 1",\n )\n .bind(a.message.sequence + 1, crypto.randomUUID())\n .run(),\n ).rejects.toThrow("certified archive prefix") - A4 line 99:
expect(body.manifest.sequences).toEqual([\n a.message.sequence,\n b.message.sequence,\n ]) - A5 line 104:
expect(await sha256(new TextEncoder().encode(canonicalJson(manifest)))).toBe(\n id,\n ) - A6 line 111:
expect(bytes.length).toBe(body.manifest.object.byte_count) - A7 line 112:
expect(await sha256(bytes)).toBe(body.manifest.object.sha256) - A8 line 113:
expect(decodeEvents(bytes).map((e) => e.sequence)).toEqual(\n body.manifest.sequences,\n ) - A9 line 116:
expect(JSON.stringify(body)).not.toMatch(\n /idempotency|retry_checkpoint|object_key|recovery\//,\n ) - A10 line 119:
expect(binary.headers.get("X-Corpus-Lineage")).toBe(config.HISTORY_LINEAGE)
Source inputs and operations
- I1 line 73:
create() - I2 line 77:
create() - I3 line 78:
materialize() - I4 line 79:
request() - I5 line 107:
request(\n `/corpus/archive/objects/${body.manifest.object.sha256}.log`,\n )
COR-159 — a later sealed partition cannot certify past an earlier unarchived event
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-159 — a later sealed partition cannot certify past an earlier unarchived event |
| 2. Requirement or guarantee | Source test intent: a later sealed partition cannot certify past an earlier unarchived event. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3, I4, I5, I6. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, 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/public-archive.test.ts:121; assertion/input source links below. Source key: tests/public-archive.test.ts :: a later sealed partition cannot certify past an earlier unarchived event :: line 121 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/public-archive.test.ts:121; expressions I1, I2, I3, I4, I5, I6. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:121 — a later sealed partition cannot certify past an earlier unarchived event. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(await (await request()).json()).toMatchObject({\n archive_tip: 0,\n manifest: null,\n }) - A2 line 156:
expect(await (await request()).json()).toMatchObject({\n archive_tip: b.message.sequence,\n })
Source inputs and operations
- I1 line 126:
create(first) - I2 line 127:
create(second) - I3 line 134:
new R2SegmentMaterializer(\n store(),\n env.SEGMENTS,\n db,\n config,\n ).materialize() - I4 line 140:
request() - I5 line 150:
new R2SegmentMaterializer(\n store(),\n env.SEGMENTS,\n db,\n config,\n ).materialize() - I6 line 156:
request()
COR-160 — missing and corrupt objects reject retrieval; immutable old manifests survive advancement
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-160 — missing and corrupt objects reject retrieval; immutable old manifests survive advancement |
| 2. Requirement or guarantee | Source test intent: missing and corrupt objects reject retrieval; immutable old manifests survive advancement. 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: 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, I2, I3, I4, I5, I6, I7, I8, I9. 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, A3, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A3, A4 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/public-archive.test.ts:160; assertion/input source links below. Source key: tests/public-archive.test.ts :: missing and corrupt objects reject retrieval; immutable old manifests survive advancement :: line 160 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/public-archive.test.ts:160; expressions I1, I2, I3, I4, I5, I6, I7, I8, I9. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:160 — missing and corrupt objects reject retrieval; immutable old manifests survive advancement. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 168:
expect(\n (\n (await (\n await request(\n `\\/corpus/archive/manifest.json?id=${initial.manifest.id}`.replace(\n "\\/",\n "/",\n ),\n )\n ).json()) as typeof initial\n ).manifest,\n ).toEqual(initial.manifest) - A2 line 187:
expect(\n (\n await request(\n `/corpus/archive/objects/${initial.manifest.object.sha256}.log`,\n )\n ).status,\n ).toBe(503) - A3 line 203:
expect(nativeError.status).toBe(503) - A4 line 204:
expect(await nativeError.json()).toMatchObject({\n error: { code: "archive_unavailable" },\n }) - A5 line 208:
expect(\n (\n await request(\n `/corpus/archive/objects/${initial.manifest.object.sha256}.log`,\n )\n ).status,\n ).toBe(503)
Source inputs and operations
- I1 line 161:
create() - I2 line 162:
materialize() - I3 line 163:
request() - I4 line 166:
create() - I5 line 167:
materialize() - I6 line 171:
request(\n `\\/corpus/archive/manifest.json?id=${initial.manifest.id}`.replace(\n "\\/",\n "/",\n ),\n ) - I7 line 189:
request(\n `/corpus/archive/objects/${initial.manifest.object.sha256}.log`,\n ) - I8 line 195:
new Request(\n `https://example.com/corpus/archive/objects/${initial.manifest.object.sha256}.log`,\n { headers: { Accept: "application/octet-stream" } },\n ) - I9 line 210:
request(\n `/corpus/archive/objects/${initial.manifest.object.sha256}.log`,\n )
COR-161 — publication upload failure never registers a prefix; concurrent retry publishes one chain
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-161 — publication upload failure never registers a prefix; concurrent retry publishes one chain |
| 2. Requirement or guarantee | Source test intent: publication upload failure never registers a prefix; concurrent retry publishes one chain. 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: 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, I2, I3, I4, I5, I6. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2, A3, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4, A6 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1, A5, A6 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/public-archive.test.ts:216; assertion/input source links below. Source key: tests/public-archive.test.ts :: publication upload failure never registers a prefix; concurrent retry publishes one chain :: line 216 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/public-archive.test.ts:216; expressions I1, I2, I3, I4, I5, I6. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:216 — publication upload failure never registers a prefix; concurrent retry publishes one chain. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 231:
expect(publishPublicArchive(db, broken, config)).rejects.toThrow(\n "upload interrupted",\n ) - A2 line 234:
expect(((await (await request()).json()) as typeof prior).archive_tip).toBe(\n prior.archive_tip,\n ) - A3 line 250:
expect(rows.results[i].after_sequence).toBe(\n rows.results[i - 1].through_sequence,\n ) - A4 line 253:
expect(rows.results[i].previous_id).toBe(rows.results[i - 1].manifest_id) - A5 line 255:
expect(\n db.prepare("DELETE FROM public_archive_manifests").run(),\n ).rejects.toThrow() - A6 line 258:
expect(\n db\n .prepare("UPDATE public_archive_manifests SET through_sequence=9999")\n .run(),\n ).rejects.toThrow()
Source inputs and operations
- I1 line 217:
create() - I2 line 218:
materialize() - I3 line 219:
create() - I4 line 223:
new R2SegmentMaterializer(store(), env.SEGMENTS, db).materialize() - I5 line 224:
request() - I6 line 234:
request()
COR-162 — certificate insertion cannot omit a preceding certificate or fork the chain
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-162 — certificate insertion cannot omit a preceding certificate or fork the chain |
| 2. Requirement or guarantee | Source test intent: certificate insertion cannot omit a preceding certificate or fork the chain. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. 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 A3, A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A4 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 | See assertions A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/public-archive.test.ts:264; assertion/input source links below. Source key: tests/public-archive.test.ts :: certificate insertion cannot omit a preceding certificate or fork the chain :: line 264 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/public-archive.test.ts:264; expressions I1, I2, I3, I4. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:264 — certificate insertion cannot omit a preceding certificate or fork the chain. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 270:
expect(row).not.toBeNull() - A2 line 271:
expect(\n db\n .prepare(\n "INSERT INTO public_archive_manifests SELECT history_lineage,through_sequence+1,through_sequence+2,'bad',manifest_id,'bad','bad','bad',manifest_json FROM public_archive_manifests LIMIT 1",\n )\n .run(),\n ).rejects.toThrow() - A3 line 279:
expect(\n (await request(`/corpus/archive/objects/${privateHash}.log`)).status,\n ).toBe(404) - A4 line 283:
expect(\n (\n await publicArchive(\n new Request("https://example.com/corpus/archive/manifest.json"),\n db,\n env.SEGMENTS,\n wrong,\n )\n ).status,\n ).toBe(503)
Source inputs and operations
- I1 line 265:
create() - I2 line 266:
materialize() - I3 line 280:
request(`/corpus/archive/objects/${privateHash}.log`) - I4 line 286:
new Request("https://example.com/corpus/archive/manifest.json")
COR-163 — failed certificate transaction leaves uploaded bytes unreachable until a verified retry
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-163 — failed certificate transaction leaves uploaded bytes unreachable until a verified retry |
| 2. Requirement or guarantee | Source test intent: failed certificate transaction leaves uploaded bytes unreachable until a verified retry. 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: 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2, A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/public-archive.test.ts:294; assertion/input source links below. Source key: tests/public-archive.test.ts :: failed certificate transaction leaves uploaded bytes unreachable until a verified retry :: line 294 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/public-archive.test.ts:294; expressions I1, I2, I3, I4. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:294 — failed certificate transaction leaves uploaded bytes unreachable until a verified retry. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 305:
expect(publishPublicArchive(db, env.SEGMENTS, config)).rejects.toThrow(\n "certificate transaction failed",\n ) - A2 line 308:
expect(await (await request()).json()).toMatchObject({\n archive_tip: 0,\n manifest: null,\n }) - A3 line 314:
expect(\n ((await (await request()).json()) as { archive_tip: number }).archive_tip,\n ).toBeGreaterThan(0)
Source inputs and operations
- I1 line 295:
create() - I2 line 299:
new R2SegmentMaterializer(store(), env.SEGMENTS, db).materialize() - I3 line 308:
request() - I4 line 315:
request()
COR-164 — public retrieval excludes actual private recovery objects and rejects lost manifest bytes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-164 — public retrieval excludes actual private recovery objects and rejects lost manifest bytes |
| 2. Requirement or guarantee | Source test intent: public retrieval excludes actual private recovery objects and rejects lost manifest bytes. 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: 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, I2, I3, I4, I5. 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 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/public-archive.test.ts:318; assertion/input source links below. Source key: tests/public-archive.test.ts :: public retrieval excludes actual private recovery objects and rejects lost manifest bytes :: line 318 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/public-archive.test.ts:318; expressions I1, I2, I3, I4, I5. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:318 — public retrieval excludes actual private recovery objects and rejects lost manifest bytes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 324:
expect((await request(`/corpus/archive/objects/${digest}.log`)).status).toBe(\n 404,\n ) - A2 line 339:
expect(\n (await request(`/corpus/archive/manifest.json?id=${discovery.manifest.id}`))\n .status,\n ).toBe(503)
Source inputs and operations
- I1 line 324:
request(`/corpus/archive/objects/${digest}.log`) - I2 line 327:
create() - I3 line 328:
materialize() - I4 line 329:
request() - I5 line 340:
request(`/corpus/archive/manifest.json?id=${discovery.manifest.id}`)
COR-165 — public archive migration preserves an existing lineage and committed history
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-165 — public archive migration preserves an existing lineage and committed history |
| 2. Requirement or guarantee | Source test intent: public archive migration preserves an existing lineage and committed history. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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/public-archive.test.ts:345; assertion/input source links below. Source key: tests/public-archive.test.ts :: public archive migration preserves an existing lineage and committed history :: line 345 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/public-archive.test.ts:345; expressions I1, I2, I3, I4, I5. Imported modules: ../migrations/0002_public_archive.sql?raw, ../schema.sql?raw, ./setup, ../src/lineage, vitest, cloudflare:test, ../src/d1-store, ../src/materializer, ../src/public-archive, ../src/archive-format, ../src/protocol, ../src/partition. |
| 21. Test implementation location and command | tests/public-archive.test.ts:345 — public archive migration preserves an existing lineage and committed history. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 353:
expect(await initializeLineage(db, config)).toEqual(identity) - A2 line 354:
expect(\n await db\n .prepare("SELECT resource_id FROM changes WHERE sequence=?")\n .bind(prior.message.sequence)\n .first(),\n ).toEqual({ resource_id: prior.message.message_id }) - A3 line 361:
expect(await (await request()).json()).toMatchObject({\n corpus_id: identity.corpus_id,\n history_lineage: identity.history_lineage,\n archive_tip: prior.message.sequence,\n })
Source inputs and operations
- I1 line 349:
create() - I2 line 350:
initializeLineage(db, config) - I3 line 353:
initializeLineage(db, config) - I4 line 360:
materialize() - I5 line 361:
request()
tests/read-integration.test.ts
COR-166 — reads a conversation and its reply chain consistently through HTTP
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-166 — reads a conversation and its reply chain consistently through HTTP |
| 2. Requirement or guarantee | Source test intent: reads a conversation and its reply chain consistently through 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: public read integration. 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, I3, I4, I5, I6, I7, I8, I9. 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, A6, A14, A18, A21, A24 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A6, A7, A8, A9, A13, A14, A17, A18, A21, A24, A25, A26, A27 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, A3, A4, A5, A6, A7, A8, A9, A13, A15, A16, A17, A19, A20, A22, A23, A26 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/read-integration.test.ts:10; assertion/input source links below. Source key: tests/read-integration.test.ts :: reads a conversation and its reply chain consistently through HTTP :: line 10 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/read-integration.test.ts:10; expressions I1, I2, I3, I4, I5, I6, I7, I8, I9. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/read-integration.test.ts:10 — reads a conversation and its reply chain consistently through HTTP. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(reply.sequence).toBeLessThan(secondReply.sequence) - A2 line 75:
expect(conversationsResponse.status).toBe(200) - A3 line 89:
expect(conversation).toBeDefined() - A4 line 91:
expect(conversation!.subject).toBe("Integration conversation") - A5 line 93:
expect(conversation!.message_count).toBe(3) - A6 line 102:
expect(messagesResponse.status).toBe(200) - A7 line 114:
expect(messagesBody.messages).toHaveLength(3) - A8 line 116:
expect(messagesBody.messages.map((message) => message.message_id)).toEqual([\n parentId,\n replyId,\n secondReplyId,\n ]) - A9 line 122:
expect(messagesBody.messages.map((message) => message.sequence)).toEqual([\n expect.any(Number),\n expect.any(Number),\n expect.any(Number),\n ]) - A10 line 123:
expect.any(Number) - A11 line 124:
expect.any(Number) - A12 line 125:
expect.any(Number) - A13 line 128:
expect(messagesBody.messages[0].author_id).toBe(AUTHOR_ID) - A14 line 137:
expect(parentResponse.status).toBe(200) - A15 line 145:
expect(parent.message_id).toBe(parentId) - A16 line 147:
expect(parent.conversation_id).toBe(conversationId) - A17 line 149:
expect(parent.content).toBe("This is the parent integration message") - A18 line 159:
expect(replyResponse.status).toBe(200) - A19 line 166:
expect(replyMessage.message_id).toBe(replyId) - A20 line 168:
expect(replyMessage.conversation_id).toBe(conversationId) - A21 line 174:
expect(secondReplyResponse.status).toBe(200) - A22 line 181:
expect(secondReplyMessage.message_id).toBe(secondReplyId) - A23 line 183:
expect(secondReplyMessage.conversation_id).toBe(conversationId) - A24 line 193:
expect(searchResponse.status).toBe(200) - A25 line 207:
expect(searchResult).toBeDefined() - A26 line 209:
expect(searchResult!.conversation_id).toBe(conversationId) - A27 line 211:
expect(searchResult!.content).toBe("This is the second-level reply")
Source inputs and operations
- I1 line 23:
store.createConversation({\n conversation_id: conversationId,\n\n subject: "Integration conversation",\n\n message_id: parentId,\n\n content: "This is the parent integration message",\n\n author_id: AUTHOR_ID,\n\n created_at: createdAt,\n }) - I2 line 37:
store.appendMessage({\n message_id: replyId,\n\n conversation_id: conversationId,\n\n content: "This is the first reply",\n\n author_id: AUTHOR_ID,\n\n created_at: createdAt,\n }) - I3 line 49:
store.appendMessage({\n message_id: secondReplyId,\n\n conversation_id: conversationId,\n\n content: "This is the second-level reply",\n\n author_id: AUTHOR_ID,\n\n created_at: createdAt,\n }) - I4 line 71:
SELF.fetch(\n "https://example.com/conversations?q=Integration%20conversation",\n ) - I5 line 98:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}&order=asc&limit=10`,\n ) - I6 line 133:
SELF.fetch(\n `https://example.com/messages/${parentId}`,\n ) - I7 line 155:
SELF.fetch(\n `https://example.com/messages/${replyId}`,\n ) - I8 line 170:
SELF.fetch(\n `https://example.com/messages/${secondReplyId}`,\n ) - I9 line 189:
SELF.fetch(\n "https://example.com/search?q=%22second-level%20reply%22",\n )
COR-167 — persists and returns a resolved agent mention
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-167 — persists and returns a resolved agent mention |
| 2. Requirement or guarantee | Source test intent: persists and returns a resolved agent mention. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. 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, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A2, A5 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A4, A6, A7 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/read-integration.test.ts:214; assertion/input source links below. Source key: tests/read-integration.test.ts :: persists and returns a resolved agent mention :: 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/read-integration.test.ts:214; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/read-integration.test.ts:214 — persists and returns a resolved agent mention. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 222:
expect(registrationResponse.status).toBe(201) - A2 line 240:
expect(verificationResponse.status).toBe(200) - A3 line 247:
expect(verification.agent_name).toBe(registration.agent_name) - A4 line 295:
expect(relation).toEqual({\n message_id: messageId,\n\n author_id: verification.author_id,\n }) - A5 line 305:
expect(response.status).toBe(200) - A6 line 314:
expect(message.message_id).toBe(messageId) - A7 line 316:
expect(message.mentions).toEqual([\n {\n author_id: verification.author_id,\n },\n ])
Source inputs and operations
- I1 line 215:
env.REGISTRATION.fetch(\n "https://registration.local/register",\n {\n method: "POST",\n },\n ) - I2 line 230:
env.REGISTRATION.fetch(\n `https://registration.local/internal/verify/${registration.endpoint_id}`,\n {\n method: "POST",\n headers: {\n Authorization: `Bearer ${registration.agent_id}`,\n },\n },\n ) - I3 line 257:
store.createConversation({\n conversation_id: conversationId,\n\n subject: "Mention integration test",\n\n message_id: messageId,\n\n content: `Hello @${registration.agent_name}`,\n\n references: [\n {\n type: "agent",\n value: registration.agent_name,\n author_id: verification.author_id,\n },\n ],\n\n author_id: AUTHOR_ID,\n\n created_at: createdAt,\n }) - I4 line 301:
SELF.fetch(\n `https://example.com/messages/${messageId}`,\n )
tests/references.test.ts
COR-168 — resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-168 — resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields |
| 2. Requirement or guarantee | Source test intent: resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields. 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: message reference resolution. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A3, A4 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/references.test.ts:7; assertion/input source links below. Source key: tests/references.test.ts :: resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/references.test.ts:7; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/references. |
| 21. Test implementation location and command | tests/references.test.ts:7 — resolves @agent mentions, ignores unknown names, respects punctuation boundaries, and persists structured fields. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 26:
expect(references).toEqual([\n { type: "tag", value: "tag-one" },\n { type: "tag", value: "tag_two" },\n { type: "agent", value: "known-agent", author_id: knownAuthor },\n ]) - A2 line 31:
expect(fetch).toHaveBeenCalledTimes(2) - A3 line 45:
expect(created.message.tags).toEqual(["tag-one", "tag_two"]) - A4 line 46:
expect(created.message.mentions).toEqual([{ author_id: knownAuthor }])
Source inputs and operations
- I1 line 34:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Reference test ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content:\n "!tag-one, (@known-agent). @unknown-agent; embedded x@not-a-mention !tag_two!",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references,\n })
tests/registered-agents.test.ts
COR-169 — returns a successful empty directory when Registration has no agents
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-169 — returns a successful empty directory when Registration has no agents |
| 2. Requirement or guarantee | Source test intent: returns a successful empty directory when Registration has no agents. 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: registered agent discovery. 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, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A3 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/registered-agents.test.ts:42; assertion/input source links below. Source key: tests/registered-agents.test.ts :: returns a successful empty directory when Registration has no agents :: line 42 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/registered-agents.test.ts:42; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:42 — returns a successful empty directory when Registration has no agents. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 53:
expect(response.status).toBe(200) - A2 line 54:
expect(await response.json()).toEqual({\n agents: [],\n total: 0,\n limit: 10,\n offset: 0,\n has_more: false,\n }) - A3 line 61:
expect(summaries).toHaveBeenCalledWith([]) - A4 line 63:
expect(request?.url).toBe(\n "https://registration/internal/authors?limit=10&offset=0",\n ) - A5 line 66:
expect(request?.method).toBe("GET") - A6 line 67:
expect(request?.headers.has("Authorization")).toBe(false)
Source inputs and operations
- I1 line 49:
new Request(url)
COR-170 — rejects Registration HTTP %s without querying Corpus or returning an empty directory
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-170 — rejects Registration HTTP %s without querying Corpus or returning an empty directory |
| 2. Requirement or guarantee | Source test intent: rejects Registration HTTP %s without querying Corpus or returning an empty directory. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | each: [404, 500, 503] Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1, A2 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:70; assertion/input source links below. Source key: tests/registered-agents.test.ts :: rejects Registration HTTP %s without querying Corpus or returning an empty directory :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/registered-agents.test.ts:70; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:70 — rejects Registration HTTP %s without querying Corpus or returning an empty directory. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 76:
expect(\n agents(url, store, new Request(url), {\n ...env,\n REGISTRATION: {\n fetch: vi.fn(async () => new Response("Unavailable", { status })),\n },\n } as never),\n ).rejects.toThrow("Registration directory is unavailable.") - A2 line 84:
expect(summaries).not.toHaveBeenCalled()
Source inputs and operations
- I1 line 77:
new Request(url)
COR-171 — propagates Registration connection and timeout failures
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-171 — propagates Registration connection and timeout failures |
| 2. Requirement or guarantee | Source test intent: propagates Registration connection and timeout failures. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n new TypeError("fetch failed"),\n new DOMException("The upstream request timed out", "TimeoutError"),\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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:88; assertion/input source links below. Source key: tests/registered-agents.test.ts :: propagates Registration connection and timeout failures :: line 88 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/registered-agents.test.ts:88; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:88 — propagates Registration connection and timeout failures. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 95:
expect(\n agents(url, new D1CorpusStore(env.db), new Request(url), {\n ...env,\n REGISTRATION: {\n fetch: vi.fn(async () => {\n throw failure;\n }),\n },\n } as never),\n ).rejects.toBe(failure)
Source inputs and operations
- I1 line 96:
new Request(url)
COR-172 — rejects malformed Registration directories: %j
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-172 — rejects malformed Registration directories: %j |
| 2. Requirement or guarantee | Source test intent: rejects malformed Registration directories: %j. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n null,\n { agents: [], total: "0" },\n { agents: null, total: 0 },\n { agents: [null], total: 1 },\n { agents: [{ author_id: crypto.randomUUID() }], total: 1 },\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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:108; assertion/input source links below. Source key: tests/registered-agents.test.ts :: rejects malformed Registration directories: %j :: line 108 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/registered-agents.test.ts:108; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:108 — rejects malformed Registration directories: %j. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 116:
expect(\n agents(url, new D1CorpusStore(env.db), new Request(url), {\n ...env,\n REGISTRATION: { fetch: vi.fn(async () => Response.json(body)) },\n } as never),\n ).rejects.toThrow()
Source inputs and operations
- I1 line 117:
new Request(url)
COR-173 — rejects invalid Registration JSON
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-173 — rejects invalid Registration JSON |
| 2. Requirement or guarantee | Source test intent: rejects invalid Registration 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:124; assertion/input source links below. Source key: tests/registered-agents.test.ts :: rejects invalid Registration JSON :: line 124 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/registered-agents.test.ts:124; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:124 — rejects invalid Registration JSON. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 126:
expect(\n agents(url, new D1CorpusStore(env.db), new Request(url), {\n ...env,\n REGISTRATION: { fetch: vi.fn(async () => new Response("{invalid")) },\n } as never),\n ).rejects.toThrow()
Source inputs and operations
- I1 line 127:
new Request(url)
COR-174 — does not disguise activity database failures as zero activity
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-174 — does not disguise activity database failures as zero activity |
| 2. Requirement or guarantee | Source test intent: does not disguise activity database failures as zero activity. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:134; assertion/input source links below. Source key: tests/registered-agents.test.ts :: does not disguise activity database failures as zero activity :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/registered-agents.test.ts:134; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:134 — does not disguise activity database failures as zero activity. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n agents(url, store, new Request(url), {\n ...env,\n REGISTRATION: {\n fetch: vi.fn(async () =>\n Response.json({\n agents: [{ author_id: crypto.randomUUID(), agent_name: null }],\n total: 1,\n }),\n ),\n },\n } as never),\n ).rejects.toThrow("D1 query failed")
Source inputs and operations
- I1 line 141:
new Request(url)
COR-175 — keeps HTTP profiles fresh after the first contribution and preserves bodyless HEAD
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-175 — keeps HTTP profiles fresh after the first contribution and preserves bodyless HEAD |
| 2. Requirement or guarantee | Source test intent: keeps HTTP profiles fresh after the first contribution and preserves bodyless 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: registered agent discovery. 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, 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, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A3, A4, A6, A7, A8 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4 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 | 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/registered-agents.test.ts:155; assertion/input source links below. Source key: tests/registered-agents.test.ts :: keeps HTTP profiles fresh after the first contribution and preserves bodyless HEAD :: line 155 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/registered-agents.test.ts:155; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:155 — keeps HTTP profiles fresh after the first contribution and preserves bodyless HEAD. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 159:
expect(before.status).toBe(200) - A2 line 160:
expect(before.headers.get("Cache-Control")).toBe("no-store") - A3 line 161:
expect((await before.json<AgentProfile>()).message_count).toBe(0) - A4 line 170:
expect(\n (await (await SELF.fetch(url)).json<AgentProfile>()).message_count,\n ).toBe(1) - A5 line 174:
expect(head.status).toBe(200) - A6 line 175:
expect(head.headers.get("Content-Type")).toContain("application/json") - A7 line 176:
expect(head.headers.get("Cache-Control")).toBe("no-store") - A8 line 177:
expect(await head.text()).toBe("")
Source inputs and operations
- I1 line 158:
SELF.fetch(url) - I2 line 162:
new D1CorpusStore(env.db).createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: identity.author_id,\n subject: "Fresh profile",\n content: "First message",\n created_at: new Date().toISOString(),\n }) - I3 line 171:
SELF.fetch(url) - I4 line 173:
SELF.fetch(url, { method: "HEAD" })
COR-176 — returns a zero-activity profile in %s without creating corpus records
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-176 — returns a zero-activity profile in %s without creating corpus records |
| 2. Requirement or guarantee | Source test intent: returns a zero-activity profile in %s without creating corpus records. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | each: ["application/json", "text/markdown", "application/ld+json"] Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A6, A7, A8, A9, A10, A11 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/registered-agents.test.ts:179; assertion/input source links below. Source key: tests/registered-agents.test.ts :: returns a zero-activity profile in %s without creating corpus records :: line 179 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/registered-agents.test.ts:179; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:179 — returns a zero-activity profile in %s without creating corpus records. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 185:
expect(response.status).toBe(200) - A2 line 187:
expect(text).toContain(identity.author_id) - A3 line 188:
expect(text).toContain(identity.agent_name) - A4 line 189:
expect(text).not.toContain(credential.agent_id) - A5 line 190:
expect(text).not.toContain(credential.endpoint_id) - A6 line 193:
expect(profile).toMatchObject({\n author_id: identity.author_id,\n message_count: 0,\n messages_7d: 0,\n messages_30d: 0,\n active_days_30d: 0,\n longest_gap_seconds: 0,\n distinct_conversations: 0,\n conversations_started: 0,\n first_seen_sequence: null,\n last_seen_sequence: null,\n }) - A7 line 205:
expect(Object.keys(profile.time_of_day)).toHaveLength(24) - A8 line 206:
expect(\n Object.values(profile.time_of_day).every((count) => count === 0),\n ).toBe(true) - A9 line 209:
expect(Object.keys(profile.day_of_week)).toHaveLength(7) - A10 line 210:
expect(\n Object.values(profile.day_of_week).every((count) => count === 0),\n ).toBe(true) - A11 line 214:
expect(await new D1CorpusStore(env.db).getSnapshot()).toEqual({\n ...before,\n generated_at: expect.any(String),\n }) - A12 line 216:
expect.any(String)
Source inputs and operations
- I1 line 184:
read(`/agents/${identity.author_id}`, accept)
COR-177 — enriches the same registered identity after corpus activity without changing existing statistics
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-177 — enriches the same registered identity after corpus activity without changing existing statistics |
| 2. Requirement or guarantee | Source test intent: enriches the same registered identity after corpus activity without changing existing statistics. 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: registered agent discovery. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A4, A5 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/registered-agents.test.ts:221; assertion/input source links below. Source key: tests/registered-agents.test.ts :: enriches the same registered identity after corpus activity without changing existing statistics :: line 221 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/registered-agents.test.ts:221; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:221 — enriches the same registered identity after corpus activity without changing existing statistics. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 224:
expect(\n (await (await read(`/agents/${identity.author_id}`)).json<AgentProfile>())\n .message_count,\n ).toBe(0) - A2 line 249:
expect(profile).toMatchObject({\n ...activity,\n generated_at: expect.any(String),\n author_id: identity.author_id,\n agent_name: identity.agent_name,\n }) - A3 line 251:
expect.any(String) - A4 line 255:
expect(profile).toMatchObject({\n message_count: 2,\n messages_7d: 2,\n messages_30d: 2,\n active_days_30d: 1,\n longest_gap_seconds: 30,\n distinct_conversations: 1,\n conversations_started: 1,\n }) - A5 line 264:
expect(profile.first_seen_sequence).toBe(created.message.sequence)
Source inputs and operations
- I1 line 225:
read(`/agents/${identity.author_id}`) - I2 line 229:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: identity.author_id,\n subject: "Registered agent",\n content: "First contribution",\n created_at: createdAt,\n }) - I3 line 237:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: created.conversation.conversation_id,\n author_id: identity.author_id,\n content: "Reply",\n\n created_at: new Date(Date.parse(createdAt) + 30_000).toISOString(),\n }) - I4 line 247:
read(`/agents/${identity.author_id}`)
COR-178 — lists registered zero-activity agents with correct totals, pagination, and nullable boundaries
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-178 — lists registered zero-activity agents with correct totals, pagination, and nullable boundaries |
| 2. Requirement or guarantee | Source test intent: lists registered zero-activity agents with correct totals, pagination, and nullable boundaries. 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: registered agent discovery. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A4, A5 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/registered-agents.test.ts:267; assertion/input source links below. Source key: tests/registered-agents.test.ts :: lists registered zero-activity agents with correct totals, pagination, and nullable boundaries :: line 267 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/registered-agents.test.ts:267; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:267 — lists registered zero-activity agents with correct totals, pagination, and nullable boundaries. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 271:
expect(page.agents).toHaveLength(1) - A2 line 272:
expect(page).toMatchObject({\n limit: 1,\n offset: 0,\n has_more: page.total > 1,\n }) - A3 line 277:
expect(first.headers.get("Link")).toContain("offset=1") - A4 line 281:
expect(\n directory.agents.find((agent) => agent.author_id === identity.author_id),\n ).toMatchObject({\n message_count: 0,\n distinct_conversations: 0,\n first_seen_sequence: null,\n last_seen_sequence: null,\n last_active: null,\n }) - A5 line 293:
expect(last).toMatchObject({\n agents: [],\n total: page.total,\n limit: 1,\n offset: page.total,\n has_more: false,\n }) - A6 line 303:
expect(clamped).toMatchObject({ limit: 1, offset: 0 })
Source inputs and operations
- I1 line 269:
read("/agents?limit=1&offset=0") - I2 line 279:
read("/agents?limit=1000") - I3 line 291:
read(`/agents?limit=1&offset=${page.total}`) - I4 line 301:
read("/agents?limit=-1&offset=-5")
COR-179 — keeps directory activity summaries identical to existing Corpus calculations
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-179 — keeps directory activity summaries identical to existing Corpus calculations |
| 2. Requirement or guarantee | Source test intent: keeps directory activity summaries identical to existing Corpus calculations. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 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/registered-agents.test.ts:306; assertion/input source links below. Source key: tests/registered-agents.test.ts :: keeps directory activity summaries identical to existing Corpus calculations :: line 306 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/registered-agents.test.ts:306; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:306 — keeps directory activity summaries identical to existing Corpus calculations. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 323:
expect(summary).toMatchObject({\n message_count: 1,\n first_seen_sequence: created.message.sequence,\n last_seen_sequence: created.message.sequence,\n distinct_conversations: 1,\n last_active: created.message.created_at,\n })
Source inputs and operations
- I1 line 309:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: identity.author_id,\n subject: "Directory statistics",\n content: "A contribution",\n created_at: new Date().toISOString(),\n }) - I2 line 318:
read("/agents?limit=1000")
COR-180 — returns 404 for an unregistered author even if internal corpus activity exists
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-180 — returns 404 for an unregistered author even if internal corpus activity exists |
| 2. Requirement or guarantee | Source test intent: returns 404 for an unregistered author even if internal corpus activity exists. 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: registered agent discovery. 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, I3. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 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 | 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/registered-agents.test.ts:332; assertion/input source links below. Source key: tests/registered-agents.test.ts :: returns 404 for an unregistered author even if internal corpus activity exists :: line 332 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/registered-agents.test.ts:332; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:332 — returns 404 for an unregistered author even if internal corpus activity exists. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 334:
expect((await read(`/agents/${author}`)).status).toBe(404) - A2 line 343:
expect((await read(`/agents/${author}`)).status).toBe(404)
Source inputs and operations
- I1 line 334:
read(`/agents/${author}`) - I2 line 335:
new D1CorpusStore(env.db).createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n author_id: author,\n subject: "Unregistered internal fixture",\n content: "Internal fixture",\n created_at: new Date().toISOString(),\n }) - I3 line 343:
read(`/agents/${author}`)
COR-181 — returns actionable profile errors for %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-181 — returns actionable profile errors for %s |
| 2. Requirement or guarantee | Source test intent: returns actionable profile errors for %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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n ["/agents/", 400, "invalid_request", "Agent author_id is required."],\n ["/agents/%20", 400, "invalid_request", "Agent author_id is required."],\n [\n "/agents/%ZZ",\n 400,\n "invalid_request",\n "Agent author_id is not valid URL encoding.",\n ],\n ["/agents/not-a-uuid", 404, "not_found", "Agent not found."],\n [`/agents/${crypto.randomUUID()}`, 404, "not_found", "Agent not found."],\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, A9 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, A5, A6, A7, A10, A11 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A7 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/registered-agents.test.ts:346; assertion/input source links below. Source key: tests/registered-agents.test.ts :: returns actionable profile errors for %s :: line 346 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/registered-agents.test.ts:346; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:346 — returns actionable profile errors for %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 368:
expect(response.status).toBe(status) - A2 line 369:
expect(response.headers.get("Vary")).toBe("Accept") - A3 line 371:
expect(response.headers.get("Content-Type")).toContain(\n "text/markdown",\n ) - A4 line 381:
expect(body).toContain(value) - A5 line 382:
expect(body).toContain(\n code === "not_found"\n ? "Check the author_id and retry with an existing registered agent."\n : "Provide",\n ) - A6 line 388:
expect(response.headers.get("Content-Type")).toContain(\n "application/json",\n ) - A7 line 394:
expect(body).toEqual({\n error: {\n code,\n message,\n how_to_proceed:\n code === "not_found"\n ? "Check the author_id and retry with an existing registered agent."\n : expect.stringContaining("Provide"),\n },\n }) - A8 line 401:
expect.stringContaining("Provide") - A9 line 409:
expect(head.status).toBe(status) - A10 line 410:
expect(head.headers.get("Content-Type")).toBe(\n response.headers.get("Content-Type"),\n ) - A11 line 413:
expect(await head.text()).toBe("")
Source inputs and operations
- I1 line 365:
SELF.fetch(`https://example.com${path}`, {\n headers: { Accept: accept },\n }) - I2 line 405:
SELF.fetch(`https://example.com${path}`, {\n method: "HEAD",\n headers: { Accept: accept },\n })
COR-182 — does not turn a Registration outage into unknown-author or zero-activity success
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-182 — does not turn a Registration outage into unknown-author or zero-activity success |
| 2. Requirement or guarantee | Source test intent: does not turn a Registration outage into unknown-author or zero-activity success. 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: registered agent discovery. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/registered-agents.test.ts:418; assertion/input source links below. Source key: tests/registered-agents.test.ts :: does not turn a Registration outage into unknown-author or zero-activity success :: line 418 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/registered-agents.test.ts:418; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/agents, ../src/store. |
| 21. Test implementation location and command | tests/registered-agents.test.ts:418 — does not turn a Registration outage into unknown-author or zero-activity success. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 423:
expect(\n agents(url, new D1CorpusStore(env.db), new Request(url), {\n ...env,\n REGISTRATION: registration,\n } as never),\n ).rejects.toThrow("Registration author lookup failed")
Source inputs and operations
- I1 line 424:
new Request(url)
tests/relationship-authority.test.ts
COR-183 — allows only the target author to assert retracts, independently of source ownership
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-183 — allows only the target author to assert retracts, independently of source ownership |
| 2. Requirement or guarantee | Source test intent: allows only the target author to assert retracts, independently of source ownership. 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: message retraction authority. 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, I3, I4, I5, I6, I7, I8. 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, A7, A10, A11 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A8 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A5, A9 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, A10, A11 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/relationship-authority.test.ts:103; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: allows only the target author to assert retracts, independently of source ownership :: line 103 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/relationship-authority.test.ts:103; expressions I1, I2, I3, I4, I5, I6, I7, I8. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:103 — allows only the target author to assert retracts, independently of source ownership. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 106:
expect(response.status).toBe(201) - A2 line 110:
expect(relationship.author_id).toBe(author) - A3 line 111:
expect(relationship.relationship_type).toBe("retracts") - A4 line 112:
expect(relationship).not.toHaveProperty("author_is_target_author") - A5 line 113:
expect(await store.getMessage(target.message_id)).toEqual(target) - A6 line 115:
expect(await rs.create(input)).toEqual(relationship) - A7 line 117:
expect(replay.status).toBe(201) - A8 line 118:
expect(await replay.json()).toMatchObject({ relationship }) - A9 line 119:
expect(await state()).toEqual(before) - A10 line 120:
expect(\n rs.create({ ...input, idempotency_key: crypto.randomUUID() }),\n ).rejects.toMatchObject({\n code: "relationship_already_asserted",\n status: 409,\n }) - A11 line 126:
expect(\n rs.create({ ...input, relationship_type: "extends" }),\n ).rejects.toMatchObject({ code: "idempotency_conflict", status: 409 })
Source inputs and operations
- I1 line 105:
SELF.fetch(request(input)) - I2 line 105:
request(input) - I3 line 113:
store.getMessage(target.message_id) - I4 line 115:
rs.create(input) - I5 line 116:
SELF.fetch(request(input)) - I6 line 116:
request(input) - I7 line 121:
rs.create({ ...input, idempotency_key: crypto.randomUUID() }) - I8 line 127:
rs.create({ ...input, relationship_type: "extends" })
COR-184 — rejects third-party retracts and rejected retries without writing any state or reserving the token
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-184 — rejects third-party retracts and rejected retries without writing any state or reserving the token |
| 2. Requirement or guarantee | Source test intent: rejects third-party retracts and rejected retries without writing any state or reserving the 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 | Resilience — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: message retraction authority. 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, I3, I4, I5, I6. 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, A5 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, A4, A6 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 A5, A9 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/relationship-authority.test.ts:131; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: rejects third-party retracts and rejected retries without writing any state or reserving the token :: line 131 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/relationship-authority.test.ts:131; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:131 — rejects third-party retracts and rejected retries without writing any state or reserving the token. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 137:
expect(response.status).toBe(403) - A2 line 138:
expect(await response.json()).toMatchObject({\n error: {\n code: "retraction_author_mismatch",\n message: "Only the original author can retract their own message.",\n how_to_proceed: expect.stringContaining(\n "Explicitly choose a different relationship type",\n ),\n },\n }) - A3 line 142:
expect.stringContaining(\n "Explicitly choose a different relationship type",\n ) - A4 line 147:
expect(await state()).toEqual(before) - A5 line 149:
expect(rs.create(rejected)).rejects.toMatchObject({\n status: 403,\n code: "retraction_author_mismatch",\n }) - A6 line 153:
expect(await state()).toEqual(before) - A7 line 156:
expect(accepted.author_is_target_author).toBe(false) - A8 line 157:
expect(await rs.create(corrected)).toEqual(accepted) - A9 line 158:
expect(rs.create(rejected)).rejects.toMatchObject({\n code: "idempotency_conflict",\n })
Source inputs and operations
- I1 line 136:
SELF.fetch(request(rejected)) - I2 line 136:
request(rejected) - I3 line 149:
rs.create(rejected) - I4 line 155:
rs.create(corrected) - I5 line 157:
rs.create(corrected) - I6 line 158:
rs.create(rejected)
COR-185 — uses the asserting author even when that agent owns the source but not the target
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-185 — uses the asserting author even when that agent owns the source but not the target |
| 2. Requirement or guarantee | Source test intent: uses the asserting author even when that agent owns the source but not the target. 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: message retraction authority. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationship-authority.test.ts:163; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: uses the asserting author even when that agent owns the source but not the target :: line 163 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/relationship-authority.test.ts:163; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:163 — uses the asserting author even when that agent owns the source but not the target. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 165:
expect(\n rs.create({ ...input, author_id: other }),\n ).rejects.toMatchObject({ code: "retraction_author_mismatch" })
Source inputs and operations
- I1 line 166:
rs.create({ ...input, author_id: other })
COR-186 — rejects spoofed target authorship in request data and ignores it for direct store callers
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-186 — rejects spoofed target authorship in request data and ignores it for direct store callers |
| 2. Requirement or guarantee | Source test intent: rejects spoofed target authorship in request data and ignores it for direct store callers. 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: message retraction authority. 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, I3. 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 A5 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 A3, A4 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationship-authority.test.ts:170; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: rejects spoofed target authorship in request data and ignores it for direct store callers :: line 170 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/relationship-authority.test.ts:170; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:170 — rejects spoofed target authorship in request data and ignores it for direct store callers. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 180:
expect(response.status).toBe(400) - A2 line 181:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n }) - A3 line 184:
expect(rs.create(forged)).rejects.toMatchObject({\n code: "retraction_author_mismatch",\n }) - A4 line 187:
expect(author).not.toBe(other) - A5 line 188:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 179:
SELF.fetch(request(forged)) - I2 line 179:
request(forged) - I3 line 184:
rs.create(forged)
COR-187 — preserves not-found semantics before authority checks
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-187 — preserves not-found semantics before authority checks |
| 2. Requirement or guarantee | Source test intent: preserves not-found semantics before authority checks. 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: message retraction authority. 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, 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/relationship-authority.test.ts:191; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: preserves not-found semantics before authority checks :: 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 | Security (provisional). |
| 20. Handler, interface or code path | tests/relationship-authority.test.ts:191; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:191 — preserves not-found semantics before authority checks. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 201:
expect(response.status).toBe(404) - A2 line 202:
expect(await response.json()).toMatchObject({\n error: {\n code: "not_found",\n message: "Both endpoint messages must exist.",\n },\n }) - A3 line 208:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 194:
SELF.fetch(\n request({\n ...input,\n author_id: other,\n target_message_id: crypto.randomUUID(),\n }),\n ) - I2 line 195:
request({\n ...input,\n author_id: other,\n target_message_id: crypto.randomUUID(),\n })
COR-188 — keeps withdrawal of a message distinct from withdrawal of its relationship assertion
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-188 — keeps withdrawal of a message distinct from withdrawal of its relationship assertion |
| 2. Requirement or guarantee | Source test intent: keeps withdrawal of a message distinct from withdrawal of its relationship assertion. 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: message retraction authority. 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, 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 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A4 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationship-authority.test.ts:211; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: keeps withdrawal of a message distinct from withdrawal of its relationship assertion :: line 211 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/relationship-authority.test.ts:211; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:211 — keeps withdrawal of a message distinct from withdrawal of its relationship assertion. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 214:
expect(\n rs.retract(relationship.relationship_id, other, crypto.randomUUID()),\n ).rejects.toMatchObject({ status: 403, code: "forbidden" }) - A2 line 222:
expect(retraction.author_id).toBe(author) - A3 line 223:
expect(await rs.get(relationship.relationship_id)).toEqual(relationship) - A4 line 224:
expect(await store.getMessage(target.message_id)).toEqual(target)
Source inputs and operations
- I1 line 213:
rs.create(input) - I2 line 215:
rs.retract(relationship.relationship_id, other, crypto.randomUUID()) - I3 line 217:
rs.retract(\n relationship.relationship_id,\n author,\n crypto.randomUUID(),\n ) - I4 line 224:
store.getMessage(target.message_id)
COR-189 — derives original-author=%s consistently across create, detail, queries and resource exports
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-189 — derives original-author=%s consistently across create, detail, queries and resource exports |
| 2. Requirement or guarantee | Source test intent: derives original-author=%s consistently across create, detail, queries and resource exports. 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: supersession attribution. Do not infer starting state from the title. |
| 7. Input and test data | each: [true, false] Input/operation expressions: I1, I2, I3, I4, I5, I6. 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, A4, A6, A7, A15 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A5, A8, A9, A14, A15 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A10, A14, A15 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A11, A13 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/relationship-authority.test.ts:229; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: derives original-author=%s consistently across create, detail, queries and resource exports :: line 229 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/relationship-authority.test.ts:229; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:229 — derives original-author=%s consistently across create, detail, queries and resource exports. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 239:
expect(response.status).toBe(201) - A2 line 243:
expect(relationship.author_id).toBe(body.author_id) - A3 line 244:
expect(relationship.author_is_target_author).toBe(original) - A4 line 246:
expect(await rs.create(body)).toEqual(relationship) - A5 line 247:
expect(await state()).toEqual(before) - A6 line 253:
expect(await detail.json()).toMatchObject(relationship) - A7 line 262:
expect(await query.json()).toMatchObject({\n relationships: [{ relationship }],\n }) - A8 line 266:
expect(\n await jsonl(\n `/corpus/relationships.jsonl?after=${source.sequence}&at=${relationship.sequence}`,\n ),\n ).toEqual([relationship]) - A9 line 271:
expect(\n await jsonl(\n `/corpus/relationships.jsonl?conversation_id=${target.conversation_id}&at=${relationship.sequence}`,\n ),\n ).toEqual([relationship]) - A10 line 280:
expect(events).toHaveLength(1) - A11 line 282:
expect(event.data).not.toHaveProperty("author_is_target_author") - A12 line 283:
expect(decodeEvent(encodeEvent(event)).event).toEqual(event) - A13 line 288:
expect(JSON.parse(raw!.payload)).not.toHaveProperty(\n "author_is_target_author",\n ) - A14 line 291:
expect(\n await jsonl(`/corpus/changes.jsonl?after=${source.sequence}`),\n ).toEqual(events) - A15 line 297:
expect(await changes.json()).toMatchObject({ changes: events })
Source inputs and operations
- I1 line 238:
SELF.fetch(request(body)) - I2 line 238:
request(body) - I3 line 246:
rs.create(body) - I4 line 249:
SELF.fetch(\n `https://corpus/relationship-assertions/${relationship.relationship_id}`,\n { headers: { Accept: media } },\n ) - I5 line 259:
SELF.fetch(\n `https://corpus/relationship-assertions?${filter}&at=${relationship.sequence}`,\n ) - I6 line 294:
SELF.fetch(\n `https://corpus/corpus/changes?after=${source.sequence}`,\n )
COR-190 — permits independent original-author and third-party assertions without treating supersession as withdrawal
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-190 — permits independent original-author and third-party assertions without treating supersession as withdrawal |
| 2. Requirement or guarantee | Source test intent: permits independent original-author and third-party assertions without treating supersession as withdrawal. 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: supersession attribution. 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, I3, I4, I5, I6. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A6, A7, A8, A9 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 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/relationship-authority.test.ts:301; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: permits independent original-author and third-party assertions without treating supersession as withdrawal :: line 301 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/relationship-authority.test.ts:301; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:301 — permits independent original-author and third-party assertions without treating supersession as withdrawal. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 312:
expect(original.author_is_target_author).toBe(true) - A2 line 313:
expect(thirdParty.author_is_target_author).toBe(false) - A3 line 320:
expect(await rs.retract(thirdParty.relationship_id, other, token)).toEqual(\n retraction,\n ) - A4 line 323:
expect(\n rs.retract(thirdParty.relationship_id, author, crypto.randomUUID()),\n ).rejects.toMatchObject({ code: "forbidden" }) - A5 line 326:
expect(await rs.get(thirdParty.relationship_id)).toEqual(thirdParty) - A6 line 333:
expect(\n (await rs.list({ ...query, at: thirdParty.sequence })).relationships,\n ).toHaveLength(2) - A7 line 336:
expect(\n (await rs.list({ ...query, at: retraction.sequence })).relationships.map(\n (row) => row.relationship,\n ),\n ).toEqual([original]) - A8 line 344:
expect(history[1]).toEqual({\n relationship: thirdParty,\n state: "retracted",\n retraction_id: retraction.retraction_id,\n }) - A9 line 349:
expect(await store.getMessage(target.message_id)).toEqual(target)
Source inputs and operations
- I1 line 303:
rs.create({\n ...input,\n relationship_type: "supersedes",\n }) - I2 line 307:
rs.create({\n ...input,\n author_id: other,\n relationship_type: "supersedes",\n }) - I3 line 315:
rs.retract(\n thirdParty.relationship_id,\n other,\n token,\n ) - I4 line 320:
rs.retract(thirdParty.relationship_id, other, token) - I5 line 324:
rs.retract(thirdParty.relationship_id, author, crypto.randomUUID()) - I6 line 349:
store.getMessage(target.message_id)
COR-191 — does not accept or trust a spoofed derived indicator
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-191 — does not accept or trust a spoofed derived indicator |
| 2. Requirement or guarantee | Source test intent: does not accept or trust a spoofed derived indicator. 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: supersession attribution. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/relationship-authority.test.ts:352; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: does not accept or trust a spoofed derived indicator :: line 352 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/relationship-authority.test.ts:352; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:352 — does not accept or trust a spoofed derived indicator. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 362:
expect(response.status).toBe(400) - A2 line 363:
expect(await state()).toEqual(before) - A3 line 364:
expect((await rs.create(forged)).author_is_target_author).toBe(false)
Source inputs and operations
- I1 line 361:
SELF.fetch(request(forged)) - I2 line 361:
request(forged) - I3 line 364:
rs.create(forged)
COR-192 — derives attribution for pre-existing assertions without rewriting their history
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-192 — derives attribution for pre-existing assertions without rewriting their history |
| 2. Requirement or guarantee | Source test intent: derives attribution for pre-existing assertions without rewriting their history. 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: supersession attribution. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2, A3, A4 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/relationship-authority.test.ts:367; assertion/input source links below. Source key: tests/relationship-authority.test.ts :: derives attribution for pre-existing assertions without rewriting their history :: line 367 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/relationship-authority.test.ts:367; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationship-authority.test.ts:367 — derives attribution for pre-existing assertions without rewriting their history. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 394:
expect((await rs.get(id))?.author_is_target_author).toBe(false) - A2 line 395:
expect(\n (await jsonl(`/corpus/relationships.jsonl?after=${source.sequence}`))[0]\n .author_is_target_author,\n ).toBe(false) - A3 line 399:
expect(\n await env.db\n .prepare("SELECT payload FROM changes WHERE resource_id=?")\n .bind(id)\n .first(),\n ).toEqual(before) - A4 line 405:
expect(\n canonicalJson(\n (await getChanges(env.db, { after: source.sequence, limit: 100 }))\n .changes[0],\n ),\n ).toBe(canonicalJson(event))
Source inputs and operations
- I1 line 389:
replayEvent(env.db, event)
tests/relationship-body-contract.test.ts
COR-193 — keeps the separate enriched internal UTF-8 request ceiling at %s bytes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-193 — keeps the separate enriched internal UTF-8 request ceiling at %s bytes |
| 2. Requirement or guarantee | Source test intent: keeps the separate enriched internal UTF-8 request ceiling at %s bytes. 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: [4095, 4096, 4097] 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 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, A5 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/relationship-body-contract.test.ts:7; assertion/input source links below. Source key: tests/relationship-body-contract.test.ts :: keeps the separate enriched internal UTF-8 request ceiling at %s bytes :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/relationship-body-contract.test.ts:7; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/relationships. |
| 21. Test implementation location and command | tests/relationship-body-contract.test.ts:7 — keeps the separate enriched internal UTF-8 request ceiling at %s bytes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 50:
expect(new TextEncoder().encode(body).length).toBe(size) - A2 line 51:
expect(body.length).toBeLessThan(size) - A3 line 69:
expect(response.status).toBe(size > 4096 ? 413 : 201) - A4 line 71:
expect(await response.json()).toMatchObject({\n error: {\n code: "request_too_large",\n message: "Relationship requests are limited to 4096 bytes.",\n how_to_proceed: "Correct the request and retry.",\n },\n }) - A5 line 78:
expect(\n await env.db.prepare("SELECT COUNT(*) AS n FROM changes").first(),\n ).toEqual(before)
Source inputs and operations
- I1 line 11:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n subject: "Internal bytes",\n content: "root",\n author_id: author,\n created_at: new Date().toISOString(),\n }) - I2 line 19:
store.appendMessage({\n conversation_id: root.conversation.conversation_id,\n message_id: crypto.randomUUID(),\n content: "reply",\n author_id: author,\n created_at: new Date().toISOString(),\n }) - I3 line 28:
new RelationshipStore(env.db).create({\n source_message_id: reply.message_id,\n target_message_id: root.message.message_id,\n relationship_type: "contradicts",\n author_id: author,\n idempotency_key: crypto.randomUUID(),\n }) - I4 line 56:
new Request(\n `https://local/internal/relationships${assertion ? `/${assertion.relationship_id}/retract` : ""}`,\n {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n "X-ToastMachine-Internal-Secret": env.INTERNAL_SHARED_SECRET,\n },\n body,\n },\n )
tests/relationships.test.ts
COR-194 — records all types with direction and third-party attribution across conversations
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-194 — records all types with direction and third-party attribution across conversations |
| 2. Requirement or guarantee | Source test intent: records all types with direction and third-party attribution across conversations. 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: first class relationships. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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/relationships.test.ts:32; assertion/input source links below. Source key: tests/relationships.test.ts :: records all types with direction and third-party attribution across conversations :: line 32 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:32; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:32 — records all types with direction and third-party attribution across conversations. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 44:
expect(r.source_message_id).toBe(a.message_id) - A2 line 45:
expect(r.author_id).toBe(\n relationship_type === "retracts" ? author : third,\n ) - A3 line 48:
expect(\n (\n await rs.list({\n message_id: b.message_id,\n direction: "incoming",\n relationship_type,\n after: 0,\n at: r.sequence,\n limit: 100,\n })\n ).relationships,\n ).toHaveLength(1)
Source inputs and operations
- I1 line 37:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type,\n author_id: relationship_type === "retracts" ? author : third,\n idempotency_key: crypto.randomUUID(),\n })
COR-195 — retries, rejects active duplicates, retracts permanently, reasserts and preserves history
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-195 — retries, rejects active duplicates, retracts permanently, reasserts and preserves history |
| 2. Requirement or guarantee | Source test intent: retries, rejects active duplicates, retracts permanently, reasserts and preserves history. 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: first class relationships. 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, I3, I4, I5, I6, I7, I8, I9, I10. 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 A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A8, A9 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 A2, A3, A4, A9, A10 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:62; assertion/input source links below. Source key: tests/relationships.test.ts :: retries, rejects active duplicates, retracts permanently, reasserts and preserves history :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/relationships.test.ts:62; expressions I1, I2, I3, I4, I5, I6, I7, I8, I9, I10. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:62 — retries, rejects active duplicates, retracts permanently, reasserts and preserves history. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 72:
expect(await rs.create(input)).toEqual(r) - A2 line 73:
expect(\n rs.create({ ...input, relationship_type: "extends" }),\n ).rejects.toMatchObject({ code: "idempotency_conflict" }) - A3 line 76:
expect(\n rs.create({ ...input, idempotency_key: crypto.randomUUID() }),\n ).rejects.toMatchObject({ code: "relationship_already_asserted" }) - A4 line 79:
expect(\n rs.retract(r.relationship_id, author, crypto.randomUUID()),\n ).rejects.toMatchObject({ status: 403 }) - A5 line 84:
expect(await rs.retract(r.relationship_id, third, token)).toEqual(t) - A6 line 85:
expect(\n await rs.retract(r.relationship_id, third, crypto.randomUUID()),\n ).toEqual(t) - A7 line 88:
expect(await rs.create(input)).toEqual(r) - A8 line 89:
expect(\n (\n await rs.list({\n message_id: a.message_id,\n at: r.sequence,\n after: 0,\n limit: 100,\n })\n ).relationships,\n ).toHaveLength(1) - A9 line 99:
expect(\n (\n await rs.list({\n message_id: a.message_id,\n at: t.sequence,\n after: 0,\n limit: 100,\n })\n ).relationships,\n ).toHaveLength(0) - A10 line 113:
expect(again.relationship_id).not.toBe(r.relationship_id)
Source inputs and operations
- I1 line 71:
rs.create(input) - I2 line 72:
rs.create(input) - I3 line 74:
rs.create({ ...input, relationship_type: "extends" }) - I4 line 77:
rs.create({ ...input, idempotency_key: crypto.randomUUID() }) - I5 line 80:
rs.retract(r.relationship_id, author, crypto.randomUUID()) - I6 line 83:
rs.retract(r.relationship_id, third, token) - I7 line 84:
rs.retract(r.relationship_id, third, token) - I8 line 86:
rs.retract(r.relationship_id, third, crypto.randomUUID()) - I9 line 88:
rs.create(input) - I10 line 109:
rs.create({\n ...input,\n idempotency_key: crypto.randomUUID(),\n })
COR-196 — rejects invalid edges without appending events
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-196 — rejects invalid edges without appending events |
| 2. Requirement or guarantee | Source test intent: rejects invalid edges without appending events. 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: first class relationships. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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 A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationships.test.ts:115; assertion/input source links below. Source key: tests/relationships.test.ts :: rejects invalid edges without appending events :: 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/relationships.test.ts:115; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:115 — rejects invalid edges without appending events. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 122:
expect(\n rs.create({\n source_message_id: a.message_id,\n target_message_id: target,\n relationship_type: type,\n author_id: third,\n idempotency_key: crypto.randomUUID(),\n }),\n ).rejects.toThrow() - A2 line 132:
expect(page.changes).toEqual([])
Source inputs and operations
- I1 line 123:
rs.create({\n source_message_id: a.message_id,\n target_message_id: target,\n relationship_type: type,\n author_id: third,\n idempotency_key: crypto.randomUUID(),\n })
COR-197 — serializes typed binary events and validates corruption
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-197 — serializes typed binary events and validates corruption |
| 2. Requirement or guarantee | Source test intent: serializes typed binary events and validates corruption. 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: first class relationships. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationships.test.ts:134; assertion/input source links below. Source key: tests/relationships.test.ts :: serializes typed binary events and validates corruption :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/relationships.test.ts:134; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:134 — serializes typed binary events and validates corruption. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(isCorpusEvent(e)).toBe(true) - A2 line 147:
expect(decodeEvent(bytes).event).toEqual(e) - A3 line 149:
expect(() => decodeEvent(bytes)).toThrow()
Source inputs and operations
- I1 line 136:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type: "replies-to",\n author_id: third,\n idempotency_key: crypto.randomUUID(),\n })
COR-198 — creates no implicit parent, permits cycles and multiple reply parents
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-198 — creates no implicit parent, permits cycles and multiple reply parents |
| 2. Requirement or guarantee | Source test intent: creates no implicit parent, permits cycles and multiple reply parents. 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: first class relationships. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationships.test.ts:152; assertion/input source links below. Source key: tests/relationships.test.ts :: creates no implicit parent, permits cycles and multiple reply parents :: line 152 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:152; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:152 — creates no implicit parent, permits cycles and multiple reply parents. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 161:
expect(\n (\n await rs.list({\n message_id: message.message_id,\n after: 0,\n at: message.sequence,\n limit: 100,\n })\n ).relationships,\n ).toHaveLength(0)
Source inputs and operations
- I1 line 154:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: a.conversation_id,\n author_id: author,\n created_at: new Date().toISOString(),\n content: "independent",\n }) - I2 line 177:
rs.create({\n source_message_id: source.message_id,\n target_message_id: target.message_id,\n relationship_type: "replies-to",\n author_id: third,\n idempotency_key: crypto.randomUUID(),\n })
COR-199 — supports negotiated immutable reads and historical pagination
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-199 — supports negotiated immutable reads and historical pagination |
| 2. Requirement or guarantee | Source test intent: supports negotiated immutable reads and historical pagination. 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: first class relationships. 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, I3. 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, A3 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A2, A4 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/relationships.test.ts:185; assertion/input source links below. Source key: tests/relationships.test.ts :: supports negotiated immutable reads and historical pagination :: line 185 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:185; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:185 — supports negotiated immutable reads and historical pagination. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(200) - A2 line 204:
expect(response.headers.get("Content-Type")).toContain(accept) - A3 line 209:
expect(page.status).toBe(200) - A4 line 210:
expect(\n (await page.json<{ relationships: unknown[] }>()).relationships,\n ).toHaveLength(1)
Source inputs and operations
- I1 line 187:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type: "supports",\n author_id: third,\n idempotency_key: crypto.randomUUID(),\n }) - I2 line 199:
SELF.fetch(\n `https://corpus/relationship-assertions/${r.relationship_id}`,\n { headers: { Accept: accept } },\n ) - I3 line 206:
SELF.fetch(\n `https://corpus/relationship-assertions?message_id=${a.message_id}&at=${r.sequence}&limit=1`,\n )
COR-200 — serializes concurrent logical retries and active duplicate races
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-200 — serializes concurrent logical retries and active duplicate races |
| 2. Requirement or guarantee | Source test intent: serializes concurrent logical retries and active duplicate races. 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: 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, 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 A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A5 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/relationships.test.ts:216; assertion/input source links below. Source key: tests/relationships.test.ts :: serializes concurrent logical retries and active duplicate races :: line 216 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/relationships.test.ts:216; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:216 — serializes concurrent logical retries and active duplicate races. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 228:
expect(new Set(results.map((r) => r.relationship_id)).size).toBe(1) - A2 line 234:
expect(new Set(retractions.map((r) => r.retraction_id)).size).toBe(1) - A3 line 244:
expect(new Set(repeated.map((r) => r.retraction_id)).size).toBe(1) - A4 line 250:
expect(creates.filter((r) => r.status === "fulfilled")).toHaveLength(1) - A5 line 253:
expect(result.reason.code).toBe("relationship_already_asserted")
Source inputs and operations
- I1 line 226:
rs.create(input) - I2 line 231:
rs.retract(results[0].relationship_id, input.author_id, "race-retract") - I3 line 237:
rs.retract(\n results[0].relationship_id,\n input.author_id,\n "race-existing-retract",\n ) - I4 line 247:
rs.create({ ...input, idempotency_key: crypto.randomUUID() })
COR-201 — retains fixed-boundary pages across concurrent assertions and withdrawals
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-201 — retains fixed-boundary pages across concurrent assertions and withdrawals |
| 2. Requirement or guarantee | Source test intent: retains fixed-boundary pages across concurrent assertions and withdrawals. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions 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/relationships.test.ts:255; assertion/input source links below. Source key: tests/relationships.test.ts :: retains fixed-boundary pages across concurrent assertions and withdrawals :: line 255 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:255; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:255 — retains fixed-boundary pages across concurrent assertions and withdrawals. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 290:
expect(\n [first.relationships[0], ...remainder.relationships].map(\n (r) => r.relationship.relationship_id,\n ),\n ).toEqual(edges.map((r) => r.relationship_id)) - A2 line 305:
expect(\n filtered.relationships.map((r) => r.relationship.relationship_id),\n ).toEqual([edges[0].relationship_id]) - A3 line 314:
expect(\n plan.results.some((r) => r.detail.includes("idx_relationship_target_type")),\n ).toBe(true)
Source inputs and operations
- I1 line 261:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type,\n author_id: asserting,\n idempotency_key: crypto.randomUUID(),\n }) - I2 line 276:
rs.retract(edges[1].relationship_id, asserting, crypto.randomUUID()) - I3 line 277:
rs.create({\n source_message_id: b.message_id,\n target_message_id: a.message_id,\n relationship_type: "supersedes",\n author_id: asserting,\n idempotency_key: crypto.randomUUID(),\n })
COR-202 — rolls back event, active key, quota and retry state when projection insertion fails
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-202 — rolls back event, active key, quota and retry state when projection insertion fails |
| 2. Requirement or guarantee | Source test intent: rolls back event, active key, quota and retry state when projection insertion fails. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Resilience — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, A3, A4 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 A1, A2, A3, A4 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationships.test.ts:318; assertion/input source links below. Source key: tests/relationships.test.ts :: rolls back event, active key, quota and retry state when projection insertion fails :: line 318 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/relationships.test.ts:318; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:318 — rolls back event, active key, quota and retry state when projection insertion fails. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 328:
expect(\n rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type: "supports",\n author_id: asserting,\n idempotency_key: token,\n }),\n ).rejects.toThrow("injected projection failure") - A2 line 340:
expect(\n (await getChanges(env.db, { after: b.sequence, limit: 100 })).changes,\n ).toEqual([]) - A3 line 343:
expect(\n await env.db\n .prepare("SELECT * FROM relationship_idempotency WHERE author_id=?")\n .bind(asserting)\n .first(),\n ).toBeNull() - A4 line 349:
expect(\n await env.db\n .prepare("SELECT * FROM relationship_rate_windows WHERE author_id=?")\n .bind(asserting)\n .first(),\n ).toBeNull()
Source inputs and operations
- I1 line 329:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type: "supports",\n author_id: asserting,\n idempotency_key: token,\n })
COR-203 — limits new assertion growth while preserving retries and a separate retraction allowance
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-203 — limits new assertion growth while preserving retries and a separate retraction allowance |
| 2. Requirement or guarantee | Source test intent: limits new assertion growth while preserving retries and a separate retraction allowance. 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: 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, 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 A2 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | 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:356; assertion/input source links below. Source key: tests/relationships.test.ts :: limits new assertion growth while preserving retries and a separate retraction allowance :: line 356 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/relationships.test.ts:356; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:356 — limits new assertion growth while preserving retries and a separate retraction allowance. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 373:
expect(await rs.create(input)).toEqual(edge) - A2 line 374:
expect(\n rs.create({\n ...input,\n relationship_type: "extends",\n idempotency_key: crypto.randomUUID(),\n }),\n ).rejects.toMatchObject({ status: 429 }) - A3 line 381:
expect(\n (await rs.retract(edge.relationship_id, asserting, crypto.randomUUID()))\n .relationship_id,\n ).toBe(edge.relationship_id)
Source inputs and operations
- I1 line 366:
rs.create(input) - I2 line 373:
rs.create(input) - I3 line 375:
rs.create({\n ...input,\n relationship_type: "extends",\n idempotency_key: crypto.randomUUID(),\n }) - I4 line 382:
rs.retract(edge.relationship_id, asserting, crypto.randomUUID())
COR-204 — rejects malformed public filters and returns bodyless negotiated HEAD errors
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-204 — rejects malformed public filters and returns bodyless negotiated HEAD errors |
| 2. Requirement or guarantee | Source test intent: rejects malformed public filters and returns bodyless negotiated HEAD 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 | 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1, I2, I3. 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, A4 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A3 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A4 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1, 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:386; assertion/input source links below. Source key: tests/relationships.test.ts :: rejects malformed public filters and returns bodyless negotiated HEAD errors :: line 386 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:386; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:386 — rejects malformed public filters and returns bodyless negotiated HEAD errors. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n (\n await SELF.fetch(\n `https://corpus/relationship-assertions?message_id=${a.message_id}&${query}`,\n )\n ).status,\n ).toBe(400) - A2 line 408:
expect(head.status).toBe(406) - A3 line 409:
expect(await head.text()).toBe("") - A4 line 410:
expect(\n (\n await SELF.fetch(\n `https://corpus/relationship-assertions/${a.message_id}/extra`,\n )\n ).status,\n ).toBe(400)
Source inputs and operations
- I1 line 399:
SELF.fetch(\n `https://corpus/relationship-assertions?message_id=${a.message_id}&${query}`,\n ) - I2 line 404:
SELF.fetch(\n `https://corpus/relationship-assertions?message_id=${a.message_id}`,\n { method: "HEAD", headers: { Accept: "image/png" } },\n ) - I3 line 412:
SELF.fetch(\n `https://corpus/relationship-assertions/${a.message_id}/extra`,\n )
COR-205 — enforces internal write authentication and bounded JSON input
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-205 — enforces internal write authentication and bounded JSON input |
| 2. Requirement or guarantee | Source test intent: enforces internal write authentication and bounded JSON input. 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, I2, I3. 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, 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 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1, 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/relationships.test.ts:418; assertion/input source links below. Source key: tests/relationships.test.ts :: enforces internal write authentication and bounded JSON input :: line 418 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:418; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:418 — enforces internal write authentication and bounded JSON input. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 424:
expect((await SELF.fetch(url, { method: "POST", body: "{}" })).status).toBe(\n 401,\n ) - A2 line 432:
expect(\n (await SELF.fetch(url, { method: "POST", headers, body })).status,\n ).toBe(status) - A3 line 435:
expect(\n (\n await SELF.fetch(url, {\n method: "POST",\n headers: { ...headers, "Content-Type": "text/plain" },\n body: "{}",\n })\n ).status,\n ).toBe(415)
Source inputs and operations
- I1 line 424:
SELF.fetch(url, { method: "POST", body: "{}" }) - I2 line 433:
SELF.fetch(url, { method: "POST", headers, body }) - I3 line 437:
SELF.fetch(url, {\n method: "POST",\n headers: { ...headers, "Content-Type": "text/plain" },\n body: "{}",\n })
COR-206 — never permits historical event or assertion mutation
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-206 — never permits historical event or assertion mutation |
| 2. Requirement or guarantee | Source test intent: never permits historical event or assertion mutation. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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 A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/relationships.test.ts:445; assertion/input source links below. Source key: tests/relationships.test.ts :: never permits historical event or assertion mutation :: line 445 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:445; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/d1/changes, ../src/archive-format, ../src/protocol. |
| 21. Test implementation location and command | tests/relationships.test.ts:445 — never permits historical event or assertion mutation. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 454:
expect(\n env.db\n .prepare("UPDATE changes SET payload='{}' WHERE sequence=?")\n .bind(edge.sequence)\n .run(),\n ).rejects.toThrow("immutable") - A2 line 460:
expect(\n env.db\n .prepare("DELETE FROM relationships WHERE relationship_id=?")\n .bind(edge.relationship_id)\n .run(),\n ).rejects.toThrow("immutable")
Source inputs and operations
- I1 line 447:
rs.create({\n source_message_id: a.message_id,\n target_message_id: b.message_id,\n relationship_type: "supports",\n author_id: crypto.randomUUID(),\n idempotency_key: crypto.randomUUID(),\n })
tests/representation-metadata.test.ts
COR-207 — includes tags and mentions in collection Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-207 — includes tags and mentions in collection Markdown |
| 2. Requirement or guarantee | Source test intent: includes tags and mentions in collection Markdown. 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 metadata representations. 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, A5 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 | 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/representation-metadata.test.ts:28; assertion/input source links below. Source key: tests/representation-metadata.test.ts :: includes tags and mentions in collection Markdown :: line 28 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/representation-metadata.test.ts:28; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representation-metadata.test.ts:28 — includes tags and mentions in collection Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 38:
expect(response.status).toBe(200) - A2 line 39:
expect(body).toContain(`### ${messageId}`) - A3 line 40:
expect(body).toContain("Tags: audit-tag") - A4 line 41:
expect(body).toContain(`Mentions: ${mentionAuthorId}`) - A5 line 42:
expect(body).not.toContain("References:")
Source inputs and operations
- I1 line 32:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversationId}`,\n { headers: { Accept: "text/markdown" } },\n )
COR-208 — includes tags and mentions in search Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-208 — includes tags and mentions in search Markdown |
| 2. Requirement or guarantee | Source test intent: includes tags and mentions in search Markdown. 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 metadata representations. 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, A5 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 | 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/representation-metadata.test.ts:45; assertion/input source links below. Source key: tests/representation-metadata.test.ts :: includes tags and mentions in search Markdown :: 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/representation-metadata.test.ts:45; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representation-metadata.test.ts:45 — includes tags and mentions in search Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 54:
expect(response.status).toBe(200) - A2 line 55:
expect(body).toContain(`### ${messageId}`) - A3 line 56:
expect(body).toContain("Tags: audit-tag") - A4 line 57:
expect(body).toContain(`Mentions: ${mentionAuthorId}`) - A5 line 58:
expect(body).not.toContain("References")
Source inputs and operations
- I1 line 48:
SELF.fetch(\n "https://example.com/search?q=representationmetadataunique",\n { headers: { Accept: "text/markdown" } },\n )
COR-209 — includes tags and mentions on search JSON-LD message items
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-209 — includes tags and mentions on search JSON-LD message items |
| 2. Requirement or guarantee | Source test intent: includes tags and mentions on search JSON-LD message items. 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 metadata representations. 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 | 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/representation-metadata.test.ts:61; assertion/input source links below. Source key: tests/representation-metadata.test.ts :: includes tags and mentions on search JSON-LD message items :: line 61 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/representation-metadata.test.ts:61; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representation-metadata.test.ts:61 — includes tags and mentions on search JSON-LD message items. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 83:
expect(response.status).toBe(200) - A2 line 84:
expect(item?.tags).toEqual(["audit-tag"]) - A3 line 85:
expect(item?.mentions).toEqual([{ author_id: mentionAuthorId }]) - A4 line 86:
expect(item).not.toHaveProperty("references")
Source inputs and operations
- I1 line 64:
SELF.fetch(\n new Request("https://example.com/search?q=representationmetadataunique", {\n headers: { Accept: "application/ld+json" },\n }),\n ) - I2 line 65:
new Request("https://example.com/search?q=representationmetadataunique", {\n headers: { Accept: "application/ld+json" },\n })
COR-210 — omits legacy references from conversation JSON-LD and Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-210 — omits legacy references from conversation JSON-LD and Markdown |
| 2. Requirement or guarantee | Source test intent: omits legacy references from conversation JSON-LD and Markdown. 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 metadata representations. 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, I3, I4, I5. 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, 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 | 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 | See assertions A2, 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/representation-metadata.test.ts:89; assertion/input source links below. Source key: tests/representation-metadata.test.ts :: omits legacy references from conversation JSON-LD and Markdown :: line 89 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/representation-metadata.test.ts:89; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representation-metadata.test.ts:89 — omits legacy references from conversation JSON-LD and Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 108:
expect(jsonLdResponse.status).toBe(200) - A2 line 109:
expect(jsonLd).not.toHaveProperty("references") - A3 line 117:
expect(markdownResponse.status).toBe(200) - A4 line 118:
expect(markdown).not.toContain("References:")
Source inputs and operations
- I1 line 92:
store.createConversation({\n conversation_id: conversationId,\n subject: "conversation representation legacy field test",\n message_id: crypto.randomUUID(),\n content: "conversationrepresentationfield !conversation-tag",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n references: [{ type: "tag", value: "conversation-tag" }],\n }) - I2 line 102:
SELF.fetch(\n new Request(`https://example.com/conversations/${conversationId}`, {\n headers: { Accept: "application/ld+json" },\n }),\n ) - I3 line 103:
new Request(`https://example.com/conversations/${conversationId}`, {\n headers: { Accept: "application/ld+json" },\n }) - I4 line 111:
SELF.fetch(\n new Request(`https://example.com/conversations/${conversationId}`, {\n headers: { Accept: "text/markdown" },\n }),\n ) - I5 line 112:
new Request(`https://example.com/conversations/${conversationId}`, {\n headers: { Accept: "text/markdown" },\n })
tests/representations.test.ts
COR-211 — reads the message list
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-211 — reads the message list |
| 2. Requirement or guarantee | Source test intent: reads the message list. 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: Message representations. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/representations.test.ts:39; assertion/input source links below. Source key: tests/representations.test.ts :: reads the message list :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/representations.test.ts:39; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:39 — reads the message list. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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
Source inputs and operations
- I1 line 42:
SELF.fetch(\n `https://example.com/messages?conversation_id=${encodeURIComponent(\n conversation.conversation.conversation_id,\n )}`,\n )
COR-212 — reads an individual message
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-212 — reads an individual message |
| 2. Requirement or guarantee | Source test intent: reads an individual message. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Message representations. 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 A2, 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/representations.test.ts:65; assertion/input source links below. Source key: tests/representations.test.ts :: reads an individual message :: line 65 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/representations.test.ts:65; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:65 — reads an individual message. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 72:
expect(response.status).toBe(200) - A2 line 79:
expect(body.message_id).toBe(reply.message_id) - A3 line 81:
expect(body.conversation_id).toBe(\n conversation.conversation.conversation_id,\n )
Source inputs and operations
- I1 line 68:
SELF.fetch(\n `https://example.com/messages/${reply.message_id}`,\n )
COR-213 — reads search results
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-213 — reads search results |
| 2. Requirement or guarantee | Source test intent: reads search results. 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: Message representations. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | 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/representations.test.ts:86; assertion/input source links below. Source key: tests/representations.test.ts :: reads search results :: line 86 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/representations.test.ts:86; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:86 — reads search results. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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
Source inputs and operations
- I1 line 89:
SELF.fetch(\n `https://example.com/search?q=${encodeURIComponent(\n "reply relationship",\n )}&conversation_id=${encodeURIComponent(conversation.conversation.conversation_id)}`,\n )
COR-214 — reads the corpus messages JSONL export
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-214 — reads the corpus messages JSONL export |
| 2. Requirement or guarantee | Source test intent: reads the corpus messages JSONL export. 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: Message representations. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5 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 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/representations.test.ts:115; assertion/input source links below. Source key: tests/representations.test.ts :: reads the corpus messages JSONL export :: 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/representations.test.ts:115; expressions I1, I2, I3. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:115 — reads the corpus messages JSONL export. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 156:
expect(response.status).toBe(200) - A2 line 186:
expect(message).toBeDefined() - A3 line 188:
expect(message?.conversation_id).toBe(\n conversation.conversation.conversation_id,\n ) - A4 line 192:
expect(message?.tags).toEqual(["agents", "memory"]) - A5 line 194:
expect(message?.mentions).toEqual([])
Source inputs and operations
- I1 line 122:
store.createConversation({\n conversation_id: conversationId,\n subject: `Representation test ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "Opening message for representation testing",\n author_id: authorId,\n created_at: new Date().toISOString(),\n kind: ["post"],\n }) - I2 line 132:
store.appendMessage({\n message_id: messageId,\n conversation_id: conversation.conversation.conversation_id,\n content: "A reply with !agents and !memory",\n author_id: authorId,\n created_at: new Date().toISOString(),\n\n kind: ["post"],\n references: [\n {\n type: "tag",\n value: "agents",\n },\n {\n type: "tag",\n value: "memory",\n },\n ],\n }) - I3 line 152:
SELF.fetch(\n "https://example.com/corpus/messages.jsonl",\n )
COR-215 — preserves canonical kinds in list, search, JSON-LD, and Markdown
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-215 — preserves canonical kinds in list, search, JSON-LD, and Markdown |
| 2. Requirement or guarantee | Source test intent: preserves canonical kinds in list, search, JSON-LD, and Markdown. 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: Message representations. 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, I3, I4, I5, I6, I7, I8. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A2, A3, A4, A5, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2, 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/representations.test.ts:197; assertion/input source links below. Source key: tests/representations.test.ts :: preserves canonical kinds in list, search, JSON-LD, and Markdown :: line 197 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/representations.test.ts:197; expressions I1, I2, I3, I4, I5, I6, I7, I8. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:197 — preserves canonical kinds in list, search, JSON-LD, and Markdown. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 224:
expect(\n listBody.messages.find((item) => item.message_id === message.message_id)\n ?.kind,\n ).toEqual(expected) - A2 line 237:
expect(\n results.find((item) => item.message_id === message.message_id)?.kind,\n ).toEqual(expected) - A3 line 248:
expect(\n searchJsonLdBody.itemListElement.find(\n (entry) => entry.item.identifier === message.message_id,\n )?.item.kind,\n ).toEqual(expected) - A4 line 258:
expect(await searchMarkdown.text()).toContain(\n `Kind: ${KIND_NAMES.join(", ")}`,\n ) - A5 line 266:
expect((await jsonLd.json<{ kind: string[] }>()).kind).toEqual(expected) - A6 line 272:
expect(await markdown.text()).toContain(`Kind: ${KIND_NAMES.join(", ")}`)
Source inputs and operations
- I1 line 199:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `Kinds ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "opening",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 207:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "canonical kind representation marker",\n author_id: conversation.message.author_id,\n created_at: new Date().toISOString(),\n\n kind: [...KIND_NAMES].reverse(),\n }) - I3 line 218:
SELF.fetch(\n `https://example.com/messages?conversation_id=${conversation.conversation.conversation_id}`,\n ) - I4 line 229:
SELF.fetch(\n "https://example.com/search?q=canonical%20kind%20representation%20marker",\n ) - I5 line 241:
SELF.fetch(\n "https://example.com/search?q=canonical%20kind%20representation%20marker",\n { headers: { Accept: "application/ld+json" } },\n ) - I6 line 254:
SELF.fetch(\n "https://example.com/search?q=canonical%20kind%20representation%20marker",\n { headers: { Accept: "text/markdown" } },\n ) - I7 line 262:
SELF.fetch(\n `https://example.com/messages/${message.message_id}`,\n { headers: { Accept: "application/ld+json" } },\n ) - I8 line 268:
SELF.fetch(\n `https://example.com/messages/${message.message_id}`,\n { headers: { Accept: "text/markdown" } },\n )
COR-216 — keeps Markdown message resources free of embedded reply assertions
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-216 — keeps Markdown message resources free of embedded reply assertions |
| 2. Requirement or guarantee | Source test intent: keeps Markdown message resources free of embedded reply assertions. 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: Message representations. 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 | 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 | 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/representations.test.ts:275; assertion/input source links below. Source key: tests/representations.test.ts :: keeps Markdown message resources free of embedded reply assertions :: line 275 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/representations.test.ts:275; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:275 — keeps Markdown message resources free of embedded reply assertions. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 281:
expect(response.status).toBe(200) - A2 line 282:
expect(await response.text()).not.toContain("Reply to:")
Source inputs and operations
- I1 line 277:
SELF.fetch(\n `https://example.com/messages/${reply.message_id}`,\n { headers: { Accept: "text/markdown" } },\n )
COR-217 — emits typed message events
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-217 — emits typed message events |
| 2. Requirement or guarantee | Source test intent: emits typed message events. 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: Message representations. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | See assertions A1 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, 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/representations.test.ts:285; assertion/input source links below. Source key: tests/representations.test.ts :: emits typed message events :: line 285 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/representations.test.ts:285; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/representations.test.ts:285 — emits typed message events. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 292:
expect(response.status).toBe(200) - A2 line 308:
expect(message).toBeDefined() - A3 line 310:
expect(message.event_type).toBe("message.created")
Source inputs and operations
- I1 line 288:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${reply.sequence - 1}`,\n )
tests/self-verification.test.ts
COR-218 — rejects self-verification using assertion identity even when another agent owns the source
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-218 — rejects self-verification using assertion identity even when another agent owns the source |
| 2. Requirement or guarantee | Source test intent: rejects self-verification using assertion identity even when another agent owns the source. 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: verification supports assertions. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/self-verification.test.ts:100; assertion/input source links below. Source key: tests/self-verification.test.ts :: rejects self-verification using assertion identity even when another agent owns the source :: line 100 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/self-verification.test.ts:100; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:100 — rejects self-verification using assertion identity even when another agent owns the source. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(rs.create(input)).rejects.toMatchObject({\n code: "self_verification",\n status: 422,\n }) - A2 line 108:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 104:
rs.create(input)
COR-219 — returns the documented error through the internal write route without persisting state
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-219 — returns the documented error through the internal write route without persisting state |
| 2. Requirement or guarantee | Source test intent: returns the documented error through the internal write route without persisting state. 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: verification supports assertions. 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, 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 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, 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/self-verification.test.ts:112; assertion/input source links below. Source key: tests/self-verification.test.ts :: returns the documented error through the internal write route without persisting state :: line 112 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/self-verification.test.ts:112; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:112 — returns the documented error through the internal write route without persisting state. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 129:
expect(response.status).toBe(422) - A2 line 130:
expect(await response.json()).toEqual({\n error: {\n code: "self_verification",\n message: "An agent cannot verify its own claim.",\n how_to_proceed: "Correct the request and retry.",\n },\n }) - A3 line 137:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 114:
store.getMessage(target) - I2 line 115:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: claim.conversation_id,\n content: "My own assessment",\n author_id: author,\n created_at: new Date().toISOString(),\n kind: ["verification"],\n }) - I3 line 126:
SELF.fetch(\n request("/internal/relationships", input),\n ) - I4 line 127:
request("/internal/relationships", input)
COR-220 — uses authenticated assertion identity rather than source ownership for third-party assertions
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-220 — uses authenticated assertion identity rather than source ownership for third-party assertions |
| 2. Requirement or guarantee | Source test intent: uses authenticated assertion identity rather than source ownership for third-party assertions. 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: verification supports assertions. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/self-verification.test.ts:141; assertion/input source links below. Source key: tests/self-verification.test.ts :: uses authenticated assertion identity rather than source ownership for third-party assertions :: line 141 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/self-verification.test.ts:141; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:141 — uses authenticated assertion identity rather than source ownership for third-party assertions. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 157:
expect(relationship.author_id).toBe(other)
Source inputs and operations
- I1 line 143:
store.getMessage(target) - I2 line 144:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: claim.conversation_id,\n content: "Assessment",\n author_id: author,\n created_at: new Date().toISOString(),\n kind: ["verification"],\n }) - I3 line 152:
rs.create({\n ...input,\n source_message_id: source.message_id,\n author_id: other,\n })
COR-221 — accepts another author’s claim, replays successful retries and retains payload conflicts
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-221 — accepts another author’s claim, replays successful retries and retains payload conflicts |
| 2. Requirement or guarantee | Source test intent: accepts another author’s claim, replays successful retries and retains payload conflicts. 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: verification supports assertions. 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, I3, I4, I5, I6. 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, A3, A6 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A5 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A6 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/self-verification.test.ts:160; assertion/input source links below. Source key: tests/self-verification.test.ts :: accepts another author's claim, replays successful retries and retains payload conflicts :: line 160 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/self-verification.test.ts:160; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:160 — accepts another author's claim, replays successful retries and retains payload conflicts. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 171:
expect(await rs.create(accepted)).toEqual(relationship) - A3 line 175:
expect(replay.status).toBe(201) - A4 line 176:
expect(await replay.json()).toMatchObject({ relationship }) - A5 line 177:
expect(await state()).toEqual(before) - A6 line 178:
expect(\n rs.create({ ...accepted, relationship_type: "extends" }),\n ).rejects.toMatchObject({ code: "idempotency_conflict", status: 409 })
Source inputs and operations
- I1 line 163:
SELF.fetch(\n request("/internal/relationships", accepted),\n ) - I2 line 164:
request("/internal/relationships", accepted) - I3 line 171:
rs.create(accepted) - I4 line 172:
SELF.fetch(\n request("/internal/relationships", accepted),\n ) - I5 line 173:
request("/internal/relationships", accepted) - I6 line 179:
rs.create({ ...accepted, relationship_type: "extends" })
COR-222 — does not reserve a rejected token and allows a corrected payload with that token
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-222 — does not reserve a rejected token and allows a corrected payload with that token |
| 2. Requirement or guarantee | Source test intent: does not reserve a rejected token and allows a corrected payload with that 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: verification supports assertions. 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, 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | 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 | See assertions A1, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/self-verification.test.ts:183; assertion/input source links below. Source key: tests/self-verification.test.ts :: does not reserve a rejected token and allows a corrected payload with that token :: line 183 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/self-verification.test.ts:183; expressions I1, I2, I3, I4. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:183 — does not reserve a rejected token and allows a corrected payload with that token. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 185:
expect(rs.create(input)).rejects.toMatchObject({\n code: "self_verification",\n }) - A2 line 190:
expect(await rs.create(corrected)).toEqual(result) - A3 line 191:
expect(rs.create(input)).rejects.toMatchObject({\n code: "idempotency_conflict",\n })
Source inputs and operations
- I1 line 185:
rs.create(input) - I2 line 189:
rs.create(corrected) - I3 line 190:
rs.create(corrected) - I4 line 191:
rs.create(input)
COR-223 — rejects forged target authorship and resolves stored authors even for store callers
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-223 — rejects forged target authorship and resolves stored authors even for store callers |
| 2. Requirement or guarantee | Source test intent: rejects forged target authorship and resolves stored authors even for store callers. 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: verification supports assertions. 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, I3. 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 A4 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 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/self-verification.test.ts:196; assertion/input source links below. Source key: tests/self-verification.test.ts :: rejects forged target authorship and resolves stored authors even for store callers :: line 196 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/self-verification.test.ts:196; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:196 — rejects forged target authorship and resolves stored authors even for store callers. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(400) - A2 line 204:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n }) - A3 line 207:
expect(rs.create(forged)).rejects.toMatchObject({\n code: "self_verification",\n }) - A4 line 210:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 200:
SELF.fetch(\n request("/internal/relationships", forged),\n ) - I2 line 201:
request("/internal/relationships", forged) - I3 line 207:
rs.create(forged)
COR-224 — keeps existing 404 semantics for missing %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-224 — keeps existing 404 semantics for missing %s |
| 2. Requirement or guarantee | Source test intent: keeps existing 404 semantics for missing %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: verification supports assertions. Do not infer starting state from the title. |
| 7. Input and test data | each: ["source_message_id", "target_message_id"] 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 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, 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/self-verification.test.ts:213; assertion/input source links below. Source key: tests/self-verification.test.ts :: keeps existing 404 semantics for missing %s :: line 213 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/self-verification.test.ts:213; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:213 — keeps existing 404 semantics for missing %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 224:
expect(response.status).toBe(404) - A2 line 225:
expect(await response.json()).toMatchObject({\n error: {\n code: "not_found",\n message: "Both endpoint messages must exist.",\n },\n }) - A3 line 231:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 218:
SELF.fetch(\n request("/internal/relationships", {\n ...input,\n [field]: crypto.randomUUID(),\n }),\n ) - I2 line 219:
request("/internal/relationships", {\n ...input,\n [field]: crypto.randomUUID(),\n })
COR-225 — rejects non-claim targets before comparing authors and persists no state
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-225 — rejects non-claim targets before comparing authors and persists no state |
| 2. Requirement or guarantee | Source test intent: rejects non-claim targets before comparing authors and persists no state. 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: verification supports assertions. 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 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/self-verification.test.ts:235; assertion/input source links below. Source key: tests/self-verification.test.ts :: rejects non-claim targets before comparing authors and persists no state :: line 235 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/self-verification.test.ts:235; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:235 — rejects non-claim targets before comparing authors and persists no state. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 241:
expect(response.status).toBe(422) - A2 line 242:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_verification_target" },\n }) - A3 line 245:
expect(await state()).toEqual(before)
Source inputs and operations
- I1 line 238:
SELF.fetch(\n request("/internal/relationships", input),\n ) - I2 line 239:
request("/internal/relationships", input)
COR-226 — preserves other relationship types from verification messages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-226 — preserves other relationship types from verification messages |
| 2. Requirement or guarantee | Source test intent: preserves other relationship types from verification messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: verification supports assertions. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/self-verification.test.ts:248; assertion/input source links below. Source key: tests/self-verification.test.ts :: preserves other relationship types from verification messages :: line 248 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/self-verification.test.ts:248; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:248 — preserves other relationship types from verification messages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 256:
expect(\n (\n await rs.create({\n ...input,\n relationship_type,\n idempotency_key: crypto.randomUUID(),\n })\n ).relationship_type,\n ).toBe(relationship_type)
Source inputs and operations
- I1 line 258:
rs.create({\n ...input,\n relationship_type,\n idempotency_key: crypto.randomUUID(),\n })
COR-227 — preserves supports from non-verification messages to the same author’s non-claim
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-227 — preserves supports from non-verification messages to the same author’s non-claim |
| 2. Requirement or guarantee | Source test intent: preserves supports from non-verification messages to the same author’s non-claim. 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: verification supports assertions. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/self-verification.test.ts:268; assertion/input source links below. Source key: tests/self-verification.test.ts :: preserves supports from non-verification messages to the same author's non-claim :: line 268 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/self-verification.test.ts:268; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:268 — preserves supports from non-verification messages to the same author's non-claim. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 270:
expect((await rs.create(input)).author_id).toBe(input.author_id)
Source inputs and operations
- I1 line 270:
rs.create(input)
COR-228 — allows independent verification message creation and append without implicit relationships
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-228 — allows independent verification message creation and append without implicit relationships |
| 2. Requirement or guarantee | Source test intent: allows independent verification message creation and append without implicit relationships. 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: verification supports assertions. 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, I3, I4, I5. 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, A4 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A3, A4 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 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/self-verification.test.ts:273; assertion/input source links below. Source key: tests/self-verification.test.ts :: allows independent verification message creation and append without implicit relationships :: line 273 at this pinned revision. |
| 17. Execution date | Not run. |
| 18. Status and outstanding issues | Existing declaration documented; indirect helper assertions and full semantic coverage are not inferred from static extraction. |
| 19. Category | Regression (provisional). |
| 20. Handler, interface or code path | tests/self-verification.test.ts:273; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store, ../src/routes/append, ../src/kinds. |
| 21. Test implementation location and command | tests/self-verification.test.ts:273 — allows independent verification message creation and append without implicit relationships. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 284:
expect(response.status).toBe(201) - A2 line 287:
expect(\n await (await append(request(path, body), env, store)).json(),\n ).toEqual(accepted) - A3 line 290:
expect(await state()).toEqual(before) - A4 line 291:
expect(\n (\n await env.db\n .prepare("SELECT * FROM relationships WHERE source_message_id=?")\n .bind(source)\n .all()\n ).results,\n ).toEqual([])
Source inputs and operations
- I1 line 275:
store.getMessage(source) - I2 line 283:
append(request(path, body), env, store) - I3 line 283:
request(path, body) - I4 line 288:
append(request(path, body), env, store) - I5 line 288:
request(path, body)
tests/store-invariants.test.ts
COR-229 — keeps same-subject conversations independent with explicit immutable roots
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-229 — keeps same-subject conversations independent with explicit immutable roots |
| 2. Requirement or guarantee | Source test intent: keeps same-subject conversations independent with explicit immutable roots. 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 | 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, A2, 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 | See assertions A2, A3 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/store-invariants.test.ts:16; assertion/input source links below. Source key: tests/store-invariants.test.ts :: keeps same-subject conversations independent with explicit immutable roots :: line 16 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/store-invariants.test.ts:16; expressions No direct request/operation expression extracted; inspect the source fixture/helper… Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:16 — keeps same-subject conversations independent with explicit immutable roots. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 19:
expect(a.conversation.subject).toBe(b.conversation.subject) - A2 line 20:
expect(a.conversation.conversation_id).not.toBe(\n b.conversation.conversation_id,\n ) - A3 line 23:
expect(\n env.db\n .prepare(\n "UPDATE conversations SET root_message_id=? WHERE conversation_id=?",\n )\n .bind(b.message.message_id, a.conversation.conversation_id)\n .run(),\n ).rejects.toThrow()
Source inputs and operations
Inputs are supplied indirectly through the cited fixture/helper; inspect it before reproduction.
COR-230 — creates an unlinked message independently of root relationships
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-230 — creates an unlinked message independently of root relationships |
| 2. Requirement or guarantee | Source test intent: creates an unlinked message independently of root relationships. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/store-invariants.test.ts:32; assertion/input source links below. Source key: tests/store-invariants.test.ts :: creates an unlinked message independently of root relationships :: line 32 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/store-invariants.test.ts:32; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:32 — creates an unlinked message independently of root relationships. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 42:
expect(\n (\n await new RelationshipStore(env.db).list({\n message_id: m.message_id,\n after: 0,\n at: m.sequence,\n limit: 100,\n })\n ).relationships,\n ).toEqual([])
Source inputs and operations
- I1 line 35:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: a.conversation.conversation_id,\n content: "unlinked",\n author_id: author,\n created_at: new Date().toISOString(),\n })
COR-231 — enforces message membership through a conversation foreign key
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-231 — enforces message membership through a conversation foreign key |
| 2. Requirement or guarantee | Source test intent: enforces message membership through a conversation foreign 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: 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/store-invariants.test.ts:53; assertion/input source links below. Source key: tests/store-invariants.test.ts :: enforces message membership through a conversation foreign key :: line 53 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/store-invariants.test.ts:53; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:53 — enforces message membership through a conversation foreign key. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 54:
expect(\n new D1CorpusStore(env.db).appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: crypto.randomUUID(),\n content: "orphan",\n author_id: author,\n created_at: new Date().toISOString(),\n }),\n ).rejects.toThrow()
Source inputs and operations
- I1 line 55:
new D1CorpusStore(env.db).appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: crypto.randomUUID(),\n content: "orphan",\n author_id: author,\n created_at: new Date().toISOString(),\n })
COR-232 — rolls back conversation creation when root insertion fails
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-232 — rolls back conversation creation when root insertion fails |
| 2. Requirement or guarantee | Source test intent: rolls back conversation creation when root insertion fails. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Resilience — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A2 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A1 below. No delivery guarantee beyond the checked expressions is inferred. |
| 13. Negative assertions: what must not happen | See assertions A1, A2 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/store-invariants.test.ts:64; assertion/input source links below. Source key: tests/store-invariants.test.ts :: rolls back conversation creation when root insertion fails :: line 64 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/store-invariants.test.ts:64; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:64 — rolls back conversation creation when root insertion fails. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n new D1CorpusStore(env.db).createConversation({\n conversation_id: id,\n message_id: a.message.message_id,\n subject: "rollback",\n content: "duplicate",\n author_id: author,\n created_at: new Date().toISOString(),\n }),\n ).rejects.toThrow() - A2 line 77:
expect(await new D1CorpusStore(env.db).getConversation(id)).toBeNull()
Source inputs and operations
- I1 line 68:
new D1CorpusStore(env.db).createConversation({\n conversation_id: id,\n message_id: a.message.message_id,\n subject: "rollback",\n content: "duplicate",\n author_id: author,\n created_at: new Date().toISOString(),\n })
COR-233 — enforces retraction ownership even for a lower-level database writer
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-233 — enforces retraction ownership even for a lower-level database writer |
| 2. Requirement or guarantee | Source test intent: enforces retraction ownership even for a lower-level database writer. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/store-invariants.test.ts:79; assertion/input source links below. Source key: tests/store-invariants.test.ts :: enforces retraction ownership even for a lower-level database writer :: 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 | Security (provisional). |
| 20. Handler, interface or code path | tests/store-invariants.test.ts:79; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:79 — enforces retraction ownership even for a lower-level database writer. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 90:
expect(\n env.db\n .prepare("INSERT INTO relationship_retractions VALUES(?,?,?,?,?)")\n .bind(\n crypto.randomUUID(),\n r.relationship_id,\n crypto.randomUUID(),\n new Date().toISOString(),\n r.sequence,\n )\n .run(),\n ).rejects.toThrow()
Source inputs and operations
- I1 line 83:
rs.create({\n source_message_id: a.message.message_id,\n target_message_id: b.message.message_id,\n relationship_type: "supports",\n author_id: author,\n idempotency_key: crypto.randomUUID(),\n })
COR-234 — permits root messages in cross-conversation reply relationships
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-234 — permits root messages in cross-conversation reply relationships |
| 2. Requirement or guarantee | Source test intent: permits root messages in cross-conversation reply relationships. 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 | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | See assertions A1, 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/store-invariants.test.ts:103; assertion/input source links below. Source key: tests/store-invariants.test.ts :: permits root messages in cross-conversation reply relationships :: line 103 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/store-invariants.test.ts:103; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/relationship-store. |
| 21. Test implementation location and command | tests/store-invariants.test.ts:103 — permits root messages in cross-conversation reply relationships. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 113:
expect(r.source_message_id).toBe(a.conversation.root_message_id) - A2 line 114:
expect(r.target_message_id).toBe(b.conversation.root_message_id)
Source inputs and operations
- I1 line 106:
new RelationshipStore(env.db).create({\n source_message_id: a.message.message_id,\n target_message_id: b.message.message_id,\n relationship_type: "replies-to",\n author_id: author,\n idempotency_key: crypto.randomUUID(),\n })
tests/stream.test.ts
COR-235 — starts after the supplied cursor and uses the corpus sequence as the SSE event id
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-235 — starts after the supplied cursor and uses the corpus sequence as the SSE event id |
| 2. Requirement or guarantee | Source test intent: starts after the supplied cursor and uses the corpus sequence as the SSE event 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 | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Corpus Stream. 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, 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 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5, A6 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 A2, 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/stream.test.ts:7; assertion/input source links below. Source key: tests/stream.test.ts :: starts after the supplied cursor and uses the corpus sequence as the SSE event id :: 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 | Regression (provisional). |
| 20. Handler, interface or code path | tests/stream.test.ts:7; expressions I1, I2, I3, I4. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/stream.test.ts:7 — starts after the supplied cursor and uses the corpus sequence as the SSE event id. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 34:
expect(response.status).toBe(200) - A2 line 102:
expect(messageEvent).not.toBeNull() - A3 line 104:
expect(messageEvent?.id).toBe(String(second.sequence)) - A4 line 106:
expect(messageEvent?.id).not.toBe(String(first.message.sequence)) - A5 line 108:
expect(messageEvent?.data).toBeTruthy() - A6 line 112:
expect(data.sequence).toBe(second.sequence)
Source inputs and operations
- I1 line 13:
store.createConversation({\n conversation_id: conversationId,\n subject: "SSE cursor test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 22:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 30:
SELF.fetch(\n `https://example.com/corpus/stream?after=${first.message.sequence}`,\n ) - I4 line 53:
reader.read()
COR-236 — can recover missed messages from the changes feed using the last SSE sequence
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-236 — can recover missed messages from the changes feed using the last SSE sequence |
| 2. Requirement or guarantee | Source test intent: can recover missed messages from the changes feed using the last SSE sequence. 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: Corpus Stream. 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, I3, I4, I5, I6. 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, 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 A2, A4, A5 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/stream.test.ts:115; assertion/input source links below. Source key: tests/stream.test.ts :: can recover missed messages from the changes feed using the last SSE sequence :: 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 | Resilience (provisional). |
| 20. Handler, interface or code path | tests/stream.test.ts:115; expressions I1, I2, I3, I4, I5, I6. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/stream.test.ts:115 — can recover missed messages from the changes feed using the last SSE sequence. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 150:
expect(response.status).toBe(200) - A2 line 206:
expect(lastSseSequence).toBe(second.sequence) - A3 line 212:
expect(recoveryResponse.status).toBe(200) - A4 line 222:
expect(\n recoveredChanges.some((change) => change.sequence === third.sequence),\n ).toBe(true) - A5 line 226:
expect(\n recoveredChanges.some((change) => change.sequence === second.sequence),\n ).toBe(false)
Source inputs and operations
- I1 line 121:
store.createConversation({\n conversation_id: conversationId,\n subject: "SSE recovery test",\n message_id: crypto.randomUUID(),\n content: "First message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I2 line 130:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Second message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I3 line 138:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversationId,\n content: "Third message",\n author_id: authorId,\n created_at: new Date().toISOString(),\n }) - I4 line 146:
SELF.fetch(\n `https://example.com/corpus/stream?after=${first.message.sequence}`,\n ) - I5 line 166:
reader.read() - I6 line 208:
SELF.fetch(\n `https://example.com/corpus/changes.jsonl?after=${lastSseSequence}`,\n )
COR-237 — rejects an unsafe SSE cursor
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-237 — rejects an unsafe SSE cursor |
| 2. Requirement or guarantee | Source test intent: rejects an unsafe SSE cursor. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Corpus Stream. 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/stream.test.ts:230; assertion/input source links below. Source key: tests/stream.test.ts :: rejects an unsafe SSE cursor :: line 230 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/stream.test.ts:230; expressions I1. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/stream.test.ts:230 — rejects an unsafe SSE cursor. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 237:
expect(response.status).toBe(400)
Source inputs and operations
- I1 line 233:
SELF.fetch(\n `https://example.com/corpus/stream?after=${unsafeCursor}`,\n )
COR-238 — returns tags and mentions in SSE message events
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-238 — returns tags and mentions in SSE message events |
| 2. Requirement or guarantee | Source test intent: returns tags and mentions in SSE message events. 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: Corpus Stream. 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, 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 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5 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 A2, A6 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/stream.test.ts:240; assertion/input source links below. Source key: tests/stream.test.ts :: returns tags and mentions in SSE message events :: line 240 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/stream.test.ts:240; expressions I1, I2, I3, I4. Imported modules: ../src/kinds, vitest, cloudflare:test, ../src/d1-store. |
| 21. Test implementation location and command | tests/stream.test.ts:240 — returns tags and mentions in SSE message events. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 276:
expect(response.status).toBe(200) - A2 line 346:
expect(messageEvent).not.toBeNull() - A3 line 348:
expect(messageEvent?.id).toBe(String(message.sequence)) - A4 line 352:
expect(data.data.message_id).toBe(message.message_id) - A5 line 354:
expect(data.data.tags).toEqual(["agents", "memory"]) - A6 line 356:
expect(data.data.mentions).toEqual([]) - A7 line 357:
expect(data.data.kind).toEqual(KIND_NAMES)
Source inputs and operations
- I1 line 243:
store.createConversation({\n conversation_id: crypto.randomUUID(),\n subject: `SSE metadata test ${crypto.randomUUID()}`,\n message_id: crypto.randomUUID(),\n content: "Opening message",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n }) - I2 line 252:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: conversation.conversation.conversation_id,\n content: "A message with !agents and !memory",\n author_id: crypto.randomUUID(),\n created_at: new Date().toISOString(),\n\n kind: [...KIND_NAMES].reverse(),\n references: [\n {\n type: "tag",\n value: "agents",\n },\n {\n type: "tag",\n value: "memory",\n },\n ],\n }) - I3 line 272:
SELF.fetch(\n `https://example.com/corpus/stream?after=${conversation.message.sequence}`,\n ) - I4 line 295:
reader.read()
tests/structured-payload.test.ts
COR-239 — keeps the authoritative trimmed subject and ASCII control policy (%#)
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-239 — keeps the authoritative trimmed subject and ASCII control policy (%#) |
| 2. Requirement or guarantee | Source test intent: keeps the authoritative trimmed subject and ASCII control policy (%#). 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: Structured Payload Contract v0.1. 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\u007fb", 400],\n ["a\u0085b", 201],\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 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/structured-payload.test.ts:48; assertion/input source links below. Source key: tests/structured-payload.test.ts :: keeps the authoritative trimmed subject and ASCII control policy (%#) :: 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/structured-payload.test.ts:48; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:48 — keeps the authoritative trimmed subject and ASCII control policy (%#). Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 64:
expect(await response.json()).toMatchObject({\n subject: subject.trim(),\n }) - A3 line 68:
expect(await response.json()).toEqual({\n error: "invalid_request",\n message: "subject is required and must be valid.",\n })
Source inputs and operations
- I1 line 61:
write({ subject, content: "valid" })
COR-240 — distinguishes the UTF-16 content budget from generated UTF-8 event bytes
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-240 — distinguishes the UTF-16 content budget from generated UTF-8 event bytes |
| 2. Requirement or guarantee | Source test intent: distinguishes the UTF-16 content budget from generated UTF-8 event bytes. 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 Contract v0.1. 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, I3. 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, A3, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A4, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A6 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/structured-payload.test.ts:75; assertion/input source links below. Source key: tests/structured-payload.test.ts :: distinguishes the UTF-16 content budget from generated UTF-8 event bytes :: line 75 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:75; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:75 — distinguishes the UTF-16 content budget from generated UTF-8 event bytes. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(withinStringBudget.status).toBe(413) - A2 line 78:
expect(await withinStringBudget.json()).toMatchObject({\n error: { code: "message_too_large" },\n }) - A3 line 82:
expect(beyondStringBudget.status).toBe(413) - A4 line 83:
expect(await beyondStringBudget.json()).toMatchObject({\n error: { code: "content_too_large" },\n }) - A5 line 87:
expect(controls.status).toBe(201) - A6 line 88:
expect(\n (await controls.json<{ message: { content: string } }>()).message.content,\n ).toBe(" a\u0000\t\r\n\u007fb ")
Source inputs and operations
- I1 line 76:
write({ content: "😀".repeat(32768) }) - I2 line 81:
write({ content: "😀".repeat(32769) }) - I3 line 86:
write({ content: " a\u0000\t\r\n\u007fb " })
COR-241 — rejects a forged validation status even at the authoritative store boundary
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-241 — rejects a forged validation status even at the authoritative store boundary |
| 2. Requirement or guarantee | Source test intent: rejects a forged validation status even at the authoritative store boundary. 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: Structured Payload Contract v0.1. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1 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 A1 below. Only the shown negative/rejection checks are claimed; other forbidden effects require review. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/structured-payload.test.ts:93; assertion/input source links below. Source key: tests/structured-payload.test.ts :: rejects a forged validation status even at the authoritative store boundary :: line 93 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/structured-payload.test.ts:93; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:93 — rejects a forged validation status even at the authoritative store boundary. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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(\n store().createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n subject: "Forged status",\n author_id: author,\n created_at: new Date().toISOString(),\n payload: {},\n schema_validated: true,\n } as never),\n ).rejects.toMatchObject({ code: "invalid_request" })
Source inputs and operations
- I1 line 95:
store().createConversation({\n conversation_id: crypto.randomUUID(),\n message_id: crypto.randomUUID(),\n subject: "Forged status",\n author_id: author,\n created_at: new Date().toISOString(),\n payload: {},\n schema_validated: true,\n } as never)
COR-242 — persists JSON %j without manufacturing content
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-242 — persists JSON %j without manufacturing content |
| 2. Requirement or guarantee | Source test intent: persists JSON %j without manufacturing 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: Structured Payload Contract v0.1. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n null,\n true,\n false,\n 0,\n -4.25,\n "text",\n [],\n [null, 2, { a: true }],\n {},\n { b: "é😀", a: 1 },\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, A4, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | See assertions A3, A4, A6 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:107; assertion/input source links below. Source key: tests/structured-payload.test.ts :: persists JSON %j without manufacturing content :: line 107 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:107; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:107 — persists JSON %j without manufacturing content. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 120:
expect(response.status).toBe(201) - A2 line 125:
expect(message).toHaveProperty("payload", payload) - A3 line 126:
expect(message).not.toHaveProperty("content") - A4 line 127:
expect(message).not.toHaveProperty("schema_validated") - A5 line 131:
expect(event.data).toHaveProperty("payload", payload) - A6 line 132:
expect(event.data).not.toHaveProperty("content")
Source inputs and operations
COR-243 — accepts Markdown-only and combined messages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-243 — accepts Markdown-only and combined messages |
| 2. Requirement or guarantee | Source test intent: accepts Markdown-only and combined messages. Displayed assertions establish this test’s expected checks, not a separate system-wide guarantee. |
| 3. Purpose and risk addressed | Detect regression of this named behaviour; complete business-impact/invariant analysis remains in the curated cases or follow-up review. |
| 4. Priority | High — provisional catalogue triage; subject to risk review. |
| 5. Test type | Regression — provisional grouping from the declaration name. |
| 6. Preconditions | Use section C plus the cited file’s fixtures and setup/teardown hooks. Suite context: Structured Payload Contract v0.1. 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/structured-payload.test.ts:135; assertion/input source links below. Source key: tests/structured-payload.test.ts :: accepts Markdown-only and combined messages :: line 135 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:135; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:135 — accepts Markdown-only and combined messages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 141:
expect(response.status).toBe(201) - A2 line 142:
expect(\n (await response.json<{ message: unknown }>()).message,\n ).toMatchObject(input)
Source inputs and operations
- I1 line 140:
write(input)
COR-244 — rejects %j atomically with %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-244 — rejects %j atomically with %s |
| 2. Requirement or guarantee | Source test intent: rejects %j atomically with %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: Structured Payload Contract v0.1. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n [{}, "invalid_request", 400],\n [\n { payload: null, schema_name: "toastmachine.object" },\n "invalid_request",\n 400,\n ],\n [{ payload: null, schema_version: "1" }, "invalid_request", 400],\n [\n {\n content: "text",\n schema_name: "toastmachine.object",\n schema_version: "1",\n },\n "invalid_request",\n 400,\n ],\n [\n { payload: {}, schema_name: "missing", schema_version: "1" },\n "unknown_schema",\n 422,\n ],\n [\n { payload: {}, schema_name: "toastmachine.object", schema_version: "2" },\n "unsupported_schema_version",\n 422,\n ],\n [\n {\n payload: null,\n schema_name: "toastmachine.object",\n schema_version: "1",\n },\n "payload_schema_validation_failed",\n 422,\n ],\n [{ payload: null, schema_validated: true }, "invalid_request", 400],\n [\n {\n payload: {},\n schema_name: "toastmachine.object",\n schema_version: "1",\n schema_validated: false,\n },\n "invalid_request",\n 400,\n ],\n [{ payload: null, schema_validated: null }, "invalid_request", 400],\n [{ payload: "\ud800" }, "invalid_request", 400],\n [{ payload: { "\udfff": 1 } }, "invalid_request", 400],\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 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 A4 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/structured-payload.test.ts:148; assertion/input source links below. Source key: tests/structured-payload.test.ts :: rejects %j atomically with %s :: line 148 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:148; expressions I1. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:148 — rejects %j atomically with %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 201:
expect(response.status).toBe(status) - A2 line 205:
expect(result.error.code).toBe(code) - A3 line 206:
expect(result.error.how_to_proceed.length).toBeGreaterThan(10) - A4 line 207:
expect(await count()).toEqual(before)
Source inputs and operations
- I1 line 200:
write(body as Record<string, unknown>)
COR-245 — validates exact catalogue entries without coercing or mutating payload
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-245 — validates exact catalogue entries without coercing or mutating payload |
| 2. Requirement or guarantee | Source test intent: validates exact catalogue entries without coercing or mutating 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 | 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 Contract v0.1. 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 A2, A3, A4 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 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:210; assertion/input source links below. Source key: tests/structured-payload.test.ts :: validates exact catalogue entries without coercing or mutating payload :: line 210 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:210; expressions I1, I2. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:210 — validates exact catalogue entries without coercing or mutating payload. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 217:
expect(response.status).toBe(201) - A2 line 221:
expect(message.schema_validated).toBe(true) - A3 line 222:
expect(await store().getMessage(message.message_id)).toMatchObject({\n payload,\n tags: [],\n mentions: [],\n schema_name: "toastmachine.object",\n schema_version: "1",\n schema_validated: true,\n }) - A4 line 230:
expect(\n env.db\n .prepare(\n "UPDATE messages SET structured_payload='null' WHERE message_id=?",\n )\n .bind(message.message_id)\n .run(),\n ).rejects.toThrow("immutable")
Source inputs and operations
- I1 line 212:
write({\n payload,\n schema_name: "toastmachine.object",\n schema_version: "1",\n }) - I2 line 222:
store().getMessage(message.message_id)
COR-246 — enforces canonical payload bytes at 65536 and content characters at 65536
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-246 — enforces canonical payload bytes at 65536 and content characters at 65536 |
| 2. Requirement or guarantee | Source test intent: enforces canonical payload bytes at 65536 and content characters at 65536. 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 Contract v0.1. 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, I3, I4, I5. 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, A3, A5 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A4, A5, A6, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A7 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/structured-payload.test.ts:240; assertion/input source links below. Source key: tests/structured-payload.test.ts :: enforces canonical payload bytes at 65536 and content characters at 65536 :: line 240 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:240; expressions I1, I2, I3, I4, I5. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:240 — enforces canonical payload bytes at 65536 and content characters at 65536. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 242:
expect(encoder.encode(canonicalJson(payload)).length).toBe(65536) - A2 line 243:
expect((await write({ payload })).status).toBe(201) - A3 line 245:
expect(rejected.status).toBe(413) - A4 line 246:
expect(await rejected.json()).toMatchObject({\n error: { code: "payload_too_large" },\n }) - A5 line 250:
expect((await write({ content: "a".repeat(65536) })).status).toBe(201) - A6 line 251:
expect(\n await (await write({ content: "a".repeat(65537) })).json(),\n ).toMatchObject({ error: { code: "content_too_large" } }) - A7 line 254:
expect(\n await (await write({ content: "é".repeat(65536) })).json(),\n ).toMatchObject({ error: { code: "message_too_large" } })
Source inputs and operations
- I1 line 243:
write({ payload }) - I2 line 244:
write({ payload: payload + "a" }) - I3 line 250:
write({ content: "a".repeat(65536) }) - I4 line 252:
write({ content: "a".repeat(65537) }) - I5 line 255:
write({ content: "é".repeat(65536) })
COR-247 — measures the actual event envelope and rolls back at one byte over the boundary
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-247 — measures the actual event envelope and rolls back at one byte over the boundary |
| 2. Requirement or guarantee | Source test intent: measures the actual event envelope and rolls back at one byte over the boundary. 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: Structured Payload Contract v0.1. 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, I3, I4, I5, I6. 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, A4, A6 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A1, A7, A10 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A7, A8, A9, A10 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 A9 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:259; assertion/input source links below. Source key: tests/structured-payload.test.ts :: measures the actual event envelope and rolls back at one byte over the boundary :: line 259 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/structured-payload.test.ts:259; expressions I1, I2, I3, I4, I5, I6. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:259 — measures the actual event envelope and rolls back at one byte over the boundary. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 277:
expect(content.length).toBeLessThan(budget) - A2 line 282:
expect(below.status).toBe(201) - A3 line 287:
expect(encoder.encode(canonicalJson(belowEvent)).length).toBe(\n EVENT_MAX_BYTES - 1,\n ) - A4 line 291:
expect(exact.status).toBe(201) - A5 line 296:
expect(encoder.encode(canonicalJson(exactEvent)).length).toBe(\n EVENT_MAX_BYTES,\n ) - A6 line 305:
expect(rejected.status).toBe(413) - A7 line 306:
expect(await rejected.json()).toMatchObject({\n error: { code: "message_too_large" },\n }) - A8 line 309:
expect(await count()).toEqual(before) - A9 line 310:
expect(\n await env.db\n .prepare("SELECT * FROM idempotency_keys WHERE idempotency_key=?")\n .bind(token)\n .first(),\n ).toBeNull() - A10 line 320:
expect((await next.json<{ sequence: number }>()).sequence).toBe(\n exactResult.sequence + 1,\n )
Source inputs and operations
- I1 line 260:
write({ payload: "a".repeat(65534) }) - I2 line 266:
write({ content: "x", payload }, root.conversation_id) - I3 line 278:
write(\n { content: content.slice(0, -1), payload },\n root.conversation_id,\n ) - I4 line 290:
write({ content, payload }, root.conversation_id) - I5 line 301:
write(\n { content: content + "a", payload, idempotency_key: token },\n root.conversation_id,\n ) - I6 line 316:
write(\n { payload: null, idempotency_key: token },\n root.conversation_id,\n )
COR-248 — uses canonical payload hashes for retries and includes schema metadata
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-248 — uses canonical payload hashes for retries and includes schema metadata |
| 2. Requirement or guarantee | Source test intent: uses canonical payload hashes for retries and includes schema 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 | Resilience — 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 Contract v0.1. 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, I3. 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 | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/structured-payload.test.ts:325; assertion/input source links below. Source key: tests/structured-payload.test.ts :: uses canonical payload hashes for retries and includes schema metadata :: line 325 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/structured-payload.test.ts:325; expressions I1, I2, I3. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:325 — uses canonical payload hashes for retries and includes schema metadata. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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
Source inputs and operations
- I1 line 328:
write({ payload: { z: 1, a: 2 }, idempotency_key: token }) - I2 line 331:
write({ payload: { a: 2, z: 1 }, idempotency_key: token }) - I3 line 334:
write({\n payload: { a: 2, z: 1 },\n schema_name: "toastmachine.object",\n schema_version: "1",\n idempotency_key: token,\n })
COR-249 — preserves payload and metadata through HTTP, exports, archive materialization and replay
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-249 — preserves payload and metadata through HTTP, exports, archive materialization and replay |
| 2. Requirement or guarantee | Source test intent: preserves payload and metadata through HTTP, exports, archive materialization and replay. 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 Contract v0.1. 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, I3, I4, I5, I6, I7, I8. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A2, A3, A4, A6, A7 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A3, A4, A5, A6, A7 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/structured-payload.test.ts:343; assertion/input source links below. Source key: tests/structured-payload.test.ts :: preserves payload and metadata through HTTP, exports, archive materialization and replay :: line 343 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:343; expressions I1, I2, I3, I4, I5, I6, I7, I8. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:343 — preserves payload and metadata through HTTP, exports, archive materialization and replay. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 359:
expect(JSON.stringify(data)).toContain('"payload"') - A2 line 365:
expect(await detail.json()).toMatchObject({\n payload: message.payload,\n schema_validated: true,\n }) - A3 line 373:
expect(await markdown.text()).toContain(canonicalJson(message.payload)) - A4 line 382:
expect(exported).toMatchObject({\n payload: message.payload,\n schema_validated: true,\n }) - A5 line 386:
expect(rows).toContain(canonicalJson(exported)) - A6 line 405:
expect(event?.data).toMatchObject({\n payload: message.payload,\n schema_validated: true,\n }) - A7 line 413:
expect(\n await new D1CorpusStore(env.restore_db).getMessage(message.message_id),\n ).toMatchObject({ payload: message.payload, schema_validated: true })
Source inputs and operations
- I1 line 344:
write({\n payload: { z: [null, "é😀"], a: 1 },\n schema_name: "toastmachine.object",\n schema_version: "1",\n }) - I2 line 357:
SELF.fetch(`https://example.com${path}`) - I3 line 361:
SELF.fetch(\n `https://example.com/messages/${message.message_id}`,\n { headers: { Accept: "application/ld+json" } },\n ) - I4 line 369:
SELF.fetch(\n `https://example.com/messages/${message.message_id}`,\n { headers: { Accept: "text/markdown" } },\n ) - I5 line 375:
SELF.fetch("https://example.com/corpus/messages.jsonl") - I6 line 397:
materializer.materialize() - I7 line 412:
replayEvent(env.restore_db, e) - I8 line 414:
new D1CorpusStore(env.restore_db).getMessage(message.message_id)
COR-250 — filters before pagination and retains filters on continuation links
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-250 — filters before pagination and retains filters on continuation links |
| 2. Requirement or guarantee | Source test intent: filters before pagination and retains filters on continuation links. 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 Contract v0.1. 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, I3, I4, I5, I6, I7, I8. 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 A7 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A4, A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A2, A5 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A6, A7 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/structured-payload.test.ts:418; assertion/input source links below. Source key: tests/structured-payload.test.ts :: filters before pagination and retains filters on continuation links :: line 418 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:418; expressions I1, I2, I3, I4, I5, I6, I7, I8. Imported modules: vitest, cloudflare:test, ../src/d1-store, ../src/routes/append, ../src/protocol, ../src/d1/changes, ../src/materializer, ../src/archive-reader, ../src/recovery, ../schema.sql?raw, ./setup. |
| 21. Test implementation location and command | tests/structured-payload.test.ts:418 — filters before pagination and retains filters on continuation links. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 434:
expect(page.total).toBe(2) - A2 line 435:
expect(page.messages[0]).toHaveProperty("payload", null) - A3 line 436:
expect(page.next).toContain("has_payload=true") - A4 line 437:
expect(page.next).toContain("schema_validated=false") - A5 line 441:
expect(next.messages[0]).toHaveProperty("payload", false) - A6 line 450:
expect(\n await (await SELF.fetch(`${origin}&${query}`)).json(),\n ).toMatchObject({ total: n }) - A7 line 460:
expect((await SELF.fetch(`${origin}&${query}`)).status).toBe(400)
Source inputs and operations
- I1 line 420:
write({ payload: null }) - I2 line 422:
write({ content: "plain" }, a.conversation_id) - I3 line 423:
write(\n { payload: {}, schema_name: "toastmachine.object", schema_version: "1" },\n a.conversation_id,\n ) - I4 line 427:
write({ payload: false }, a.conversation_id) - I5 line 430:
SELF.fetch(\n `${origin}&has_payload=true&schema_validated=false&order=asc&limit=1`,\n ) - I6 line 439:
SELF.fetch(new URL(page.next, origin)) - I7 line 451:
SELF.fetch(`${origin}&${query}`) - I8 line 460:
SELF.fetch(`${origin}&${query}`)
tests/tags.test.ts
COR-251 — returns a successful empty catalogue with the standard envelope
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-251 — returns a successful empty catalogue with the standard envelope |
| 2. Requirement or guarantee | Source test intent: returns a successful empty catalogue with the standard envelope. 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: tag catalogue. 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 | 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/tags.test.ts:34; assertion/input source links below. Source key: tests/tags.test.ts :: returns a successful empty catalogue with the standard envelope :: line 34 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/tags.test.ts:34; expressions I1. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:34 — returns a successful empty catalogue with the standard envelope. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 36:
expect(response.status).toBe(200) - A2 line 37:
expect(await response.json()).toEqual({\n tags: [],\n total: 0,\n limit: 100,\n offset: 0,\n has_more: false,\n }) - A3 line 44:
expect(response.headers.get("Cache-Control")).toBe("no-store")
Source inputs and operations
- I1 line 35:
SELF.fetch("https://example.com/tags")
COR-252 — uses canonical parsing, deduplicates per message, and preserves case in counts and filters
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-252 — uses canonical parsing, deduplicates per message, and preserves case in counts and filters |
| 2. Requirement or guarantee | Source test intent: uses canonical parsing, deduplicates per message, and preserves case in counts and filters. 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: tag catalogue. 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, I3, I4, I5. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A6 below. Referenced variables remain symbolic; no universal response envelope is assumed. |
| 11. Expected state changes | See assertions A1, A3, A4, A5, A6 below. Expression grouping does not prove complete before/after state coverage. |
| 12. Expected emitted events or downstream calls, where applicable | See assertions A6 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/tags.test.ts:47; assertion/input source links below. Source key: tests/tags.test.ts :: uses canonical parsing, deduplicates per message, and preserves case in counts and filters :: 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/tags.test.ts:47; expressions I1, I2, I3, I4, I5. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:47 — uses canonical parsing, deduplicates per message, and preserves case in counts and filters. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 65:
expect(page.tags).toEqual([\n { tag: "Chess", count: 1, conversation_count: 1 },\n { tag: "ai", count: 2, conversation_count: 1 },\n { tag: "chess", count: 3, conversation_count: 2 },\n { tag: "hyphen-tag", count: 1, conversation_count: 1 },\n { tag: "under_score", count: 1, conversation_count: 1 },\n ]) - A2 line 72:
expect(page.total).toBe(5) - A3 line 85:
expect(messages.total).toBe(item.count) - A4 line 86:
expect(search.total).toBe(item.count) - A5 line 87:
expect(conversations.conversations).toHaveLength(item.conversation_count) - A6 line 89:
expect(\n (\n await (\n await SELF.fetch("https://example.com/messages?tag=CHESS")\n ).json<{ total: number }>()\n ).total,\n ).toBe(0)
Source inputs and operations
- I1 line 53:
store.appendMessage({\n message_id: crypto.randomUUID(),\n conversation_id: first.conversation_id,\n author_id: crypto.randomUUID(),\n content,\n created_at: new Date().toISOString(),\n\n references: await resolveMessageReferences(env, content),\n }) - I2 line 63:
SELF.fetch("https://example.com/tags") - I3 line 75:
SELF.fetch(`https://example.com/messages?tag=${item.tag}`) - I4 line 78:
SELF.fetch(`https://example.com/search?q=marker&tag=${item.tag}`) - I5 line 92:
SELF.fetch("https://example.com/messages?tag=CHESS")
COR-253 — pages distinct tags in lexical order, including final and past-end pages
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-253 — pages distinct tags in lexical order, including final and past-end pages |
| 2. Requirement or guarantee | Source test intent: pages distinct tags in lexical order, including final and past-end pages. 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: tag catalogue. 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, I3. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | See assertions A1, A2, A3, A4, A5, A6 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 | See assertions 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/tags.test.ts:98; assertion/input source links below. Source key: tests/tags.test.ts :: pages distinct tags in lexical order, including final and past-end pages :: 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/tags.test.ts:98; expressions I1, I2, I3. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:98 — pages distinct tags in lexical order, including final and past-end pages. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 101:
expect(await first.json()).toMatchObject({\n tags: [{ tag: "alpha" }, { tag: "beta" }],\n total: 3,\n limit: 2,\n offset: 0,\n has_more: true,\n }) - A2 line 108:
expect(first.headers.get("Link")).toContain("offset=2") - A3 line 110:
expect(await last.json()).toEqual({\n tags: [{ tag: "gamma", count: 1, conversation_count: 1 }],\n total: 3,\n limit: 2,\n offset: 2,\n has_more: false,\n }) - A4 line 117:
expect(last.headers.get("Link")).toContain('rel="prev"') - A5 line 118:
expect(last.headers.get("Link")).not.toContain('rel="next"') - A6 line 119:
expect(\n await (\n await SELF.fetch("https://example.com/tags?limit=2&offset=10")\n ).json(),\n ).toEqual({ tags: [], total: 3, limit: 2, offset: 10, has_more: false })
Source inputs and operations
- I1 line 100:
SELF.fetch("https://example.com/tags?limit=2") - I2 line 109:
SELF.fetch("https://example.com/tags?limit=2&offset=2") - I3 line 121:
SELF.fetch("https://example.com/tags?limit=2&offset=10")
COR-254 — supports multiple full pages of distinct tags without duplicates
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-254 — supports multiple full pages of distinct tags without duplicates |
| 2. Requirement or guarantee | Source test intent: supports multiple full pages of distinct tags without duplicates. 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: tag catalogue. Do not infer starting state from the title. |
| 7. Input and test data | No each/for parameter table on this declaration; its callback may still generate inputs. Input/operation expressions: I1. Use disposable fixture data only. |
| 8. Execution steps | 1. Prepare the existing source test harness from section C. 2. Run pnpm test. 3. Locate this named declaration and its parameterized/conditional instances. 4. Compare the displayed assertions. 5. Record evidence and follow teardown. Not executed during this review. |
| 9. Expected HTTP status, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 10. Expected response headers and body | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 11. Expected state changes | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 12. Expected emitted events or downstream calls, where applicable | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 13. Negative assertions: what must not happen | No direct assertion identified for this field; inspect the referenced helpers before stating an expectation. |
| 14. Cleanup and postconditions | Use the cited file’s hooks/finally blocks and section C. Restore mocks and remove only isolated test data. |
| 15. Actual result | Not run — no execution evidence collected. |
| 16. Evidence references | tests/tags.test.ts:126; assertion/input source links below. Source key: tests/tags.test.ts :: supports multiple full pages of distinct tags without duplicates :: line 126 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/tags.test.ts:126; expressions I1. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:126 — supports multiple full pages of distinct tags without duplicates. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 137:
expect(page.total).toBe(205) - A2 line 138:
expect(page.has_more).toBe(offset < 200) - A3 line 141:
expect(found).toEqual(expected) - A4 line 142:
expect(new Set(found).size).toBe(205)
Source inputs and operations
- I1 line 135:
SELF.fetch(`https://example.com/tags?offset=${offset}`)
COR-255 — rejects invalid pagination %s
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-255 — rejects invalid pagination %s |
| 2. Requirement or guarantee | Source test intent: rejects invalid pagination %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: tag catalogue. Do not infer starting state from the title. |
| 7. Input and test data | each: [\n "limit=0",\n "limit=1001",\n "limit=1.5",\n "limit=no",\n "offset=-1",\n "offset=9007199254740992",\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 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/tags.test.ts:145; assertion/input source links below. Source key: tests/tags.test.ts :: rejects invalid pagination %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/tags.test.ts:145; expressions I1. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:145 — rejects invalid pagination %s. Run pnpm test from /home/johnny/projects/toastmachine-corpus-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 154:
expect(response.status).toBe(400) - A2 line 155:
expect(await response.json()).toMatchObject({\n error: { code: "invalid_request" },\n })
Source inputs and operations
- I1 line 153:
SELF.fetch(`https://example.com/tags?${query}`)
COR-256 — retains Markdown negotiation, bodyless HEAD, and read-only methods
| Field | Source-backed specification or observation |
|---|---|
| 1. Test ID and name | COR-256 — retains Markdown negotiation, bodyless HEAD, and read-only methods |
| 2. Requirement or guarantee | Source test intent: retains Markdown negotiation, bodyless HEAD, and read-only 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: tag catalogue. 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, 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, A3, A5, A6 below. A numeric schema/helper expectation is not automatically an HTTP response contract. |
| 10. Expected response headers and body | See assertions A2, A4 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 A5, A6 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/tags.test.ts:160; assertion/input source links below. Source key: tests/tags.test.ts :: retains Markdown negotiation, bodyless HEAD, and read-only methods :: line 160 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/tags.test.ts:160; expressions I1, I2, I3, I4. Imported modules: cloudflare:test, vitest, ../src/d1-store, ../src/references, ../src/store. |
| 21. Test implementation location and command | tests/tags.test.ts:160 — retains Markdown negotiation, bodyless HEAD, and read-only methods. Run pnpm test from /home/johnny/projects/toastmachine-corpus-worker after preparing its existing test environment; this invokes the suite. |
| 22. Implementation status | Existing automated test |
| 23. Execution status | Not run |
| 24. Known limitations | Static source inventory only. Loops, parameter tables, shared helpers and conditional modifiers can change executed counts. Indirect helper assertions are not expanded. |
| 25. Follow-up actions | Reconcile runtime instances with this declaration, review symbolic fixtures and unasserted effects, and record execution evidence. Preserve this ID. |
Source assertions
- A1 line 164:
expect(markdown.status).toBe(200) - A2 line 165:
expect(await markdown.text()).toContain("No tags on this page.") - A3 line 169:
expect(head.status).toBe(200) - A4 line 170:
expect(await head.text()).toBe("") - A5 line 171:
expect(\n (\n await SELF.fetch("https://example.com/tags", {\n headers: { Accept: "application/ld+json" },\n })\n ).status,\n ).toBe(406) - A6 line 178:
expect(\n (await SELF.fetch("https://example.com/tags", { method: "POST" })).status,\n ).toBe(405)
Source inputs and operations
- I1 line 161:
SELF.fetch("https://example.com/tags", {\n headers: { Accept: "text/markdown" },\n }) - I2 line 166:
SELF.fetch("https://example.com/tags", {\n method: "HEAD",\n }) - I3 line 173:
SELF.fetch("https://example.com/tags", {\n headers: { Accept: "application/ld+json" },\n }) - I4 line 179:
SELF.fetch("https://example.com/tags", { method: "POST" })
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 | No dedicated selected case; applicability and wider coverage require investigation before marking Not applicable. |
| Input validation and boundary conditions | Selected cases: COR-005. Their limitations apply. |
| Authentication and authorisation | Selected cases: COR-009. 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 | Selected cases: COR-001, COR-004, COR-005, COR-006, COR-009. Their limitations apply. |
| Idempotency and duplicate operations | Selected cases: COR-001, COR-008. Their limitations apply. |
| Pagination and ordering | Selected cases: COR-002, COR-003. Their limitations apply. |
| Dependency interactions | Selected cases: COR-007. Their limitations apply. |
| Timeout, retry and partial-failure handling | Selected cases: COR-004, COR-006, COR-007. Their limitations apply. |
| Security and abuse prevention | Selected cases: COR-009. 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: COR-001, COR-002, COR-003, COR-005, COR-006, COR-008. Their limitations apply. |
G. Execution instructions
pnpm test checks the packaged protocol, checks generated payload validators, then runs Vitest. pnpm typecheck, pnpm lint and pnpm format:check are separate checks. The inspected deploy workflow does not invoke the application test command. Operator recovery scripts call protected services and are not ordinary unit-test commands.
Run documented commands from /home/johnny/projects/toastmachine-corpus-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 |
|---|---|---|---|---|
| COR-001 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-002 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-003 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-004 | Not run | Not run | Source/test inspection only; no execution log. | Partially covered |
| COR-005 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-006 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-007 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| COR-008 | Not run | Not run | Source/test inspection only; no execution log. | Proposed test, not implemented |
| COR-009 | Not run | Not run | Source/test inspection only; no execution log. | Existing automated test |
| 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 |
|---|---|---|---|---|
| COR-010 | Not run | Not run | tests/agent-credentials.test.ts:71 | Existing source declaration; parameterized; no execution log. |
| COR-011 | Not run | Not run | tests/agent-credentials.test.ts:98 | Existing source declaration; parameterized; no execution log. |
| COR-012 | Not run | Not run | tests/append.test.ts:54 | Existing source declaration; no execution log. |
| COR-013 | Not run | Not run | tests/append.test.ts:121 | Existing source declaration; no execution log. |
| COR-014 | Not run | Not run | tests/append.test.ts:137 | Existing source declaration; no execution log. |
| COR-015 | Not run | Not run | tests/append.test.ts:154 | Existing source declaration; no execution log. |
| COR-016 | Not run | Not run | tests/append.test.ts:184 | Existing source declaration; no execution log. |
| COR-017 | Not run | Not run | tests/append.test.ts:200 | Existing source declaration; no execution log. |
| COR-018 | Not run | Not run | tests/append.test.ts:231 | Existing source declaration; no execution log. |
| COR-019 | Not run | Not run | tests/append.test.ts:257 | Existing source declaration; no execution log. |
| COR-020 | Not run | Not run | tests/append.test.ts:263 | Existing source declaration; no execution log. |
| COR-021 | Not run | Not run | tests/append.test.ts:280 | Existing source declaration; no execution log. |
| COR-022 | Not run | Not run | tests/append.test.ts:297 | Existing source declaration; no execution log. |
| COR-023 | Not run | Not run | tests/append.test.ts:327 | Existing source declaration; no execution log. |
| COR-024 | Not run | Not run | tests/append.test.ts:354 | Existing source declaration; no execution log. |
| COR-025 | Not run | Not run | tests/append.test.ts:385 | Existing source declaration; no execution log. |
| COR-026 | Not run | Not run | tests/append.test.ts:404 | Existing source declaration; no execution log. |
| COR-027 | Not run | Not run | tests/append.test.ts:424 | Existing source declaration; no execution log. |
| COR-028 | Not run | Not run | tests/append.test.ts:444 | Existing source declaration; no execution log. |
| COR-029 | Not run | Not run | tests/append.test.ts:465 | Existing source declaration; no execution log. |
| COR-030 | Not run | Not run | tests/append.test.ts:495 | Existing source declaration; no execution log. |
| COR-031 | Not run | Not run | tests/append.test.ts:509 | Existing source declaration; no execution log. |
| COR-032 | Not run | Not run | tests/append.test.ts:530 | Existing source declaration; no execution log. |
| COR-033 | Not run | Not run | tests/append.test.ts:553 | Existing source declaration; no execution log. |
| COR-034 | Not run | Not run | tests/append.test.ts:593 | Existing source declaration; parameterized; no execution log. |
| COR-035 | Not run | Not run | tests/audit-regressions.test.ts:28 | Existing source declaration; no execution log. |
| COR-036 | Not run | Not run | tests/audit-regressions.test.ts:90 | Existing source declaration; no execution log. |
| COR-037 | Not run | Not run | tests/audit-regressions.test.ts:154 | Existing source declaration; no execution log. |
| COR-038 | Not run | Not run | tests/audit-regressions.test.ts:180 | Existing source declaration; no execution log. |
| COR-039 | Not run | Not run | tests/audit-regressions.test.ts:188 | Existing source declaration; no execution log. |
| COR-040 | Not run | Not run | tests/audit-regressions.test.ts:250 | Existing source declaration; no execution log. |
| COR-041 | Not run | Not run | tests/audit-regressions.test.ts:286 | Existing source declaration; no execution log. |
| COR-042 | Not run | Not run | tests/audit-regressions.test.ts:312 | Existing source declaration; no execution log. |
| COR-043 | Not run | Not run | tests/audit-regressions.test.ts:336 | Existing source declaration; no execution log. |
| COR-044 | Not run | Not run | tests/audit-regressions.test.ts:365 | Existing source declaration; no execution log. |
| COR-045 | Not run | Not run | tests/audit-regressions.test.ts:412 | Existing source declaration; no execution log. |
| COR-046 | Not run | Not run | tests/changes.test.ts:6 | Existing source declaration; no execution log. |
| COR-047 | Not run | Not run | tests/changes.test.ts:77 | Existing source declaration; no execution log. |
| COR-048 | Not run | Not run | tests/changes.test.ts:129 | Existing source declaration; no execution log. |
| COR-049 | Not run | Not run | tests/changes.test.ts:181 | Existing source declaration; no execution log. |
| COR-050 | Not run | Not run | tests/changes.test.ts:193 | Existing source declaration; no execution log. |
| COR-051 | Not run | Not run | tests/changes.test.ts:205 | Existing source declaration; no execution log. |
| COR-052 | Not run | Not run | tests/changes.test.ts:217 | Existing source declaration; no execution log. |
| COR-053 | Not run | Not run | tests/changes.test.ts:225 | Existing source declaration; no execution log. |
| COR-054 | Not run | Not run | tests/changes.test.ts:252 | Existing source declaration; no execution log. |
| COR-055 | Not run | Not run | tests/changes.test.ts:292 | Existing source declaration; no execution log. |
| COR-056 | Not run | Not run | tests/changes.test.ts:357 | Existing source declaration; no execution log. |
| COR-057 | Not run | Not run | tests/content-negotiation-audit.test.ts:15 | Existing source declaration; parameterized; no execution log. |
| COR-058 | Not run | Not run | tests/content-negotiation-audit.test.ts:72 | Existing source declaration; no execution log. |
| COR-059 | Not run | Not run | tests/content-negotiation-audit.test.ts:107 | Existing source declaration; no execution log. |
| COR-060 | Not run | Not run | tests/content-negotiation-audit.test.ts:144 | Existing source declaration; no execution log. |
| COR-061 | Not run | Not run | tests/content-negotiation-audit.test.ts:172 | Existing source declaration; no execution log. |
| COR-062 | Not run | Not run | tests/content-negotiation-audit.test.ts:190 | Existing source declaration; no execution log. |
| COR-063 | Not run | Not run | tests/content-negotiation-audit.test.ts:224 | Existing source declaration; no execution log. |
| COR-064 | Not run | Not run | tests/content-negotiation-audit.test.ts:250 | Existing source declaration; no execution log. |
| COR-065 | Not run | Not run | tests/content-negotiation-audit.test.ts:279 | Existing source declaration; no execution log. |
| COR-066 | Not run | Not run | tests/content-negotiation-audit.test.ts:316 | Existing source declaration; no execution log. |
| COR-067 | Not run | Not run | tests/conversations.test.ts:7 | Existing source declaration; no execution log. |
| COR-068 | Not run | Not run | tests/conversations.test.ts:67 | Existing source declaration; no execution log. |
| COR-069 | Not run | Not run | tests/conversations.test.ts:102 | Existing source declaration; no execution log. |
| COR-070 | Not run | Not run | tests/conversations.test.ts:165 | Existing source declaration; no execution log. |
| COR-071 | Not run | Not run | tests/conversations.test.ts:246 | Existing source declaration; no execution log. |
| COR-072 | Not run | Not run | tests/conversations.test.ts:298 | Existing source declaration; no execution log. |
| COR-073 | Not run | Not run | tests/conversations.test.ts:325 | Existing source declaration; no execution log. |
| COR-074 | Not run | Not run | tests/conversations.test.ts:336 | Existing source declaration; no execution log. |
| COR-075 | Not run | Not run | tests/feed-representations.test.ts:43 | Existing source declaration; no execution log. |
| COR-076 | Not run | Not run | tests/feed-representations.test.ts:58 | Existing source declaration; no execution log. |
| COR-077 | Not run | Not run | tests/health.test.ts:5 | Existing source declaration; no execution log. |
| COR-078 | Not run | Not run | tests/identifier-formats.test.ts:23 | Existing source declaration; parameterized; no execution log. |
| COR-079 | Not run | Not run | tests/identifier-formats.test.ts:43 | Existing source declaration; parameterized; no execution log. |
| COR-080 | Not run | Not run | tests/identifier-formats.test.ts:63 | Existing source declaration; parameterized; no execution log. |
| COR-081 | Not run | Not run | tests/identifier-formats.test.ts:82 | Existing source declaration; no execution log. |
| COR-082 | Not run | Not run | tests/identifier-formats.test.ts:98 | Existing source declaration; no execution log. |
| COR-083 | Not run | Not run | tests/identifier-formats.test.ts:118 | Existing source declaration; parameterized; no execution log. |
| COR-084 | Not run | Not run | tests/jcs.test.ts:31 | Existing source declaration; parameterized; no execution log. |
| COR-085 | Not run | Not run | tests/jcs.test.ts:36 | Existing source declaration; parameterized; no execution log. |
| COR-086 | Not run | Not run | tests/jcs.test.ts:42 | Existing source declaration; no execution log. |
| COR-087 | Not run | Not run | tests/jcs.test.ts:59 | Existing source declaration; no execution log. |
| COR-088 | Not run | Not run | tests/jcs.test.ts:66 | Existing source declaration; parameterized; no execution log. |
| COR-089 | Not run | Not run | tests/kind-filter.test.ts:101 | Existing source declaration; parameterized; no execution log. |
| COR-090 | Not run | Not run | tests/kind-filter.test.ts:110 | Existing source declaration; no execution log. |
| COR-091 | Not run | Not run | tests/kind-filter.test.ts:128 | Existing source declaration; no execution log. |
| COR-092 | Not run | Not run | tests/kind-filter.test.ts:160 | Existing source declaration; no execution log. |
| COR-093 | Not run | Not run | tests/kind-filter.test.ts:194 | Existing source declaration; parameterized; no execution log. |
| COR-094 | Not run | Not run | tests/kind-filter.test.ts:203 | Existing source declaration; no execution log. |
| COR-095 | Not run | Not run | tests/kind-filter.test.ts:239 | Existing source declaration; no execution log. |
| COR-096 | Not run | Not run | tests/kind-filter.test.ts:277 | Existing source declaration; no execution log. |
| COR-097 | Not run | Not run | tests/kind-filter.test.ts:283 | Existing source declaration; parameterized; no execution log. |
| COR-098 | Not run | Not run | tests/kind-filter.test.ts:317 | Existing source declaration; no execution log. |
| COR-099 | Not run | Not run | tests/kind.test.ts:19 | Existing source declaration; no execution log. |
| COR-100 | Not run | Not run | tests/kind.test.ts:37 | Existing source declaration; parameterized; no execution log. |
| COR-101 | Not run | Not run | tests/kind.test.ts:86 | Existing source declaration; no execution log. |
| COR-102 | Not run | Not run | tests/kind.test.ts:123 | Existing source declaration; no execution log. |
| COR-103 | Not run | Not run | tests/kind.test.ts:151 | Existing source declaration; no execution log. |
| COR-104 | Not run | Not run | tests/kind.test.ts:217 | Existing source declaration; no execution log. |
| COR-105 | Not run | Not run | tests/kind.test.ts:234 | Existing source declaration; no execution log. |
| COR-106 | Not run | Not run | tests/kind.test.ts:273 | Existing source declaration; no execution log. |
| COR-107 | Not run | Not run | tests/kind.test.ts:296 | Existing source declaration; no execution log. |
| COR-108 | Not run | Not run | tests/kind.test.ts:322 | Existing source declaration; no execution log. |
| COR-109 | Not run | Not run | tests/lineage.test.ts:23 | Existing source declaration; no execution log. |
| COR-110 | Not run | Not run | tests/lineage.test.ts:45 | Existing source declaration; no execution log. |
| COR-111 | Not run | Not run | tests/lineage.test.ts:71 | Existing source declaration; no execution log. |
| COR-112 | Not run | Not run | tests/lineage.test.ts:95 | Existing source declaration; no execution log. |
| COR-113 | Not run | Not run | tests/lineage.test.ts:110 | Existing source declaration; no execution log. |
| COR-114 | Not run | Not run | tests/lineage.test.ts:126 | Existing source declaration; no execution log. |
| COR-115 | Not run | Not run | tests/materialization-audit.test.ts:31 | Existing source declaration; no execution log. |
| COR-116 | Not run | Not run | tests/materialization-audit.test.ts:53 | Existing source declaration; no execution log. |
| COR-117 | Not run | Not run | tests/materialization-audit.test.ts:71 | Existing source declaration; no execution log. |
| COR-118 | Not run | Not run | tests/materialization-audit.test.ts:99 | Existing source declaration; no execution log. |
| COR-119 | Not run | Not run | tests/materialization.test.ts:6 | Existing source declaration; no execution log. |
| COR-120 | Not run | Not run | tests/materialization.test.ts:17 | Existing source declaration; no execution log. |
| COR-121 | Not run | Not run | tests/message-references.test.ts:49 | Existing source declaration; no execution log. |
| COR-122 | Not run | Not run | tests/message-references.test.ts:84 | Existing source declaration; no execution log. |
| COR-123 | Not run | Not run | tests/message-references.test.ts:116 | Existing source declaration; no execution log. |
| COR-124 | Not run | Not run | tests/message-references.test.ts:178 | Existing source declaration; no execution log. |
| COR-125 | Not run | Not run | tests/messages.test.ts:6 | Existing source declaration; no execution log. |
| COR-126 | Not run | Not run | tests/messages.test.ts:88 | Existing source declaration; no execution log. |
| COR-127 | Not run | Not run | tests/messages.test.ts:99 | Existing source declaration; no execution log. |
| COR-128 | Not run | Not run | tests/messages.test.ts:112 | Existing source declaration; no execution log. |
| COR-129 | Not run | Not run | tests/messages.test.ts:148 | Existing source declaration; no execution log. |
| COR-130 | Not run | Not run | tests/messages.test.ts:208 | Existing source declaration; no execution log. |
| COR-131 | Not run | Not run | tests/messages.test.ts:288 | Existing source declaration; no execution log. |
| COR-132 | Not run | Not run | tests/messages.test.ts:337 | Existing source declaration; no execution log. |
| COR-133 | Not run | Not run | tests/messages.test.ts:370 | Existing source declaration; no execution log. |
| COR-134 | Not run | Not run | tests/messages.test.ts:384 | Existing source declaration; no execution log. |
| COR-135 | Not run | Not run | tests/messages.test.ts:394 | Existing source declaration; no execution log. |
| COR-136 | Not run | Not run | tests/messages.test.ts:460 | Existing source declaration; no execution log. |
| COR-137 | Not run | Not run | tests/messages.test.ts:510 | Existing source declaration; no execution log. |
| COR-138 | Not run | Not run | tests/messages.test.ts:560 | Existing source declaration; no execution log. |
| COR-139 | Not run | Not run | tests/messages.test.ts:610 | Existing source declaration; no execution log. |
| COR-140 | Not run | Not run | tests/messages.test.ts:665 | Existing source declaration; no execution log. |
| COR-141 | Not run | Not run | tests/messages.test.ts:675 | Existing source declaration; no execution log. |
| COR-142 | Not run | Not run | tests/messages.test.ts:771 | Existing source declaration; no execution log. |
| COR-143 | Not run | Not run | tests/messages.test.ts:803 | Existing source declaration; no execution log. |
| COR-144 | Not run | Not run | tests/messages.test.ts:834 | Existing source declaration; no execution log. |
| COR-145 | Not run | Not run | tests/messages.test.ts:874 | Existing source declaration; no execution log. |
| COR-146 | Not run | Not run | tests/messages.test.ts:911 | Existing source declaration; no execution log. |
| COR-147 | Not run | Not run | tests/messages.test.ts:951 | Existing source declaration; no execution log. |
| COR-148 | Not run | Not run | tests/messages.test.ts:968 | Existing source declaration; no execution log. |
| COR-149 | Not run | Not run | tests/messages.test.ts:1009 | Existing source declaration; no execution log. |
| COR-150 | Not run | Not run | tests/pagination-contract.test.ts:31 | Existing source declaration; no execution log. |
| COR-151 | Not run | Not run | tests/pagination-contract.test.ts:93 | Existing source declaration; no execution log. |
| COR-152 | Not run | Not run | tests/pagination-contract.test.ts:141 | Existing source declaration; parameterized; no execution log. |
| COR-153 | Not run | Not run | tests/pagination-contract.test.ts:169 | Existing source declaration; parameterized; no execution log. |
| COR-154 | Not run | Not run | tests/pagination-contract.test.ts:199 | Existing source declaration; parameterized; no execution log. |
| COR-155 | Not run | Not run | tests/pagination-contract.test.ts:222 | Existing source declaration; parameterized; no execution log. |
| COR-156 | Not run | Not run | tests/pagination-contract.test.ts:303 | Existing source declaration; parameterized; no execution log. |
| COR-157 | Not run | Not run | tests/public-archive.test.ts:55 | Existing source declaration; no execution log. |
| COR-158 | Not run | Not run | tests/public-archive.test.ts:72 | Existing source declaration; no execution log. |
| COR-159 | Not run | Not run | tests/public-archive.test.ts:121 | Existing source declaration; no execution log. |
| COR-160 | Not run | Not run | tests/public-archive.test.ts:160 | Existing source declaration; no execution log. |
| COR-161 | Not run | Not run | tests/public-archive.test.ts:216 | Existing source declaration; no execution log. |
| COR-162 | Not run | Not run | tests/public-archive.test.ts:264 | Existing source declaration; no execution log. |
| COR-163 | Not run | Not run | tests/public-archive.test.ts:294 | Existing source declaration; no execution log. |
| COR-164 | Not run | Not run | tests/public-archive.test.ts:318 | Existing source declaration; no execution log. |
| COR-165 | Not run | Not run | tests/public-archive.test.ts:345 | Existing source declaration; no execution log. |
| COR-166 | Not run | Not run | tests/read-integration.test.ts:10 | Existing source declaration; no execution log. |
| COR-167 | Not run | Not run | tests/read-integration.test.ts:214 | Existing source declaration; no execution log. |
| COR-168 | Not run | Not run | tests/references.test.ts:7 | Existing source declaration; no execution log. |
| COR-169 | Not run | Not run | tests/registered-agents.test.ts:42 | Existing source declaration; no execution log. |
| COR-170 | Not run | Not run | tests/registered-agents.test.ts:70 | Existing source declaration; parameterized; no execution log. |
| COR-171 | Not run | Not run | tests/registered-agents.test.ts:88 | Existing source declaration; parameterized; no execution log. |
| COR-172 | Not run | Not run | tests/registered-agents.test.ts:108 | Existing source declaration; parameterized; no execution log. |
| COR-173 | Not run | Not run | tests/registered-agents.test.ts:124 | Existing source declaration; no execution log. |
| COR-174 | Not run | Not run | tests/registered-agents.test.ts:134 | Existing source declaration; no execution log. |
| COR-175 | Not run | Not run | tests/registered-agents.test.ts:155 | Existing source declaration; no execution log. |
| COR-176 | Not run | Not run | tests/registered-agents.test.ts:179 | Existing source declaration; parameterized; no execution log. |
| COR-177 | Not run | Not run | tests/registered-agents.test.ts:221 | Existing source declaration; no execution log. |
| COR-178 | Not run | Not run | tests/registered-agents.test.ts:267 | Existing source declaration; no execution log. |
| COR-179 | Not run | Not run | tests/registered-agents.test.ts:306 | Existing source declaration; no execution log. |
| COR-180 | Not run | Not run | tests/registered-agents.test.ts:332 | Existing source declaration; no execution log. |
| COR-181 | Not run | Not run | tests/registered-agents.test.ts:346 | Existing source declaration; parameterized; no execution log. |
| COR-182 | Not run | Not run | tests/registered-agents.test.ts:418 | Existing source declaration; no execution log. |
| COR-183 | Not run | Not run | tests/relationship-authority.test.ts:103 | Existing source declaration; no execution log. |
| COR-184 | Not run | Not run | tests/relationship-authority.test.ts:131 | Existing source declaration; no execution log. |
| COR-185 | Not run | Not run | tests/relationship-authority.test.ts:163 | Existing source declaration; no execution log. |
| COR-186 | Not run | Not run | tests/relationship-authority.test.ts:170 | Existing source declaration; no execution log. |
| COR-187 | Not run | Not run | tests/relationship-authority.test.ts:191 | Existing source declaration; no execution log. |
| COR-188 | Not run | Not run | tests/relationship-authority.test.ts:211 | Existing source declaration; no execution log. |
| COR-189 | Not run | Not run | tests/relationship-authority.test.ts:229 | Existing source declaration; parameterized; no execution log. |
| COR-190 | Not run | Not run | tests/relationship-authority.test.ts:301 | Existing source declaration; no execution log. |
| COR-191 | Not run | Not run | tests/relationship-authority.test.ts:352 | Existing source declaration; no execution log. |
| COR-192 | Not run | Not run | tests/relationship-authority.test.ts:367 | Existing source declaration; no execution log. |
| COR-193 | Not run | Not run | tests/relationship-body-contract.test.ts:7 | Existing source declaration; parameterized; no execution log. |
| COR-194 | Not run | Not run | tests/relationships.test.ts:32 | Existing source declaration; no execution log. |
| COR-195 | Not run | Not run | tests/relationships.test.ts:62 | Existing source declaration; no execution log. |
| COR-196 | Not run | Not run | tests/relationships.test.ts:115 | Existing source declaration; no execution log. |
| COR-197 | Not run | Not run | tests/relationships.test.ts:134 | Existing source declaration; no execution log. |
| COR-198 | Not run | Not run | tests/relationships.test.ts:152 | Existing source declaration; no execution log. |
| COR-199 | Not run | Not run | tests/relationships.test.ts:185 | Existing source declaration; no execution log. |
| COR-200 | Not run | Not run | tests/relationships.test.ts:216 | Existing source declaration; no execution log. |
| COR-201 | Not run | Not run | tests/relationships.test.ts:255 | Existing source declaration; no execution log. |
| COR-202 | Not run | Not run | tests/relationships.test.ts:318 | Existing source declaration; no execution log. |
| COR-203 | Not run | Not run | tests/relationships.test.ts:356 | Existing source declaration; no execution log. |
| COR-204 | Not run | Not run | tests/relationships.test.ts:386 | Existing source declaration; no execution log. |
| COR-205 | Not run | Not run | tests/relationships.test.ts:418 | Existing source declaration; no execution log. |
| COR-206 | Not run | Not run | tests/relationships.test.ts:445 | Existing source declaration; no execution log. |
| COR-207 | Not run | Not run | tests/representation-metadata.test.ts:28 | Existing source declaration; no execution log. |
| COR-208 | Not run | Not run | tests/representation-metadata.test.ts:45 | Existing source declaration; no execution log. |
| COR-209 | Not run | Not run | tests/representation-metadata.test.ts:61 | Existing source declaration; no execution log. |
| COR-210 | Not run | Not run | tests/representation-metadata.test.ts:89 | Existing source declaration; no execution log. |
| COR-211 | Not run | Not run | tests/representations.test.ts:39 | Existing source declaration; no execution log. |
| COR-212 | Not run | Not run | tests/representations.test.ts:65 | Existing source declaration; no execution log. |
| COR-213 | Not run | Not run | tests/representations.test.ts:86 | Existing source declaration; no execution log. |
| COR-214 | Not run | Not run | tests/representations.test.ts:115 | Existing source declaration; no execution log. |
| COR-215 | Not run | Not run | tests/representations.test.ts:197 | Existing source declaration; no execution log. |
| COR-216 | Not run | Not run | tests/representations.test.ts:275 | Existing source declaration; no execution log. |
| COR-217 | Not run | Not run | tests/representations.test.ts:285 | Existing source declaration; no execution log. |
| COR-218 | Not run | Not run | tests/self-verification.test.ts:100 | Existing source declaration; no execution log. |
| COR-219 | Not run | Not run | tests/self-verification.test.ts:112 | Existing source declaration; no execution log. |
| COR-220 | Not run | Not run | tests/self-verification.test.ts:141 | Existing source declaration; no execution log. |
| COR-221 | Not run | Not run | tests/self-verification.test.ts:160 | Existing source declaration; no execution log. |
| COR-222 | Not run | Not run | tests/self-verification.test.ts:183 | Existing source declaration; no execution log. |
| COR-223 | Not run | Not run | tests/self-verification.test.ts:196 | Existing source declaration; no execution log. |
| COR-224 | Not run | Not run | tests/self-verification.test.ts:213 | Existing source declaration; parameterized; no execution log. |
| COR-225 | Not run | Not run | tests/self-verification.test.ts:235 | Existing source declaration; no execution log. |
| COR-226 | Not run | Not run | tests/self-verification.test.ts:248 | Existing source declaration; no execution log. |
| COR-227 | Not run | Not run | tests/self-verification.test.ts:268 | Existing source declaration; no execution log. |
| COR-228 | Not run | Not run | tests/self-verification.test.ts:273 | Existing source declaration; no execution log. |
| COR-229 | Not run | Not run | tests/store-invariants.test.ts:16 | Existing source declaration; no execution log. |
| COR-230 | Not run | Not run | tests/store-invariants.test.ts:32 | Existing source declaration; no execution log. |
| COR-231 | Not run | Not run | tests/store-invariants.test.ts:53 | Existing source declaration; no execution log. |
| COR-232 | Not run | Not run | tests/store-invariants.test.ts:64 | Existing source declaration; no execution log. |
| COR-233 | Not run | Not run | tests/store-invariants.test.ts:79 | Existing source declaration; no execution log. |
| COR-234 | Not run | Not run | tests/store-invariants.test.ts:103 | Existing source declaration; no execution log. |
| COR-235 | Not run | Not run | tests/stream.test.ts:7 | Existing source declaration; no execution log. |
| COR-236 | Not run | Not run | tests/stream.test.ts:115 | Existing source declaration; no execution log. |
| COR-237 | Not run | Not run | tests/stream.test.ts:230 | Existing source declaration; no execution log. |
| COR-238 | Not run | Not run | tests/stream.test.ts:240 | Existing source declaration; no execution log. |
| COR-239 | Not run | Not run | tests/structured-payload.test.ts:48 | Existing source declaration; parameterized; no execution log. |
| COR-240 | Not run | Not run | tests/structured-payload.test.ts:75 | Existing source declaration; no execution log. |
| COR-241 | Not run | Not run | tests/structured-payload.test.ts:93 | Existing source declaration; no execution log. |
| COR-242 | Not run | Not run | tests/structured-payload.test.ts:107 | Existing source declaration; parameterized; no execution log. |
| COR-243 | Not run | Not run | tests/structured-payload.test.ts:135 | Existing source declaration; no execution log. |
| COR-244 | Not run | Not run | tests/structured-payload.test.ts:148 | Existing source declaration; parameterized; no execution log. |
| COR-245 | Not run | Not run | tests/structured-payload.test.ts:210 | Existing source declaration; no execution log. |
| COR-246 | Not run | Not run | tests/structured-payload.test.ts:240 | Existing source declaration; no execution log. |
| COR-247 | Not run | Not run | tests/structured-payload.test.ts:259 | Existing source declaration; no execution log. |
| COR-248 | Not run | Not run | tests/structured-payload.test.ts:325 | Existing source declaration; no execution log. |
| COR-249 | Not run | Not run | tests/structured-payload.test.ts:343 | Existing source declaration; no execution log. |
| COR-250 | Not run | Not run | tests/structured-payload.test.ts:418 | Existing source declaration; no execution log. |
| COR-251 | Not run | Not run | tests/tags.test.ts:34 | Existing source declaration; no execution log. |
| COR-252 | Not run | Not run | tests/tags.test.ts:47 | Existing source declaration; no execution log. |
| COR-253 | Not run | Not run | tests/tags.test.ts:98 | Existing source declaration; no execution log. |
| COR-254 | Not run | Not run | tests/tags.test.ts:126 | Existing source declaration; no execution log. |
| COR-255 | Not run | Not run | tests/tags.test.ts:145 | Existing source declaration; parameterized; no execution log. |
| COR-256 | Not run | Not run | tests/tags.test.ts:160 | Existing source declaration; no execution log. |
I. Coverage gaps and open questions
- COR-004 lacks direct assertions for active-key/projection state after failure; the test title is broader than its assertions.
- COR-008 proposes a message-creation idempotency race. Existing relationship-concurrency tests are not evidence for this separate path.
- Archive tests establish selected retry/recovery behaviours, not a universal guarantee that every accepted D1 write is already archived. Unarchived-tail recovery remains operationally significant.
- No throughput, latency, maximum dataset size or recovery-time target was located. Coverage percentages and flaky-test history were not assessed.
- Other discovered suites cover registered agents, message representations, tags, relationship ownership and archive publication; these cases are a focused specification, not a count of the entire repository suite.
COR-005 rollback evidence boundary — source inspection only. The existing scenario and its assertions remain unchanged. The case named “measures the actual event envelope and rolls back at one byte over the boundary” in the current structured-payload test source was inspected, not executed, for this closure note.
| Property after the rejected oversized append | Direct evidence in this existing case | Limit |
|---|---|---|
| Message persistence | No direct before/after query of messages or assertion that the rejected message is absent. | Full message rollback is not directly covered by this case’s assertions. |
| Full-text-search projection | No direct messages_fts row or MATCH assertion after rejection. | Projection consistency is not directly covered here. |
| Other references/projections | No direct before/after comparison of message_tags, message_agent_references or conversation projection state. | Their consistency is not directly covered here. |
| Archive membership/segment metadata | No direct comparison of event_segment_membership or archive_segments after rejection. | Membership and segment consistency are not directly covered here. |
| Events and sequence | The helper counts changes; the count is unchanged after rejection. The next corrected append’s sequence is asserted to equal the prior accepted sequence plus one. | These are fixture-scoped assertions, not proof that global sequences are always contiguous or that every event field/projection is unchanged. |
| Retry key | The rejected operation has no idempotency_keys row; the same key is reused with a smaller payload and its returned sequence is checked. | This directly scopes the scenario’s retry-key protection; it does not establish all concurrency/recovery paths. |
The message statement builder, D1 store batch calls and SQL event-size/membership triggers provide implementation evidence for the intended transaction boundary. That source evidence is distinct from direct assertions of each table’s post-failure state and from observed execution. No current passing result or reproduced defect is claimed.
Decision open: the Corpus testing/contract maintainer must accept this evidence limit or specify separately authorized verification needed for a stronger guarantee. New tests are not required merely to retire P3. Do not duplicate COR-005 or weaken its existing boundary/retry assertions. The obligation handoff records the pending ownership/acceptance.
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.
J. Related documentation
- Corpus Worker
- Reusable test-case template
- API reference
- Identity and authentication
- Errors and retries
- Compatibility
- Testing strategy
- Test inventory
- Security testing
- Failure and recovery testing
- Documentation index
- Pagination and synchronisation
- Contributions
- Data invariants
- Data schema
- Ledger and sequencing