Repository navigation
test(store): a Linux multi-process harness in CI, and per-process throttle/cache docs (#927) - #946
Merged
Merged
Conversation
…ottle/cache docs (#927) test/multiprocess.integration.ts starts three `urlcode serve` processes from the built CLI on one site whose host.mjs composes audit, auth and store over one data directory. Across the processes it races Idempotency-Key, a transition, 240 transfers and overlapping intervals over HTTP. It then checks that one drainer delivered every audit event exactly once, and that a sign-in burst beside signed-in reads never answers a false 401 and stays inside the shared limit. Finally it SIGKILLs the audit drain holder mid-load: a survivor takes the lease over, a replacement starts, and afterwards PRAGMA integrity_check and every invariant hold. It runs in about 15 seconds locally. CI runs it in a new Linux/Node 24 `multiprocess` job in every full-lane run. verify-complete requires the job except in the docs lane, and the ci-plan and ci-workflow tests cover it. Docs: - CAPACITY, the throttle and cache policy pages and OBSERVABILITY: throttle budgets, origin caches and metrics are per process under multi-process serving. - STORE: what the harness proves and what it does not. - STORE and the auth and audit READMEs: only the store's lease detects a second host; auth also skips the network-filesystem check (#941). Package budgets: core unpacked +3 KiB and packed +1 KiB (the package.json script); auth +3 KiB packed and +1 KiB unpacked (its README). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… in commit order (#927) Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 18:24
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
--local-review and hermetic runs compose: the store-credits recipe seeds its issuer from tests/seed.json instead of adding it to the live database, and the recipe tests assert nothing reaches the configured database. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #927
This is the last of the #927 plan. #934 (auth pragmas and the shared sign-in limit) and #936 (the declaration fence, the network-filesystem refusal, the host lease and the single audit drainer) landed earlier.
Harness
test/multiprocess.integration.ts(npm run test:multiprocess) starts three realurlcode serveprocesses from the built CLI, on distinct loopback ports. They serve one site whosehost.mjscomposes audit, auth and store from this checkout, and share onedata/directory:store.sqlite,auth.sqliteandaudit.sqlite. Every collection isaudit: truebehindauth: true. All data is synthetic, and the secret is generated per run.It asserts:
Idempotency-Keysent 12 times: exactly one create runs and the others replay it.503 storage_unavailablethat wrote nothing.audit.sqliteholds one event per committed change: created records, 2 per transfer (counted by retained idempotency claims) and claimed tickets.atnever goes backwards in stored order.200,429or503; reads only200or503. There is never a 401.SIGKILLmid-load: the drain-lease holder is killed while all three write.PRAGMA integrity_checkreturnsokon all three databases, and the sum, non-overlap and exactly-once/order checks all hold.The declaration fence across real processes ("a stale declaration gets 503") stays proved in
packages/store/test/multiprocess.test.ts.CI
multiprocessjob runs on ubuntu-latest with Node 24, in every full-lane run, including extension-only ones.verify-completerequires it except in the docs lane (scripts/ci-plan.tsgate).test/ci-plan.test.tsandtest/ci-workflow.test.tscover it.npm run verify:workspacesalso runs the harness.docs/CI.mddocuments the job.Docs
CAPACITY.mdhas a new "Several serving processes on one host" section: throttle quotas are per process, so up to N× across N processes; each process keeps its own origin cache and metrics; Better Auth's sign-in limit is the one shared counter; and more processes add no store write throughput.policies/throttle.mdandpolicies/cache.mdOBSERVABILITY.md: scrape each process's port, not the proxy.STORE.md:STORE.md, "Only the store detects another host", and the audit and auth READMEs now document it.RUNTIME-IMPLEMENTATION.md: theRIM-STORE-PERSIST-001evidence column lists the harness.Package budgets
test:multiprocessscript, core measures 1014165 packed / 4011284 unpacked bytes on Node 26, leaving about 2.8 KiB of headroom on each after Node 24's roughly 800 extra packed bytes. The comment inscripts/package-audit.tsrecords this.Evidence and limits
npm run verifyandnpm run test:packagepass.🤖 Generated with Claude Code