feat: add comprehensive zero-config validation system

- Implement self-configuring validation that adapts to system resources
- Add validation for all CRUD operations (add, update, delete, find, relate)
- Auto-configure limits based on available memory (1GB = 10K limit, 8GB = 80K)
- Monitor and auto-tune performance based on query response times
- Fix multiple type filtering with proper anyOf structure
- Enhance type safety by requiring NounType/VerbType enums
- Fix tests to validate correct behavior (no fake implementations)
- Add comprehensive VALIDATION.md documentation
- Update API_REFERENCE.md with validation rules and examples
- Clarify metadata update behavior (null keeps existing, {} clears)

BREAKING CHANGE: getFieldsForType() now requires NounType enum instead of string

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David Snelling 2025-09-12 14:37:39 -07:00
parent 887a725677
commit 008abb1cab
12 changed files with 979 additions and 76 deletions

View file

@ -8,6 +8,7 @@ import { StorageAdapter } from '../coreTypes.js'
import { MetadataIndexCache, MetadataIndexCacheConfig } from './metadataIndexCache.js'
import { prodLog } from './logger.js'
import { getGlobalCache, UnifiedCache } from './unifiedCache.js'
import { NounType } from '../types/graphTypes.js'
export interface MetadataIndexEntry {
field: string
@ -1959,7 +1960,7 @@ export class MetadataIndexManager {
* Get fields that commonly appear with a specific entity type
* Returns fields with their affinity scores (0-1)
*/
async getFieldsForType(nounType: string): Promise<Array<{
async getFieldsForType(nounType: NounType): Promise<Array<{
field: string
affinity: number
occurrences: number