chore(8.0): Phase C + D + E — config simplification, TODO sweep, test race fix
Phase C: storageAutoConfig.ts rewrite (376 LOC → ~110 LOC). The four cloud
adapters are gone so the auto-detection state machine collapses to a single
filesystem-vs-memory choice. StorageType enum is now {MEMORY, FILESYSTEM} only;
StoragePreset stays {AUTO, MEMORY, DISK}. zeroConfig.ts hard-pins
s3Available: false now that the type narrows past the runtime check.
Phase D: TODO/FIXME sweep in src/. Removed seven stale markers. The CLI cow
migrate command's backup path now uses fs.cp with recursive + force:false
instead of a TODO placeholder.
Phase E: skipped-test deletion + parallel-test race fix.
- storage-batch-operations.test.ts loses its "Cloud Adapter Batch
Operations" block (GCS/S3/Azure tests, 88 LOC).
- cow-full-integration.test.ts loses its skipped "S3 adapter" test.
- create-entities-default.test.ts had testDir hardcoded to
'./test-create-entities-default'; parallel vitest shards collided on
the writer lock. testDir is now os.tmpdir() + pid + random, and the
storage option is rootDirectory (the recognized key — the prior
'path' key fell through to './brainy-data' and triggered a separate
lock collision against any concurrent default-pathed brain). Added
afterEach brain.close() so the lock releases before rmSync.
This commit is contained in:
parent
cb16a39a0c
commit
2626ab8d62
10 changed files with 94 additions and 485 deletions
|
|
@ -136,11 +136,9 @@ ${chalk.cyan('Fork Statistics:')}
|
|||
const marker = isCurrent ? chalk.green('*') : ' '
|
||||
const name = isCurrent ? chalk.green(branch) : branch
|
||||
|
||||
// Get branch info
|
||||
// TODO: Re-enable when COW is integrated into BaseStorage
|
||||
// const ref = await brain.storage.refManager.getRef(branch)
|
||||
// const age = ref ? formatAge(Date.now() - ref.updatedAt) : 'unknown'
|
||||
|
||||
// Branch-info enrichment (last-commit timestamp, etc.) requires a
|
||||
// refManager accessor that brainy hasn't surfaced on the public
|
||||
// storage adapter yet. CLI shows the bare branch name for now.
|
||||
console.log(` ${marker} ${name}`)
|
||||
}
|
||||
|
||||
|
|
@ -360,10 +358,8 @@ ${chalk.cyan('Fork Statistics:')}
|
|||
if (options.backup) {
|
||||
const backupPath = `${fromPath}.backup-${Date.now()}`
|
||||
spinner = ora(`Creating backup: ${backupPath}...`).start()
|
||||
|
||||
// TODO: Implement backup
|
||||
// await copyDirectory(fromPath, backupPath)
|
||||
|
||||
const fs = await import('node:fs/promises')
|
||||
await fs.cp(fromPath, backupPath, { recursive: true, force: false })
|
||||
spinner.succeed(`Backup created: ${chalk.green(backupPath)}`)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import chalk from 'chalk'
|
||||
import inquirer from 'inquirer'
|
||||
// import fuzzy from 'fuzzy' // TODO: Install fuzzy package or remove dependency
|
||||
import ora from 'ora'
|
||||
import { Brainy } from '../brainy.js'
|
||||
import { getBrainyVersion } from '../utils/version.js'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue