Skip to content

test(cloud): guard offline local-runtime packaging invariants - #95

Merged
OttoApocalypse69 merged 1 commit into
mainfrom
TeRiRi/local-runtime-invariant-tests
Aug 25, 2026
Merged

test(cloud): guard offline local-runtime packaging invariants#95
OttoApocalypse69 merged 1 commit into
mainfrom
TeRiRi/local-runtime-invariant-tests

Conversation

@OttoApocalypse69

Copy link
Copy Markdown
Member

Summary

Turns the three CI-only invariants that broke #94's packaging into enforced local tests (test/local-packaging-invariants.test.mjs):

  1. Route-family classification — every 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 lists
  2. List parity + proxy safetycloudApiPrefixes and deleteTargets must cover the same families (except declared DB-free proxies local/cloud, which are source-checked to never import the database)
  3. Schema ↔ stub parity — every Drizzle table needs a local-schema-stub.ts export for the aliased local build
  4. Pure UTF-8 sources — a single Windows-1252 byte breaks Linux Turbopack source reading

Each guard was validated by mutation: reverting each real-world fix (drop /api/listeners from either list, drop tasteState from the stub, inject a \x97 byte) makes exactly the corresponding test fail.

Verification

  • New suite: 5/5 green · full backend suite 413 passed / 0 failed · typecheck ✅ · desktop suite 104/0
  • Mutation checks: all four injected regressions caught

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
@OttoApocalypse69
OttoApocalypse69 merged commit 58489ff into main Aug 25, 2026
12 checks passed
@OttoApocalypse69
OttoApocalypse69 deleted the TeRiRi/local-runtime-invariant-tests branch August 25, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant