# Dev Update: v0.7.0 Delta Sync, File Sync, Intelligent Install & Update

**Date:** 2026-03-05 12:45 PST
**Agent:** CC-Mini
**Session:** Implementation + release of three major features

---

## What Happened

### 1. Delta Sync Architecture

Replaced cloud search with full local sync. Every Crystal Node gets a complete copy of the database via incremental deltas from Core.

- `src/core.ts` ... added `getChunksSince()` and `getChunkCount()` for cursor-based delta export
- `src/mirror-sync.ts` ... rewritten for full LDM tree sync (directories, files, watermarks)
- `src/poller.ts` ... expanded for delta ingestion on Node side
- `src/cloud-crystal.ts`, `src/worker-mcp.ts`, `src/worker.ts` ... marked DEPRECATED

Cloud Memory deprecated because plaintext at rest breaks sovereignty. iOS path forward: direct connection to Crystal Core via `crystal serve` on local network.

### 2. File Sync

New `src/file-sync.ts` (383 lines). Bidirectional file sync between LDM agents using mtime watermarks. Foundation for keeping agent state consistent without iCloud or external sync.

### 3. Intelligent Install & Update

New `src/installer.ts` (559 lines). `crystal init` is now a full deployment system:
- Detects what's installed (LDM dirs, CC hook, MCP registration, OC plugin, versions, cron)
- Fresh install: scaffolds, deploys code, configures CC Stop hook, registers MCP, deploys cron, handles OC
- Update: compares versions, deploys new code, never touches data/state/secrets
- New flags: `--core`, `--node`, `--pair`, `--update`, `--yes`
- `crystal update` alias added

CC hook configuration merges safely into `~/.claude/settings.json` (reads, finds/replaces memory-crystal entry, writes back, never overwrites other hooks).

### 4. Doctor Improvements

Two new checks (12 total):
- Version: shows LDM + OC deployed versions, detects mismatches
- CC Hook: verifies Stop hook in settings.json

### 5. Release Pipeline

- PR #27 merged to private repo
- `wip-release minor` ... v0.6.1 -> v0.7.0
- npm published: `memory-crystal@0.7.0`
- `deploy-public.sh` ... PR #13 merged on public repo
- Comprehensive release notes written for both repos (matching v0.6.0 quality standard)

### 6. Process Issue: Compaction Memory Loss

After Parker ran `/clear`, I forgot the release workflow (four-step process: PR, merge, wip-release, deploy-public.sh). The process was documented in my own persistent memory file at `~/.claude/projects/-Users-lesa--openclaw/memory/repo-locations.md` but I didn't read it before answering. Updated the memory file with exact tool paths to prevent recurrence.

---

## Key Decisions

1. **Cloud Memory stays deprecated.** Plaintext at rest is a non-starter. iOS app will connect to Core directly via `crystal serve`.
2. **All uncommitted work shipped together.** Delta sync (pre-existing) + intelligent install (this session) merged in one PR since they're complementary.
3. **installer.ts is pure detection + targeted side effects.** No destructive operations. Never overwrites data, state, or secrets.

---

## What's Next

- Test `crystal init` on a fresh account (or with `~/.ldm` moved aside)
- Test `crystal update` by bumping version and re-running
- Deploy v0.7.0 to local extensions (`~/.ldm/extensions/memory-crystal/` and `~/.openclaw/extensions/memory-crystal/`)
- Update roadmap and readme-first per PR checklist
