import { CollectiveRule, CollectiveLearningStats } from '../types.js'; /** * CollectiveLearning — cross-project knowledge sharing with verified rules. * * When an insight or pattern is discovered in one project, it can be shared * as a "rule" to all other projects. Rules go through: * * 1. **Proposal**: A pattern is extracted and proposed as a general rule * 2. **Verification**: Other agents/projects test the rule and report results * 3. **Adoption**: Rules that pass verification threshold are adopted * 4. **Tracking**: Accuracy is continuously tracked — rules decay if inaccurate * 5. **Viral Propagation**: High-accuracy rules spread to more projects * * Trust model: Rules start with low trust and earn trust through verification. */ export declare class CollectiveLearning { private rules; private projectRules; private storeDir; private projectId; constructor(projectId: string, customDir?: string); /** Propose a new rule from a discovered pattern */ proposeRule(content: string, category: string, originAgent: string, evidence?: string[], exceptions?: string[]): string; /** Verify a rule (confirm or contradict from another project/agent) */ verifyRule(ruleId: string, confirmed: boolean): boolean; /** Record that a rule was applied and whether it was correct */ recordApplication(ruleId: string, wasCorrect: boolean): void; /** Get rules applicable to a given context */ getApplicableRules(context: { files?: string[]; category?: string; projectType?: string; keywords?: string[]; }, topK?: number): CollectiveRule[]; /** Get rules proposed by a specific project */ getByOrigin(projectId: string): CollectiveRule[]; /** Get rules verified by a specific project */ getVerifiedBy(projectId: string): CollectiveRule[]; /** Get all verified rules (above verification threshold) */ getVerifiedRules(): CollectiveRule[]; /** Get a specific rule by ID */ get(ruleId: string): CollectiveRule | undefined; /** Export high-value rules for sharing with other projects/agents */ exportViralRules(): CollectiveRule[]; /** Import rules from another project/agent */ importRules(rules: CollectiveRule[]): number; private calculateViralScore; private inferApplicability; private evictWeakestRules; getStats(): CollectiveLearningStats; private persistToDisk; private loadFromDisk; } //# sourceMappingURL=collective-learning.d.ts.map