chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase

This commit is contained in:
David Snelling 2026-06-11 14:51:00 -07:00
parent 970e08c466
commit 1f7e365a4e
237 changed files with 1951 additions and 49413 deletions

View file

@ -59,9 +59,15 @@ export class ColumnManifest {
async load(storage: StorageAdapter): Promise<void> {
try {
const path = this.manifestPath()
const data = await (storage as any).readObjectFromPath(path)
// readObjectFromPath is a BaseStorage primitive (protected on the
// class, not part of the StorageAdapter interface) — the column store
// owns everything under its base path, and the field-name check below
// validates the manifest before it is adopted.
const data = await (storage as unknown as {
readObjectFromPath: (path: string) => Promise<ManifestData | null>
}).readObjectFromPath(path)
if (data && data.field === this.fieldName) {
this.data = data as ManifestData
this.data = data
}
} catch {
// Not found — start fresh (data is already initialized in constructor)
@ -76,7 +82,12 @@ export class ColumnManifest {
async save(storage: StorageAdapter): Promise<void> {
this.data.version++
const path = this.manifestPath()
await (storage as any).writeObjectToPath(path, this.data)
// writeObjectToPath is a BaseStorage primitive (protected on the class,
// not part of the StorageAdapter interface) — same typed boundary as
// load() above.
await (storage as unknown as {
writeObjectToPath: (path: string, data: ManifestData) => Promise<void>
}).writeObjectToPath(path, this.data)
}
/**

View file

@ -120,7 +120,12 @@ export class ColumnStore implements ColumnStoreProvider {
// Discover fields by listing manifest files
try {
const paths = await (storage as any).listObjectsUnderPath(this.basePath + '/')
// listObjectsUnderPath is a BaseStorage primitive (protected on the
// class, not part of the StorageAdapter interface) — same typed
// boundary as the blob reads below.
const paths = await (storage as unknown as {
listObjectsUnderPath: (prefix: string) => Promise<string[]>
}).listObjectsUnderPath(this.basePath + '/')
for (const path of paths) {
if (path.endsWith('/MANIFEST.json')) {
const fieldName = path.replace(this.basePath + '/', '').replace('/MANIFEST.json', '')
@ -637,8 +642,12 @@ export class ColumnStore implements ColumnStoreProvider {
if (!buffer || buffer.size === 0) return null
const valueType = this.fieldTypes.get(field) ?? ValueType.String
// Drain a COPY for querying — don't clear the buffer
const entries = (buffer as any).entries as Array<{ value: number | string, entityIntId: number }>
// Drain a COPY for querying — don't clear the buffer. This reads the
// buffer's private accumulator directly (drain() is the only public
// accessor and it clears the buffer, which queries must not do).
const entries = (buffer as unknown as {
entries: Array<{ value: number | string, entityIntId: number }>
}).entries
if (!entries || entries.length === 0) return null
// Sort a copy for the cursor