This repository has been archived on 2026-09-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
open-brainy/src/transaction/operations/index.ts
David Snelling 0c028dfc81
All checks were successful
CI / Node 24 (push) Successful in 12m19s
CI / Node 22 (push) Successful in 12m30s
CI / Integration + conformance (Node 22) (push) Successful in 18m26s
CI / Bun (latest) (push) Successful in 12m16s
feat(update-seam): first-class update operation through the provider seam
Brainy's planner emits a single UpdateInMetadataIndexOperation /
UpdateVerbInGraphIndexOperation when the registered provider announces the
`update-op` capability (capabilities has 'update-op' AND the method exists —
both halves), and the legacy remove+add pair otherwise. A provider whose
capability set claims what the instance lacks is refused at registration
with a typed ProviderCapabilityMismatchError — never a silent fallback.

- MetadataIndexProvider.updateIndex(id, before, after, generation?) and
  GraphIndexProvider.updateVerb(id, before, after, generation) — optional,
  rollback symmetric by construction (update(a,b) undone by update(b,a)).
- Emission at update(), planTxUpdate() and updateRelation()'s graph leg.
- transact() gains op:'updateRelation' (TxUpdateRelationOperation), born
  batchable; updateRelation()'s record build is shared with the planner.
- Both paths live for one overlap release; the pair path retires with the
  provider-side compensation layer in the following cut.

Pinned in tests/integration/update-op-emission.test.ts (7 pins).
2026-08-24 09:50:35 -07:00

44 lines
1.2 KiB
TypeScript

/**
* Transaction Operations
*
* Re-exports all transactional operations for storage and indexes.
* These operations provide atomicity with rollback support.
*
* @module transaction/operations
*/
// Storage Operations
export {
SaveNounMetadataOperation,
SaveNounOperation,
DeleteNounMetadataOperation,
SaveVerbMetadataOperation,
SaveVerbOperation,
DeleteVerbMetadataOperation,
UpdateNounMetadataOperation,
UpdateVerbMetadataOperation
} from './StorageOperations.js'
// Index Operations
export {
AddToVectorIndexOperation,
RemoveFromVectorIndexOperation,
ReplaceInVectorIndexOperation,
AddToMetadataIndexOperation,
RemoveFromMetadataIndexOperation,
UpdateInMetadataIndexOperation,
AddToGraphIndexOperation,
RemoveFromGraphIndexOperation,
UpdateVerbInGraphIndexOperation,
BatchAddToVectorIndexOperation,
BatchAddToMetadataIndexOperation
} from './IndexOperations.js'
// Update-op capability check (the FIRST-CLASS UPDATE seam)
export {
UPDATE_OP_CAPABILITY,
metadataUpdateOpProvider,
graphUpdateOpProvider,
assertUpdateCapabilityCoherent
} from './updateCapability.js'
export type { MetadataUpdateOpProvider, GraphUpdateOpProvider } from './updateCapability.js'