mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-13 15:55:46 +01:00
## Thinking Path > - Paperclip manages AI agents and their work. > - The board uses Better Auth for credential accounts and sessions. > - The server pins Better Auth 1.7.2. > - The November security release fixes 12 issues in Better Auth. > - The new version stops writing the old required account issuer field. > - This change updates the packages and the database contract together. > - New users can sign up, and existing users can still sign in. ## Linked Issues or Issue Description **What happened?** The server uses Better Auth 1.7.2. The [security release](https://better-auth.com/blog/security-release-2026-11-03) fixes 12 issues in 1.7.16. Earlier update PRs #17909 and #17911 target 1.7.7, which is below this security release. **Expected behavior** Use the patched stable release. Keep new and existing credential accounts usable. **Steps to reproduce** Read the server dependency pin. Upgrade it without a schema change. Better Auth then rejects the required account issuer column. See the [upgrade guide](https://better-auth.com/docs/guides/1-7-upgrade-guide). ## What Changed - Pin Better Auth to 1.7.16. The repository refresh bot owns the committed Core lockfile. - Make the old issuer column nullable. Keep existing issuer values. - Replace the issuer index with a unique provider/account index. - Generate the migration and retain the five newest schema snapshots. - Test new signup, new-account sign-in, legacy issuer sign-in, duplicate rejection, and separate provider identities with real PostgreSQL. - Update the database schema test. Test the historical issuer backfill separately. Verify upgrades over existing rows and rollback on duplicate provider/account keys. - Document the duplicate check and migration order. - Add the approved two-line dependency resolution step before the backup job’s frozen install. Leave the frozen check and backup tests intact. ## Verification - Core head: `af70282c7e24335b8688c8f3cc88fdf65045632c`; parent `0f1481e4462100357a7caa496b875cf0bc500d95` includes master `84fc67317`. - Nine changed files. The only workflow edit is the approved two-line backup dependency resolution step; no managed lockfile edits. - Migration `0465_better_auth_account_identity.sql` is three SQL statements; snapshot changes only `public.account`, five newest snapshots retained. - DB typecheck and 23 focused tests passed on the parent. Both real PostgreSQL migration/signup suites were rerun November 11: all 4 tests passed. Application source and tests are unchanged in this workflow-only commit. - The parent’s sandbox-provider lane passed all 205 file-sync tests but reported an unhandled EPIPE during the symlink rejection case; its aggregate verify therefore failed. No unrelated source change was made. The new head reruns the full applicable CI. - Reproduced the old backup install failure locally. Resolving manifests followed by a frozen install passed locally; restored the bot-owned committed lock afterward. Hosted backup qualification remains required. - Current-head CI and review are running; no final-head green claim or merge yet. ## Risks Apply the migration before the new server starts. Check for duplicate provider/account pairs first. Duplicate rows stop index creation. Keep separate users separate when resolving duplicates. The migration keeps issuer data. Do not restore its NOT NULL constraint while new rows contain null. No deployment is included. ## Model Used OpenAI GPT-6 Codex, with reasoning and tool use. The runtime did not expose a more specific model ID or context window. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
84 lines
3.8 KiB
YAML
84 lines
3.8 KiB
YAML
name: Backup checkpoint qualification
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'packages/db/**'
|
|
- 'server/src/services/*backup*'
|
|
- 'server/src/lib/dedicated-test-database-url.ts'
|
|
- 'server/src/__tests__/*backup*'
|
|
- 'server/src/__tests__/fixtures/database-backup-worker.ts'
|
|
- 'server/src/index.ts'
|
|
- 'server/scripts/*backup*'
|
|
- 'server/scripts/lib/backup-qualification.ts'
|
|
- 'server/vitest.backup-qualification.config.ts'
|
|
- '.github/workflows/backup-checkpoint-qualification.yml'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
push:
|
|
branches: [master]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
backup-checkpoint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
env:
|
|
POSTGRES_USER: paperclip
|
|
POSTGRES_PASSWORD: backup-qualification-fixture
|
|
POSTGRES_DB: backup_source_test
|
|
ports: ['5432:5432']
|
|
options: >-
|
|
--health-cmd "pg_isready -U paperclip -d backup_source_test"
|
|
--health-interval 5s --health-timeout 5s --health-retries 12
|
|
env:
|
|
PAPERCLIP_BACKUP_CHECKPOINT_SOURCE_TEST_DATABASE_URL: postgres://paperclip:backup-qualification-fixture@127.0.0.1:5432/backup_source_test
|
|
PAPERCLIP_BACKUP_CHECKPOINT_RESTORE_TEST_DATABASE_URL: postgres://paperclip:backup-qualification-fixture@127.0.0.1:5432/backup_restore_test
|
|
PAPERCLIP_BACKUP_QUALIFICATION_RECEIPT: ${{ github.workspace }}/backup-checkpoint-evidence/qualification.json
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86
|
|
with:
|
|
version: 9.15.4
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
|
|
with:
|
|
node-version: '24'
|
|
cache: pnpm
|
|
- name: Resolve dependency manifests for this run
|
|
run: pnpm install --resolution-only --ignore-scripts --no-frozen-lockfile
|
|
- run: pnpm install --frozen-lockfile --ignore-scripts
|
|
- name: Build workspace import prerequisites
|
|
run: |
|
|
pnpm --filter @paperclipai/shared build
|
|
pnpm --filter @paperclipai/db build
|
|
pnpm --filter @paperclipai/plugin-sdk ensure-build-deps
|
|
- name: Use the service image's matching real PostgreSQL clients
|
|
env:
|
|
PG_CONTAINER: ${{ job.services.postgres.id }}
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/backup-clients" backup-checkpoint-evidence
|
|
for binary in pg_dump psql; do
|
|
printf '#!/bin/sh\nexec docker exec --interactive %s %s "$@"\n' "$PG_CONTAINER" "$binary" > "$RUNNER_TEMP/backup-clients/$binary"
|
|
chmod 700 "$RUNNER_TEMP/backup-clients/$binary"
|
|
done
|
|
echo "PAPERCLIP_PG_DUMP_PATH=$RUNNER_TEMP/backup-clients/pg_dump" >> "$GITHUB_ENV"
|
|
echo "PAPERCLIP_PSQL_PATH=$RUNNER_TEMP/backup-clients/psql" >> "$GITHUB_ENV"
|
|
"$RUNNER_TEMP/backup-clients/pg_dump" --version
|
|
"$RUNNER_TEMP/backup-clients/psql" --version
|
|
"$RUNNER_TEMP/backup-clients/psql" "$PAPERCLIP_BACKUP_CHECKPOINT_SOURCE_TEST_DATABASE_URL" --set=ON_ERROR_STOP=1 -c 'CREATE DATABASE backup_restore_test'
|
|
- name: Migrate only the owned source fixture
|
|
env:
|
|
DATABASE_URL: ${{ env.PAPERCLIP_BACKUP_CHECKPOINT_SOURCE_TEST_DATABASE_URL }}
|
|
run: pnpm --filter @paperclipai/db exec tsx src/migrate.ts
|
|
- name: Run required real checkpoint and restore proof
|
|
run: pnpm --filter @paperclipai/server exec vitest run --config vitest.backup-qualification.config.ts
|
|
- name: Attach qualification receipt
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
name: backup-checkpoint-evidence
|
|
path: backup-checkpoint-evidence/
|
|
if-no-files-found: warn
|