MCPcopy Create free account
hub / github.com/openai/plugins / buildDeductions

Function buildDeductions

plugins/plugin-eval/src/core/scoring.js:109–129  ·  view source on GitHub ↗
(checks)

Source from the content-addressed store, hash-verified

107}
108
109function buildDeductions(checks) {
110 return checks
111 .map((check) => ({
112 id: check.id,
113 category: check.category,
114 severity: check.severity,
115 status: check.status,
116 message: check.message,
117 penalty: computeCheckPenalty(check),
118 remediation: check.remediation,
119 source: check.source,
120 ...(check.targetPath ? { targetPath: check.targetPath } : {}),
121 }))
122 .filter((entry) => entry.penalty > 0)
123 .sort((left, right) => {
124 if (right.penalty !== left.penalty) {
125 return right.penalty - left.penalty;
126 }
127 return left.id.localeCompare(right.id);
128 });
129}
130
131function buildCategoryDeductions(deductions) {
132 const totals = new Map();

Callers 2

computeSummaryFunction · 0.85
enrichSummaryFunction · 0.85

Calls 3

computeCheckPenaltyFunction · 0.85
filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected