~ knotless Search/
↑↓ move↵ open⇧↵ all results

zat.dev/zds

atproto pds · mirror of https://tangled.org/zat.dev/zds

0
0
145 lines · 8.6 KB Raw History

Migration verification — 2026-10-15

History: the October 2026 investigation of inbound account migration (issue #8), as of v0.5.1. Its follow-ups and reference comparisons have not been rechecked since.

Issue #8 exposed an account-state regression introduced by cb16858: importRepo, uploadBlob, and listMissingBlobs required activation even though data transfer precedes activation. They now accept active and deactivated accounts while rejecting taken-down, suspended, and deleted accounts.

The adjacent audit found two more blockers:

  • Sync exports rejected even the authenticated owner of a deactivated repo. Owner access now works for getRepo, getBlob, getRecord, listBlobs, and getLatestCommit. Anonymous and other-account requests remain denied.
  • A newly created inbound account had no repo root, making checkAccountStatus fail with RepoNotFound before import. Inbound creation now initializes a signed empty repo without publication. Status checks repair roots missing from older migration attempts. Initialization is serialized with imports and leaves an existing root untouched.

Normal record writes still require activation. Login, session refresh, recommended DID credentials, and handle updates were also inspected; the active-only OAuth login policy remains intentional during inbound migration. Admin takedown still revokes sessions. No schema or protocol primitive changed; these are local account-lifecycle policies using existing Zat signing and repo verification.

Evidence

tools/smoke-migration.py runs in the public HTTP suite against the real local server and SQLite store. It exercises inactive uploads and missing-blob reads, malformed and foreign-DID imports, owner/anonymous/other-account sync access, blocked normal writes, all restricted account states, and admin session revocation. A storage test verifies the empty CAR's signature and completeness, absence of events, and preservation of existing data on reinitialization.

The live probe created a disposable account on https://pds.zat.dev, wrote a record referencing a blob, obtained service auth, and created the same DID on the local candidate. DID did:plc:pu5if5gmobq35nerxvru24ph passed:

  • inactive destination login and status before import;
  • rejection of a CAR signed by the destination key while PLC still advertised the source key;
  • verified source CAR import and repeat import, without sync events;
  • missing-blob discovery, upload, and an empty missing-blob list afterward;
  • rejection of a truncated CAR and normal writes while inactive;
  • owner-only export, activation, and exact record CID/value and blob-byte reads.

Both accounts were deactivated afterward. The probe deliberately leaves the DID document on the source PDS; it does not test PLC identity cutover or a browser migration client.

Repeat with a running candidate and a source that permits disposable accounts:

set -a
. ./.env
set +a
just bench migration https://pds.zat.dev http://127.0.0.1:2595 /path/to/target.sqlite3

ZDS_ADMIN_TOKEN mints the source invite; ZDS_TARGET_ADMIN_TOKEN is needed if the target also requires invites. The script generates credentials in memory and prints only operation results and timings. Passing the same source and target exercises deactivated re-imports for post-deploy verification.

The live probe measured successful imports at 1.48–1.75 seconds, including public PLC resolution; local status and missing-blob requests took 1–3 ms. just bench metastore 10 100 measured 2,726 writes/s (p95 10.6 ms), 25,370 record reads/s, and 13,181 record-list reads/s. These are diagnostic local runs under concurrent compilation, not controlled cross-implementation comparisons.

Reference checks and remaining differences

The account migration guide requires data transfer before activation. The official PDS handlers permit that flow, and its sync availability check permits owner exports. The cached official PDS at 5fbc9a007 passed both account-migration.test.ts and account-deactivation.test.ts: 9 tests in 12.7 seconds.

Tranquil at 7098e8f uses Auth<NotTakendown> for imports and missing-blob reads; uploads explicitly reject takedown while permitting deactivation. Its test_import_deactivated_account_allowed_for_migration passed against a real local PostgreSQL container (1 test, 53.7 seconds including startup). That harness sets SKIP_IMPORT_VERIFICATION=true, so this confirms account-state parity only; ZDS signature verification was exercised separately by the live probe.

Explicit follow-ups outside this account-state fix:

  • ZDS still requires complete, correctly signed CARs matching the session DID. Incremental CAR import from the migration guide is not implemented. Tranquil skips signature verification for inbound migrations; ZDS intentionally keeps its stricter verification.
  • checkAccountStatus.validDid still mirrors activation instead of resolving and comparing the DID document. A separate identity-validation change should address that field and activation checks.
  • The import and service-auth resolvers still use the default PLC directory; configured-directory parity needs a separate resolver audit.
  • Unlike the official PDS, ZDS continues to reject taken-down owner sync reads and has no admin override on those routes. This release preserves existing takedown policy rather than broadening it as part of a migration fix.

Comparison rechecked — 2026-10-16

Issue #8 specifically identifies the active-account guard on importRepo. That is a ZDS-owned compatibility bug: the documented migration sequence and both implementations permit data transfer into the inactive destination. The migration guide describes evolving mechanisms, not a formal protocol requirement for every detail. This fix does not establish full migration parity.

Source was rechecked at reference PDS 5816c4fefe896422c59f3de9f0602528c64bea82 and Tranquil 7098e8f5a999e74b37d4c592c065ec8bbe200bf4. These are source comparisons; the upstream test runs above used the earlier recorded revisions.

BehaviorReference PDSTranquilZDS v0.5.1
Inactive destination import/upload/missing-blob readsAllowedAllowedAllowed; fixed
Owner export from deactivated accountAllowedCurrent getRepo/getBlob handlers use public access and reject itAllowed; follows reference PDS
Import signature against current DID keyImport passes no signing key to verificationSkipped for inactive inbound migration; structure checkedRequired; compatibility difference
Incremental importCombines incoming blocks with stored repoNot established by this recheckComplete CAR required
Taken-down owner sync accessAllowed, also admin overridePublic handlers rejectRejected

Pinned evidence:

Keeping signature checks in this patch preserved ZDS policy; it does not prove the policy is correct for every recovery flow. Checking a historical CAR against only the current DID key can reject imports after key rotation. Evaluate that separately against authenticated import ownership and recovery requirements. The validDid and resolver differences listed above also remain unresolved.

The post-deployment production probe passed with disposable DID did:plc:xefa5wyovau42irbql2txywf, which was deactivated afterward. Neither that probe nor the earlier source-to-candidate test exercised PDS MOOver in a browser, a reference-PDS/Tranquil-to-ZDS migration, or PLC identity cutover. The supported closure claim is that the reported inactive-import blocker is fixed and exercised, not that all migration clients and recovery paths work.