2025-08-26 12:32:21 -07:00
|
|
|
/**
|
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
|
|
|
* Pipeline - Execution pipeline
|
2025-08-26 12:32:21 -07:00
|
|
|
*
|
2026-02-01 08:22:11 -08:00
|
|
|
* Provides Pipeline class, execution modes, and factory functions.
|
2025-08-26 12:32:21 -07:00
|
|
|
*/
|
|
|
|
|
|
2026-02-01 08:22:11 -08:00
|
|
|
/**
|
|
|
|
|
* Execution mode for pipeline operations
|
|
|
|
|
*/
|
|
|
|
|
export enum ExecutionMode {
|
|
|
|
|
SEQUENTIAL = 'sequential',
|
|
|
|
|
PARALLEL = 'parallel',
|
|
|
|
|
FIRST_SUCCESS = 'firstSuccess',
|
|
|
|
|
FIRST_RESULT = 'firstResult',
|
|
|
|
|
THREADED = 'threaded'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Options for pipeline execution
|
|
|
|
|
*/
|
|
|
|
|
export interface PipelineOptions {
|
|
|
|
|
mode?: ExecutionMode
|
|
|
|
|
timeout?: number
|
|
|
|
|
retries?: number
|
|
|
|
|
throwOnError?: boolean
|
2025-08-26 12:32:21 -07:00
|
|
|
}
|
2026-02-01 08:22:11 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Minimal Pipeline class for backward compatibility.
|
|
|
|
|
*/
|
|
|
|
|
export class Pipeline {
|
|
|
|
|
private static instance?: Pipeline
|
|
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
|
if (Pipeline.instance) {
|
|
|
|
|
return Pipeline.instance
|
|
|
|
|
}
|
|
|
|
|
Pipeline.instance = this
|
|
|
|
|
}
|
2025-08-26 12:32:21 -07:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 08:22:11 -08:00
|
|
|
// Default singleton instance
|
|
|
|
|
export const pipeline = new Pipeline()
|
|
|
|
|
|
|
|
|
|
// Backward compatibility aliases
|
|
|
|
|
export const AugmentationPipeline = Pipeline
|
|
|
|
|
export const augmentationPipeline = pipeline
|
|
|
|
|
|
|
|
|
|
// Factory functions
|
|
|
|
|
export const createPipeline = async () => new Pipeline()
|
|
|
|
|
export const createStreamingPipeline = async () => new Pipeline()
|
|
|
|
|
|
|
|
|
|
// Type aliases
|
|
|
|
|
export type StreamlinedPipelineOptions = PipelineOptions
|
2025-08-26 12:32:21 -07:00
|
|
|
export type PipelineResult<T> = { success: boolean; data: T; error?: string }
|
|
|
|
|
export type StreamlinedPipelineResult<T> = PipelineResult<T>
|
|
|
|
|
|
|
|
|
|
// Execution mode alias
|
|
|
|
|
export enum StreamlinedExecutionMode {
|
|
|
|
|
SEQUENTIAL = 'sequential',
|
2026-02-01 08:22:11 -08:00
|
|
|
PARALLEL = 'parallel',
|
2025-08-26 12:32:21 -07:00
|
|
|
FIRST_SUCCESS = 'firstSuccess',
|
|
|
|
|
FIRST_RESULT = 'firstResult',
|
|
|
|
|
THREADED = 'threaded'
|
2026-02-01 08:22:11 -08:00
|
|
|
}
|