Skip to content

Plan Library

The Plan Library stores validated plans and manages their lifecycle from initial candidate through promotion, deprecation, and quarantine.

CANDIDATE → SHADOW → PROMOTED → DEPRECATED
↘ QUARANTINED
StateDescription
CANDIDATENewly generated, not yet validated
SHADOWUndergoing validation/training runs
PROMOTEDFully trusted, used for reuse
DEPRECATEDReplaced by newer version
QUARANTINEDFailing validation, blocked from use

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 plan
await library.store(planRecord);
// Search by intent
const matches = await library.search({
intent_text: 'create a contact',
tags: ['contacts'],
});
// Compute trust score
const score = computeTrustScore(planRecord.trust_signals);