feat(8.0)!: delete fork/branch/commit/history/versions — superseded by the Db API
The COW version-control surface (fork, branches, checkout, commit,
getHistory/streamHistory, asOfCommit, brain.versions) is gone, along with
its subsystems: src/versioning/, the COW object store (CommitLog,
CommitObject, RefManager, TreeObject), HistoricalStorageAdapter, and the
TypeAwareHNSWIndex path it kept alive. The Db API (now/transact/asOf/
with/persist/restore) is the one versioning model in 8.0.
Survivors and replacements:
- BlobStorage survives (the VFS stores file content through it), relocated
to src/storage/blobStorage.ts with binaryDataCodec.ts; its adapter
interface is now BlobStoreAdapter, slimmed to the consumed surface
(write/read/has/delete/getMetadata + MIME-aware compression policy).
- brain.migrate() backup branches are replaced by persist-before-migrate:
MigrateOptions.backupTo persists a hard-link snapshot of the current
generation before any transform runs; MigrationResult.backupPath reports
it, and brain.restore(path) brings it back wholesale.
- CLI: cow.ts (fork/branch/checkout/history/migrate) is replaced by
snapshot.ts — snapshot <path>, restore <path>, history (tx-log),
generation.
- New public read API: brain.transactionLog({limit}) exposes the reified
tx-log (generation/timestamp/meta, newest first) that backs the CLI
history command; TxLogEntry is exported.
Tests: superseded suites deleted; fork/commit blocks excised from shared
suites; BlobStorage tests relocated + reworked against the slimmed store;
migration tests now prove the backupTo snapshot/restore round trip; new
transactionLog coverage in db-mvcc.
This commit is contained in:
parent
431cd64406
commit
8f93add705
64 changed files with 1444 additions and 16313 deletions
|
|
@ -291,40 +291,6 @@ describe('Metadata-Only Comprehensive Integration (v5.11.1)', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('COW and Fork', () => {
|
||||
it('should work with metadata-only in forks', async () => {
|
||||
const brain = new Brainy({ requireSubtype: false,
|
||||
storage: { adapter: 'memory' },
|
||||
silent: true
|
||||
})
|
||||
|
||||
await brain.init()
|
||||
|
||||
const id = await brain.add({
|
||||
data: 'Original',
|
||||
type: NounType.Document,
|
||||
metadata: { version: 1 }
|
||||
})
|
||||
|
||||
await brain.commit({ message: 'Initial commit' })
|
||||
|
||||
const fork = await brain.fork('test-branch')
|
||||
|
||||
// Metadata-only in fork
|
||||
const entity = await fork.get(id)
|
||||
expect(entity).toBeTruthy()
|
||||
expect(entity!.metadata.version).toBe(1)
|
||||
expect(entity!.vector).toEqual([])
|
||||
|
||||
// Full entity in fork
|
||||
const full = await fork.get(id, { includeVectors: true })
|
||||
expect(full!.vector.length).toBe(384)
|
||||
|
||||
await brain.close()
|
||||
await fork.close()
|
||||
})
|
||||
})
|
||||
|
||||
describe('Performance Verification', () => {
|
||||
it('metadata-only should be significantly faster', async () => {
|
||||
const brain = new Brainy({ requireSubtype: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue