Plan Library
The Plan Library stores validated plans and manages their lifecycle from initial candidate through promotion, deprecation, and quarantine.
Lifecycle States
Section titled “Lifecycle States”CANDIDATE → SHADOW → PROMOTED → DEPRECATED ↘ QUARANTINED| State | Description |
|---|---|
| CANDIDATE | Newly generated, not yet validated |
| SHADOW | Undergoing validation/training runs |
| PROMOTED | Fully trusted, used for reuse |
| DEPRECATED | Replaced by newer version |
| QUARANTINED | Failing validation, blocked from use |
Trust Scoring
Section titled “Trust Scoring”Each plan has a composite trust score (0.0–1.0) computed from 7 signals:
- Validation pass rate — How often the plan passes validation
- Execution success rate — Runtime success rate
- Training pass rate — Training dataset performance
- User feedback — Explicit thumbs up/down
- Regression count — How often the plan regresses
- Age factor — Newer plans need more validation
- Complexity factor — More steps = more risk
import { InMemoryPlanLibraryStore, computeTrustScore } from '@zakardo/core';
const library = new InMemoryPlanLibraryStore();
// Store a planawait library.store(planRecord);
// Search by intentconst matches = await library.search({ intent_text: 'create a contact', tags: ['contacts'],});
// Compute trust scoreconst score = computeTrustScore(planRecord.trust_signals);