From 5706b71292c6942ca8d6674a671bc593b9f2247f Mon Sep 17 00:00:00 2001 From: David Snelling Date: Tue, 11 Nov 2025 10:17:37 -0800 Subject: [PATCH] docs: add asOf() time-travel to fork section Good catch! The fork section mentioned fork() but not asOf(). These are complementary features: - fork() - writable clone for testing/experiments - asOf() - read-only time-travel queries CHANGES: - Add time-travel code example showing asOf() usage - Add asOf() to v5.0.0 feature list - Add 'time-travel debugging, audit trails' to use cases Now users can see the full Git-style workflow including time-travel. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 955de841..678b5e81 100644 --- a/README.md +++ b/README.md @@ -257,19 +257,26 @@ const result = await brain.merge('test-migration', 'main', { }) console.log(result) // { added: 1, modified: 0, conflicts: 0 } + +// Time-travel: Query database at any past commit (read-only) +const commits = await brain.getHistory({ limit: 10 }) +const snapshot = await brain.asOf(commits[5].id) +const pastResults = await snapshot.find({ query: 'historical data' }) +await snapshot.close() ``` **NEW in v5.0.0:** - ✅ `fork()` - Instant clone in <100ms - ✅ `merge()` - Merge with conflict resolution - ✅ `commit()` - Snapshot state +- ✅ `asOf()` - Time-travel queries (query at any commit) - ✅ `getHistory()` - View commit history - ✅ `checkout()`, `listBranches()` - Full branch management - ✅ CLI support for all features **How it works:** Snowflake-style COW shares HNSW index structures, copying only modified nodes (10-20% memory overhead). -**Perfect for:** Safe migrations, A/B testing, feature branches, distributed development +**Perfect for:** Safe migrations, A/B testing, feature branches, distributed development, time-travel debugging, audit trails [→ See Full Documentation](docs/features/instant-fork.md)