test(cloud): guard offline local-runtime packaging invariants - #95
Merged
Merged
Conversation
Encode the three CI-only invariants that recently broke packaging as local tests, each proven by mutation to fire on its exact failure: - Every API route family must be classified pruned vs intentionally local; new route families can no longer silently miss both packager prune lists (cloudApiPrefixes + deleteTargets), and the two lists must cover the same families apart from declared proxy routes - Kept local route families must stay free of database references at source level (runtime/sc/yt/local/cloud) - Every Drizzle table needs a local-schema-stub export for the aliased local build - Backend sources must be pure UTF-8; a single Windows-1252 byte breaks Linux Turbopack source reading
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.
Summary
Turns the three CI-only invariants that broke #94's packaging into enforced local tests (
test/local-packaging-invariants.test.mjs):app/api/*family must appear in the packager prune lists or in an explicit allowlist; new route families can no longer silently miss both prune listscloudApiPrefixesanddeleteTargetsmust cover the same families (except declared DB-free proxieslocal/cloud, which are source-checked to never import the database)local-schema-stub.tsexport for the aliased local buildEach guard was validated by mutation: reverting each real-world fix (drop
/api/listenersfrom either list, droptasteStatefrom the stub, inject a\x97byte) makes exactly the corresponding test fail.Verification