docs: pin the write-path invariant in the plugin contract (the onChange change-feed guarantee)

This commit is contained in:
David Snelling 2026-07-10 11:30:00 -07:00
parent 841443db4e
commit 4af8fb31e2

View file

@ -149,6 +149,17 @@ context.registerProvider('embedBatch', async (texts: string[]) => {
### Index Providers
> **Write-path invariant (the change-feed contract).** Every canonical
> mutation flows through Brainy's generation-store commit points — index
> providers are invoked *inside* that commit and never originate canonical
> writes of their own. The `brain.onChange` change feed is emitted from those
> commit points and relies on this: **a plugin must never introduce a write
> path that bypasses the generation-store commit.** If a future provider ever
> needs a direct native ingest path, it must either route through the commit
> or emit equivalent change events — otherwise every `onChange` consumer
> (live UIs, cache invalidation, realtime sync) silently develops a blind
> spot.
#### `vector`
**Type:** `(config: object, distanceFunction: Function, options: object) => VectorIndexProvider-compatible`