brainy/docs/guides
David Snelling 2c84f86815 feat(8.0): temporal range verbs — diff, history, since(gen|Date), asOf{exclusive}, transactionLog window
asOf() answers "state AT a point"; these answer "what happened BETWEEN two
points" and "one entity's whole history", all on the existing generation records.

- Extract resolveAsOfGeneration() as the shared gen|Date→{generation,timestamp}
  chokepoint (reachability + Date semantics identical everywhere). asOf()'s
  inclusive path is byte-identical — db-mvcc still 25/25.
- asOf(target, { exclusive }) — strict-before (resolved−1, clamped at gen 0,
  never a RangeError).
- db.since(Db | generation | Date) — overload; number/Date resolve via the shared
  resolver (new DbHost.resolveGeneration); EXCLUSIVE lower bound;
  since(db) === since(db.generation). Same-store guard via Db.belongsToStore.
- brain.diff(a, b) → { added, removed, modified } split by nouns/verbs. EARNS its
  name: candidate set is ONLY changedBetween(gLow,gHigh), each classified by
  existence at both endpoints + a key-order-insensitive value compare
  (new src/db/stableEqual.ts) — a touched-but-reverted / born-and-died id is in
  no bucket.
- brain.history(id, { from, to }) → every distinct version oldest→newest, each
  value === asOf(version.generation).get(id); null = removal; kind auto-detected
  (throws on UUID-space collision). New store helper generationsTouching().
- brain.transactionLog({ from, to, limit }) — INCLUSIVE generation/Date window
  (contrast since's exclusive lower bound); limit applied last.
- Compaction policy locked: diff/since THROW GenerationCompactedError below the
  horizon; history TRUNCATES to it.

Types DiffResult/HistoryVersion/EntityHistory exported from the package root.
Tests: tests/integration/db-temporal.test.ts (8 proofs incl. diff-earns-its-name,
history↔asOf cross-check, the composition proof, granularity, compaction contrast)
+ tests/unit/db/stableEqual.test.ts (6). docs/guides/snapshots-and-time-travel.md
+ RELEASES updated. 1477 unit + db-temporal 8 + db-mvcc 25 green.
2026-06-19 13:21:02 -07:00
..
aggregation.md feat: array-unnest groupBy for aggregates + batch-embed entity extraction 2026-05-26 14:20:40 -07:00
enterprise-for-everyone.md refactor(8.0)!: remove distributed clustering subsystem — inert/orphaned, scale is single-process + native provider 2026-06-15 10:37:39 -07:00
export-and-import.md refactor(8.0): rename BackupData → PortableGraph (the type is interchange, not a backup) 2026-06-19 12:37:23 -07:00
find-limits.md fix: recalibrate find({ limit }) cap + two-tier enforcement + caller location 2026-06-08 12:49:43 -07:00
framework-integration.md refactor(8.0)!: remove orphaned zero-config subsystem + dead cloud/progressive-init storage vestige 2026-06-15 11:11:21 -07:00
import-anything.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
import-flow.md refactor(8.0)!: remove orphaned zero-config subsystem + dead cloud/progressive-init storage vestige 2026-06-15 11:11:21 -07:00
import-progress-examples.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
import-progress-implementation.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
import-quick-reference.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
inspection.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
installation.md docs(8.0): remove unbacked Cortex '5.2x' perf claim + dangling /docs/cortex/comparison link 2026-06-15 12:52:04 -07:00
migrating-to-v4.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
MIGRATING_TO_V5.11.md feat: enforce data/metadata separation, numeric range queries, improved docs 2026-02-09 12:07:54 -08:00
migration-3.36.0.md feat: implement always-adaptive caching with getCacheStats monitoring 2025-10-10 14:09:30 -07:00
model-loading.md feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
natural-language.md feat: v5.1.0 - VFS auto-initialization and complete API documentation 2025-11-02 10:58:52 -08:00
neural-api.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
nextjs-integration.md feat: enhance framework integration and simplify codebase 2025-09-15 14:54:13 -07:00
optimistic-concurrency.md docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
quick-start.md refactor(8.0)!: remove orphaned zero-config subsystem + dead cloud/progressive-init storage vestige 2026-06-15 11:11:21 -07:00
schema-migrations.md refactor(8.0)!: remove orphaned zero-config subsystem + dead cloud/progressive-init storage vestige 2026-06-15 11:11:21 -07:00
snapshots-and-time-travel.md feat(8.0): temporal range verbs — diff, history, since(gen|Date), asOf{exclusive}, transactionLog window 2026-06-19 13:21:02 -07:00
standard-import-progress.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
storage-adapters.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
streaming-imports.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
subtypes-and-facets.md chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
vue-integration.md refactor(8.0)!: remove orphaned zero-config subsystem + dead cloud/progressive-init storage vestige 2026-06-15 11:11:21 -07:00