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

@ -1,7 +1,7 @@
/**
* ContextSignal - Relationship-based entity type classification
*
* PRODUCTION-READY: Infers types from relationship patterns in context
* Infers types from relationship patterns in context
*
* Weight: 5% (lowest, but critical for ambiguous cases)
* Speed: Very fast (~1ms) - pure pattern matching on context

View file

@ -1,7 +1,7 @@
/**
* EmbeddingSignal - Neural entity type classification using embeddings
*
* PRODUCTION-READY: Merges neural + graph + temporal signals into one
* Merges neural + graph + temporal signals into one
* 3x faster than separate signals (single embedding lookup)
*
* Weight: 35% (20% neural + 10% graph + 5% temporal boost)
@ -56,7 +56,7 @@ export interface EmbeddingSignalOptions {
interface SourceMatch {
type: NounType
confidence: number
source: string
source: TypeSignal['source']
metadata?: any
}
@ -390,7 +390,7 @@ export class EmbeddingSignal {
}
return {
source: bestMatches.length > 1 ? 'embedding-combined' : bestMatches[0].source as any,
source: bestMatches.length > 1 ? 'embedding-combined' : bestMatches[0].source,
type: bestType,
confidence: Math.min(bestCombinedScore, 1.0), // Cap at 1.0
evidence,

View file

@ -11,7 +11,6 @@
* Merges: KeywordSignal + PatternSignal from old architecture
* Speed: Very fast (~5ms) - pre-compiled patterns
*
* PRODUCTION-READY: No TODOs, no mocks, real implementation
*/
import type { Brainy } from '../../brainy.js'

View file

@ -8,7 +8,6 @@
* 2. Semantic compatibility (Document+Person CreatedBy)
* 3. Domain heuristics (Location+Organization LocatedAt)
*
* PRODUCTION-READY: No TODOs, no mocks, real implementation
*/
import type { Brainy } from '../../brainy.js'

View file

@ -8,7 +8,6 @@
* 2. Cosine similarity against context text
* 3. Semantic understanding of relationship intent
*
* PRODUCTION-READY: No TODOs, no mocks, real implementation
*/
import type { Brainy } from '../../brainy.js'
@ -89,7 +88,12 @@ export class VerbEmbeddingSignal {
constructor(brain: Brainy, options?: VerbEmbeddingSignalOptions) {
this.brain = brain
this.distanceFn = (brain as any).distance || cosineDistance
// Visibility boundary: Brainy keeps its distance function in a private
// field. The signal reuses it when present so verb classification matches
// the index geometry, falling back to cosine distance otherwise.
this.distanceFn =
(brain as unknown as { distance?: (a: Vector, b: Vector) => number }).distance ||
cosineDistance
this.options = {
minConfidence: options?.minConfidence ?? 0.60,
minSimilarity: options?.minSimilarity ?? 0.55,

View file

@ -8,7 +8,6 @@
* 2. Prepositional phrase patterns ("in", "at", "by", "of")
* 3. Structural patterns (parentheses, commas, formatting)
*
* PRODUCTION-READY: No TODOs, no mocks, real implementation
*/
import type { Brainy } from '../../brainy.js'