Skip to content

test(self-host): verify packaged data safety - #1734

Open
myartings wants to merge 1 commit into
slopus:mainfrom
myartings:feature/self-host-data-safety-upstream
Open

test(self-host): verify packaged data safety#1734
myartings wants to merge 1 commit into
slopus:mainfrom
myartings:feature/self-host-data-safety-upstream

Conversation

@myartings

Copy link
Copy Markdown

Summary

  • Replace the Linux global-install smoke with a repeatable packaged self-host data-safety acceptance test using fresh task-local npm prefixes and HAPPY_HOME_DIR values.
  • Verify packaged static/health endpoints, real Prisma/PGlite reads and writes, restart persistence, local attachment hashes, stopped full-home snapshot recovery, and deterministic migration upgrades.
  • Run product processes in a loopback-only Linux namespace with a syscall guard, and prove the CLI fails closed when its configured self-host server is unavailable.
  • Document the supported stopped-service HAPPY_HOME_DIR snapshot and staged restore workflow.

Safety boundaries

  • The proof and recovery command example are Linux Native only; this PR does not claim macOS or Windows validation.
  • No product runtime, database schema, Happy App UI, daemon lifecycle, release, or remote-deployment behavior changes.
  • Packed artifacts install only under test-owned temporary prefixes. The proof checks that real Happy settings, the global npm root, existing daemons, host ports, and task processes are unchanged after both runs.
  • Bun is pinned to 1.2.22 in Linux CI.

Verification

  • HAPPY_DATA_SAFETY_BASELINE_REF=upstream/main PATH=<task-local-bun>/node_modules/.bin:$PATH pnpm --filter happy-server-self-host test:data-safety
    • 5/5 focused tests passed.
    • Two consecutive fresh packaged runs passed.
    • PGlite migration ledger upgraded 37 -> 38 -> 38 while preserving Account/Session/SessionMessage relationships.
    • Both product egress logs were empty; direct-IP and official-host DNS positive controls were detected and rejected.
    • The configured stopped self-host CLI exited 1 with a clear local failure and no official API access.
  • pnpm --filter happy-server typecheck
  • pnpm --filter happy-server test — 15 files, 107 tests passed.
  • pnpm --filter happy test — build/typecheck plus 87 files, 819 tests passed.
  • Workflow YAML parse, README Bash syntax checks, and git diff --check passed.

Latest clean-worktree package hashes:

  • @slopus/happy-wire: 5257442b0b9844cd7eb8a0e23d56863d62d150874e4dc3afcf9df7eb53ec6f97
  • happy CLI: 7351dd46cfab641d32026b04b69626d54ca0c5792629e505dc43a320de3f65d8
  • happy-server-self-host: 1b6d0d6f7f5ed0c41817aeb51281eb7392f1d2dc3222e13975778c52aad568b6

@myartings
myartings marked this pull request as ready for review August 30, 2026 06:41
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