evaluate_context_pack
Record evaluation outcomes for context packs, including scores, evidence, and guardrail compliance, to track performance and ensure quality standards.
Instructions
Record evaluation outcome for a context pack
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packId | Yes | ||
| outcome | Yes | ||
| signal | No | ||
| notes | No | ||
| rubricScores | No | ||
| guardrails | No |
Implementation Reference
- scripts/contextfs.js:780-801 (handler)The core implementation of the evaluateContextPack function which handles evaluation logic, file writing, and provenance recording.
function evaluateContextPack({ packId, outcome, signal = null, notes = '', rubricEvaluation = null }) { const evaluation = { id: `eval_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`, packId, outcome, signal, notes, rubricEvaluation, timestamp: nowIso(), }; appendJsonl(path.join(CONTEXTFS_ROOT, NAMESPACES.provenance, 'evaluations.jsonl'), evaluation); recordProvenance({ type: 'context_pack_evaluated', packId, outcome, signal, rubricPromotionEligible: rubricEvaluation ? rubricEvaluation.promotionEligible : null, }); return evaluation; } - adapters/mcp/server-stdio.js:201-216 (helper)The adapter wrapper function (buildContextEvaluationResponse) that validates input and calls the core evaluateContextPack logic within the MCP server.
function buildContextEvaluationResponse(args = {}) { if (!args.packId || !args.outcome) { throw new Error('packId and outcome are required'); } let rubricEvaluation = null; if (args.rubricScores != null || args.guardrails != null) { rubricEvaluation = buildRubricEvaluation({ rubricScores: args.rubricScores, guardrails: args.guardrails, }); } const evaluation = evaluateContextPack({ packId: args.packId, outcome: args.outcome,