Repository navigation
test(site): prove GuestbookStore with a fake and a real D1 under one suite - #95
Open
systemfsoftware-maker wants to merge 1 commit into
Open
systemfsoftware-maker wants to merge 1 commit into
systemfsoftware-maker wants to merge 1 commit into
Conversation
…suite GuestbookStore was a port with a D1 adapter and no contract. It now ships its in-memory fake beside the service (guestbook-store.memory.ts, a Ref that mirrors the adapter's ids, filters, cap and compare-and-set) and one law suite, tests/features/guestbook/guestbook-store.integration.test.ts, that runs the same fixed histories against the fake and a real local D1 (Miniflare, migrated from the repo's own migrations/*.sql per build): read-after-write, stable repeated reads, commuting different-id writes, newest-first latest that hides Hidden and caps at twenty, stale move refused with the state unchanged, unknown id refused, and a non-enum stored state read back verbatim. Expected values come from each history, never from an adapter. Sabotage: LATEST_ENTRIES 19 fails the D1 cap law; a broken fake compare-and-set fails the fake's stale-move law. miniflare is pinned at the version the lockfile already resolved. Judgment surfaces: apps/site/tsconfig.json includes tests; apps/site/ package.json gains a #guestbook/* import map and two devDependencies. Owner-directed (CONST-W3 declaration). Follows the boundary-testing pack.
systemfsoftware-maker
added this pull request to stack #100
October 16, 2026 04:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GuestbookStore was a port with a D1 adapter and no contract. It now ships
its in-memory fake beside the service (guestbook-store.memory.ts, a Ref
that mirrors the adapter's ids, filters, cap and compare-and-set) and one
law suite, tests/features/guestbook/guestbook-store.integration.test.ts,
that runs the same fixed histories against the fake and a real local D1
(Miniflare, migrated from the repo's own migrations/*.sql per build):
read-after-write, stable repeated reads, commuting different-id writes,
newest-first latest that hides Hidden and caps at twenty, stale move
refused with the state unchanged, unknown id refused, and a non-enum
stored state read back verbatim. Expected values come from each history,
never from an adapter. Sabotage: LATEST_ENTRIES 19 fails the D1 cap law;
a broken fake compare-and-set fails the fake's stale-move law.
miniflare is pinned at the version the lockfile already resolved.
Judgment surfaces: apps/site/tsconfig.json includes tests; apps/site/
package.json gains a #guestbook/* import map and two devDependencies.
Owner-directed (CONST-W3 declaration). Follows the boundary-testing pack.
Verification
Gates exit 0; site test 21. Sabotage: LATEST_ENTRIES=19 fails the D1 cap law; broken fake compare-and-set fails the fake's stale-move law.
Layer of stack #100 (trunk
main), merge bottom-up.