Skip to content

spike(sync): native packaged Keychain lifecycle probe and offline trust foundation - #225

Draft
daniele21 wants to merge 24 commits into
devfrom
feature/google-drive-secure-sync-foundation
Draft

daniele21 wants to merge 24 commits into
devfrom
feature/google-drive-secure-sync-foundation

Conversation

@daniele21

@daniele21 daniele21 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Scope — offline privacy-first SYNC-2

Draft workstream for optional future encrypted transcript/notes sync. No cloud transport, OAuth, upload, recording/audio/screenshots, production sync UI, migration, or remote fallback. User meeting data and installed app remain untouched.

Implemented

  • AES-256-GCM authenticated transcript/notes-only snapshot, Ed25519-signed manifest/contiguous checkpoint, tamper/fork/replay tests.
  • Independent random 256-bit recovery-code capsule; X25519 expiring read-only grant requiring independent owner pin, explicit owner consent and future manual two-screen comparison.
  • Experimental SQLite signed owner ledger with Keychain high-water anchor, serialized writes, consumed enrollment nonces, revocation with independent future-epoch key, and fail-closed, owner-confirmed, exact prepared-transition forward repair after a split commit.
  • New exact frozen-bundle Security.framework probe backend: NativeVaultProbeBackend uses a distinct allowlisted synthetic-only com.closedroom.app.secure-sync-vault-probe.v1 service, locally restricted device-only/unlocked-login Keychain attributes, native item create/update/readback/delete and strict account/size validation. An additional packaged binary diagnostic tests updating a synthetic 256-bit secret, clearing a prepared-intent record and proving the updated key from a second invocation of the same signed binary. The established scripts/probe_packaged_keychain.py --build now runs BOTH packaged diagnostics and verifies bounded JSON. This does not yet connect the experimental vault identity to production persistence or the app GUI.

Exact evidence

  • Source 4da41fcc667addf41cc5638a02119aea75402925: Mac self-hosted #44772706674 local-ci/mac=success: 992 app unit tests PASS (5 new native-backend tests), 57 synthetic crypto/security tests PASS, browser FULL_MEDIA PASS. Hosted engineering baseline/governance PASS.
  • Operator packaged GUI attempt on prior cc9d6e97 failed at the new native-vault diagnostic after successful artifact finalization. The wrapper hid the underlying OSStatus; do not classify this as macOS session failure. Apple documents kSecUseDataProtectionKeychain=true as required for kSecAttrAccessibleWhenUnlockedThisDeviceOnly on macOS, and the native vault probe omitted this qualifier.
  • Fix e90e952707867ddb376ac54e2819dbbaa7fbb712: consistently select Data Protection Keychain for all synthetic native CRUD using ThisDeviceOnly, without legacy/iCloud fallback; strengthen partial-write cleanup and bounded operation/OSStatus errors. Mac self-hosted #44783958239 PASS: 995 app tests (3 new), 57 isolated security tests, browser FULL_MEDIA, exact SHA local-ci/mac=success. New GUI packaged qualification is still pending; automated PASS is not proof of actual Data Protection Keychain access.
  • An older ad-hoc signed frozen-binary GUI Keychain basic probe passed by operator on exact b8dfea64; it does not qualify the new native update/clear path.
  • The background CI explicitly reports KEYCHAIN_REAL_ENVIRONMENT=NOT_RUN; macOS user-login Keychain access cannot be inferred from the runner's deterministic test PASS.

Remaining real gates and product work

  • Re-run the corrected python3 scripts/probe_packaged_keychain.py --build from a logged-in macOS GUI Terminal on the clean exact source head after automated tests; new native_vault_probe, update, empty preparation, child and cleanup must all PASS. If it fails, use the bounded OSStatus to classify missing entitlement vs parameter mismatch without weakening protections.
  • Review secure lifecycle and recovery of ambiguous bootstrap/precommit states, Keychain OS rollback and durable recipient trust; genuine device owner key bootstrap and two-Mac human-confirmed pairing/restore, owner/recovery-code rotation and revocation evidence.
  • Only then design actual production Keychain integration and user consent, future OAuth drive.appdata and safe ciphertext-only transport. Untrusted Drive alone cannot prove newest valid head.

PRODUCT_FEATURE program, PRODUCT_LOCAL diagnostic slice / ITERATION / FULL selector due to native packaging and security / REMOTE_AUTOMATED Mac PASS; REAL_ENVIRONMENT updated bundled GUI gate PENDING, two-Mac PENDING. Draft PR, not sync-ready or release-ready.

Canonical plan: docs/workstreams/secure-sync-google-drive.md.

@daniele21 daniele21 changed the title spike(sync): encrypted transcript proof and Google Drive pairing/recovery workstream spike(sync): encrypted vault manifest, Keychain proof and Drive pairing plan Nov 19, 2026
@daniele21 daniele21 changed the title spike(sync): encrypted vault manifest, Keychain proof and Drive pairing plan spike(sync): encryption foundation and native packaged Keychain qualification Nov 19, 2026
@daniele21 daniele21 changed the title spike(sync): encryption foundation and native packaged Keychain qualification spike(sync): encrypted vault, independent recovery and offline read-only pairing Nov 20, 2026
@daniele21 daniele21 changed the title spike(sync): encrypted vault, independent recovery and offline read-only pairing spike(sync): Keychain-anchored owner ledger, independent recovery and offline revocation Nov 20, 2026
@daniele21 daniele21 changed the title spike(sync): Keychain-anchored owner ledger, independent recovery and offline revocation spike(sync): authenticated offline vault recovery, pairing, revocation and crash repair Nov 20, 2026
@daniele21 daniele21 changed the title spike(sync): authenticated offline vault recovery, pairing, revocation and crash repair spike(sync): native packaged Keychain lifecycle probe and offline trust foundation Nov 20, 2026
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