@dailephd/my-dev-kit-lab 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +18 -3
- package/benchmarks/contracts/agent-success-rate-project-profiles.json +33 -0
- package/benchmarks/contracts/agent-success-rate-tasks.json +671 -0
- package/benchmarks/projects/agent-success-inventory-node/.gitattributes +2 -0
- package/benchmarks/projects/agent-success-inventory-node/README.md +74 -0
- package/benchmarks/projects/agent-success-inventory-node/package.json +14 -0
- package/benchmarks/projects/agent-success-inventory-node/src/fulfillmentReport.js +38 -0
- package/benchmarks/projects/agent-success-inventory-node/src/index.js +26 -0
- package/benchmarks/projects/agent-success-inventory-node/src/inventoryStore.js +114 -0
- package/benchmarks/projects/agent-success-inventory-node/src/quantity.js +19 -0
- package/benchmarks/projects/agent-success-inventory-node/src/reservationService.js +45 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/quantity-edge.check.mjs +51 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/quantity-primary.check.mjs +46 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/regression.check.mjs +115 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/report-edge.check.mjs +109 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/report-primary.check.mjs +47 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/reservation-edge.check.mjs +63 -0
- package/benchmarks/projects/agent-success-inventory-node/tests/reservation-primary.check.mjs +44 -0
- package/benchmarks/projects/agent-success-task-board-node/.gitattributes +2 -0
- package/benchmarks/projects/agent-success-task-board-node/README.md +77 -0
- package/benchmarks/projects/agent-success-task-board-node/package.json +14 -0
- package/benchmarks/projects/agent-success-task-board-node/src/index.js +24 -0
- package/benchmarks/projects/agent-success-task-board-node/src/projectSummary.js +15 -0
- package/benchmarks/projects/agent-success-task-board-node/src/taskService.js +58 -0
- package/benchmarks/projects/agent-success-task-board-node/src/taskStore.js +58 -0
- package/benchmarks/projects/agent-success-task-board-node/src/validation.js +31 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/import-edge.check.mjs +65 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/import-primary.check.mjs +31 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/regression.check.mjs +107 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/summary-edge.check.mjs +67 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/summary-primary.check.mjs +54 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/title-edge.check.mjs +39 -0
- package/benchmarks/projects/agent-success-task-board-node/tests/title-primary.check.mjs +29 -0
- package/dist/src/cli/help.js +38 -1
- package/dist/src/commands/runExperimentDescribeCommand.js +52 -1
- package/dist/src/commands/runExperimentRunCommand.js +118 -2
- package/dist/src/core/processTree.js +55 -0
- package/dist/src/core/runMeasuredCommand.js +104 -22
- package/dist/src/evaluation/agentSuccess/applyPatchToSandbox.js +37 -0
- package/dist/src/evaluation/agentSuccess/assessBaseline.js +23 -0
- package/dist/src/evaluation/agentSuccess/corpusTypes.js +74 -0
- package/dist/src/evaluation/agentSuccess/extractPatchCandidate.js +46 -0
- package/dist/src/evaluation/agentSuccess/index.js +14 -0
- package/dist/src/evaluation/agentSuccess/parseUnifiedDiff.js +210 -0
- package/dist/src/evaluation/agentSuccess/patchTypes.js +5 -0
- package/dist/src/evaluation/agentSuccess/readAgentSuccessCorpus.js +183 -0
- package/dist/src/evaluation/agentSuccess/runVerificationCheck.js +100 -0
- package/dist/src/evaluation/agentSuccess/taskPaths.js +34 -0
- package/dist/src/evaluation/agentSuccess/taskTypes.js +14 -0
- package/dist/src/evaluation/agentSuccess/validateAgentSuccessCorpus.js +307 -0
- package/dist/src/evaluation/agentSuccess/validateAgentSuccessTask.js +297 -0
- package/dist/src/evaluation/agentSuccess/validatePatchPolicy.js +66 -0
- package/dist/src/evaluation/agentSuccess/verificationTypes.js +1 -0
- package/dist/src/evaluation/benchmarkSandbox/createBenchmarkSandbox.js +127 -0
- package/dist/src/evaluation/benchmarkSandbox/errors.js +11 -0
- package/dist/src/evaluation/benchmarkSandbox/gitExecutor.js +60 -0
- package/dist/src/evaluation/benchmarkSandbox/index.js +8 -0
- package/dist/src/evaluation/benchmarkSandbox/minimalHostEnv.js +37 -0
- package/dist/src/evaluation/benchmarkSandbox/pathPolicy.js +49 -0
- package/dist/src/evaluation/benchmarkSandbox/removeBenchmarkSandbox.js +74 -0
- package/dist/src/evaluation/benchmarkSandbox/treeSnapshot.js +57 -0
- package/dist/src/evaluation/benchmarkSandbox/types.js +3 -0
- package/dist/src/evaluation/changeSet/captureChangeSet.js +98 -0
- package/dist/src/evaluation/changeSet/index.js +2 -0
- package/dist/src/evaluation/changeSet/types.js +9 -0
- package/dist/src/experiments/defaultRegistry.js +2 -0
- package/dist/src/experiments/plugins/agentSuccessRate/agentTaskProjection.js +12 -0
- package/dist/src/experiments/plugins/agentSuccessRate/analysis.js +425 -0
- package/dist/src/experiments/plugins/agentSuccessRate/analysisArtifact.js +155 -0
- package/dist/src/experiments/plugins/agentSuccessRate/analysisTypes.js +65 -0
- package/dist/src/experiments/plugins/agentSuccessRate/attemptEvidence.js +7 -0
- package/dist/src/experiments/plugins/agentSuccessRate/config.js +123 -0
- package/dist/src/experiments/plugins/agentSuccessRate/contextGeneration.js +497 -0
- package/dist/src/experiments/plugins/agentSuccessRate/execution.js +441 -0
- package/dist/src/experiments/plugins/agentSuccessRate/executionArtifact.js +126 -0
- package/dist/src/experiments/plugins/agentSuccessRate/executionTypes.js +2 -0
- package/dist/src/experiments/plugins/agentSuccessRate/index.js +20 -0
- package/dist/src/experiments/plugins/agentSuccessRate/metadata.js +28 -0
- package/dist/src/experiments/plugins/agentSuccessRate/metrics.js +76 -0
- package/dist/src/experiments/plugins/agentSuccessRate/plugin.js +507 -0
- package/dist/src/experiments/plugins/agentSuccessRate/realAgentExecution.js +250 -0
- package/dist/src/experiments/plugins/agentSuccessRate/realAgentPrompt.js +43 -0
- package/dist/src/experiments/plugins/agentSuccessRate/repairAnalysis.js +148 -0
- package/dist/src/experiments/plugins/agentSuccessRate/repairExecution.js +103 -0
- package/dist/src/experiments/plugins/agentSuccessRate/repairFeedback.js +91 -0
- package/dist/src/experiments/plugins/agentSuccessRate/repairPolicy.js +88 -0
- package/dist/src/experiments/plugins/agentSuccessRate/types.js +1 -0
- package/dist/src/experiments/plugins/warmIndexReuse/plugin.js +2 -3
- package/dist/src/report/experiments/agentSuccessRateReportModel.js +6 -0
- package/dist/src/report/experiments/buildAgentSuccessRateReport.js +255 -0
- package/dist/src/report/experiments/buildPluginExperimentReport.js +27 -2
- package/dist/src/report/experiments/index.js +4 -0
- package/dist/src/report/experiments/renderAgentSuccessRateHtml.js +169 -0
- package/dist/src/report/experiments/renderAgentSuccessRateText.js +139 -0
- package/dist/src/report/experiments/renderPluginExperimentReportHtml.js +3 -0
- package/dist/src/report/experiments/renderPluginExperimentReportText.js +5 -0
- package/docs/METRICS.md +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** One display form for every metric: an absent value is labelled, never rendered as zero. */
|
|
2
|
+
export function formatAgentSuccessMetric(metric) {
|
|
3
|
+
if (!metric)
|
|
4
|
+
return "unavailable (not recorded)";
|
|
5
|
+
if (metric.availability === "unavailable")
|
|
6
|
+
return `unavailable (${metric.reason ?? "no reason recorded"})`;
|
|
7
|
+
if (metric.availability === "not-applicable")
|
|
8
|
+
return `not applicable (${metric.reason ?? "no reason recorded"})`;
|
|
9
|
+
const value = metric.value;
|
|
10
|
+
if (typeof value === "boolean")
|
|
11
|
+
return value ? "yes" : "no";
|
|
12
|
+
if (typeof value !== "number")
|
|
13
|
+
return "unavailable (no value)";
|
|
14
|
+
switch (metric.unit) {
|
|
15
|
+
case "ratio":
|
|
16
|
+
return value.toFixed(4);
|
|
17
|
+
case "ms":
|
|
18
|
+
return `${Math.round(value)} ms`;
|
|
19
|
+
case "tokens":
|
|
20
|
+
return `${Math.round(value)} tokens`;
|
|
21
|
+
case "lines":
|
|
22
|
+
return `${Math.round(value)} lines`;
|
|
23
|
+
default:
|
|
24
|
+
return Number.isInteger(value) ? String(value) : value.toFixed(4);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function formatAgentSuccessTotal(total) {
|
|
28
|
+
const base = `${formatAgentSuccessMetric(total.total)}; contributing cases=${total.contributingCaseCount}, measured=${total.availableCaseCount}, unmeasured=${total.unavailableCaseCount}`;
|
|
29
|
+
return total.unavailableCaseCount > 0 && total.sumOfAvailable !== null ? `${base}; sum of measured cases only=${total.sumOfAvailable} (not a complete total)` : base;
|
|
30
|
+
}
|
|
31
|
+
export function formatAgentSuccessPairs(pairs) {
|
|
32
|
+
if (!pairs)
|
|
33
|
+
return "not recorded";
|
|
34
|
+
return `both succeeded=${pairs.bothSucceeded}, only raw-full-file=${pairs.onlyRawFullFileSucceeded}, only context-pack=${pairs.onlyContextPackSucceeded}, neither=${pairs.neitherSucceeded}`;
|
|
35
|
+
}
|
|
36
|
+
export const AGENT_SUCCESS_BASIS_LABEL = {
|
|
37
|
+
"first-attempt": "first attempt",
|
|
38
|
+
"final-attempt": "final attempt",
|
|
39
|
+
"total-across-attempts": "total across attempts"
|
|
40
|
+
};
|
|
41
|
+
const sanitize = (value) => String(value ?? "").replace(/[\r\n\t]+/g, " ").trim();
|
|
42
|
+
/** Text rendering of the typed section. It formats already-calculated values and recalculates none of them. */
|
|
43
|
+
export function renderAgentSuccessRateTextLines(report) {
|
|
44
|
+
const realMode = report.identity.executionMode === "real-agent";
|
|
45
|
+
const lines = [];
|
|
46
|
+
const section = (title) => {
|
|
47
|
+
lines.push("", title, "-".repeat(title.length));
|
|
48
|
+
};
|
|
49
|
+
lines.push("", "AGENT SUCCESS RATE", "==================");
|
|
50
|
+
section("A. Experiment identity");
|
|
51
|
+
lines.push(`Run ID: ${sanitize(report.identity.runId)}`, `Plugin: ${sanitize(report.identity.pluginId)} (schema ${sanitize(report.identity.pluginSchemaVersion)})`, `Run status: ${sanitize(report.identity.runStatus)}`, `Cases: ${report.identity.caseCount}; treatments: ${report.identity.treatmentOrder.join(", ")}; treatment outcomes: ${report.identity.treatmentOutcomeCount}`);
|
|
52
|
+
section("B. Execution mode and provider");
|
|
53
|
+
lines.push(`Execution mode: ${sanitize(report.identity.executionMode)}`, `Provider: ${report.identity.providerId ?? "none (no coding agent was invoked)"}`, `Provider timeout per attempt: ${report.identity.timeoutMs === null ? "not applicable" : `${report.identity.timeoutMs} ms`}`, `Repair attempts allowed: ${report.identity.repairAttempts === null ? "not applicable" : report.identity.repairAttempts}; maximum attempts per treatment: ${report.identity.maxAttemptsPerTreatment}`);
|
|
54
|
+
section("C. Scientific limitations");
|
|
55
|
+
lines.push(sanitize(report.scientificStatement));
|
|
56
|
+
for (const limitation of report.limitations)
|
|
57
|
+
lines.push(`- ${sanitize(limitation)}`);
|
|
58
|
+
section("D. Overall result availability");
|
|
59
|
+
const availability = report.resultAvailability;
|
|
60
|
+
lines.push(`Overall: ${availability.overall}`, `Treatment outcomes with a determinate task-success verdict: ${availability.evaluableTreatmentOutcomes} of ${availability.totalTreatmentOutcomes}; without: ${availability.unavailableTreatmentOutcomes}`);
|
|
61
|
+
for (const note of availability.notes)
|
|
62
|
+
lines.push(`- ${sanitize(note)}`);
|
|
63
|
+
section("E. Treatment comparison");
|
|
64
|
+
for (const treatment of report.treatments) {
|
|
65
|
+
lines.push(`Treatment ${treatment.treatmentId}:`, ` evaluable cases: ${treatment.evaluableCases}`, ` initial-attempt successful cases: ${treatment.initialSuccessfulCases}; initial success rate: ${formatAgentSuccessMetric(treatment.initialSuccessRate)}`, ` final successful cases: ${treatment.finalSuccessfulCases}; final success rate: ${formatAgentSuccessMetric(treatment.finalSuccessRate)}`);
|
|
66
|
+
if (treatment.repair) {
|
|
67
|
+
lines.push(` repair-eligible cases: ${treatment.repair.repairEligibleCases}; repair attempts executed: ${treatment.repair.repairAttempts}; cases with a repair: ${treatment.repair.repairAttemptedCases}; repaired cases: ${treatment.repair.repairedCases}`, ` repair success rate: ${formatAgentSuccessMetric(treatment.repair.repairSuccessRate)}; mean attempts per evaluable case: ${formatAgentSuccessMetric(treatment.repair.meanAttemptsPerEvaluableCase)}`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
lines.push(" repair: not applicable (deterministic-fixture mode; the single fixture attempt is both initial and final)");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (report.comparison) {
|
|
74
|
+
const comparison = report.comparison;
|
|
75
|
+
lines.push("Matched comparison (descriptive; no winner is declared):", ` comparison evaluable: ${comparison.comparisonEvaluable ? "yes" : "no"}`, ` observed outcome difference between treatments: ${comparison.observedOutcomeDifference}`, ` statistical or causal effect: ${comparison.statisticalEffect} (no significance or causal claim is made)`, ` final matched cases: ${comparison.finalMatchedCaseIds.length > 0 ? comparison.finalMatchedCaseIds.join(", ") : "none"}`, ` final paired outcomes: ${formatAgentSuccessPairs(comparison.finalPairedOutcomes)}`);
|
|
76
|
+
if (comparison.initialMatchedCaseIds) {
|
|
77
|
+
lines.push(` initial-attempt matched cases: ${comparison.initialMatchedCaseIds.length > 0 ? comparison.initialMatchedCaseIds.join(", ") : "none"}`, ` initial-attempt paired outcomes: ${formatAgentSuccessPairs(comparison.initialPairedOutcomes)}`);
|
|
78
|
+
}
|
|
79
|
+
for (const incomplete of comparison.finalIncompleteCases)
|
|
80
|
+
lines.push(` excluded from final matched metrics: ${incomplete.caseId} (no determinate verdict for ${incomplete.unavailableTreatmentIds.join(", ")})`);
|
|
81
|
+
for (const difference of comparison.pairedDifferences) {
|
|
82
|
+
lines.push(` paired difference ${difference.id} [${AGENT_SUCCESS_BASIS_LABEL[difference.basis] ?? difference.basis}] over ${difference.matchedCaseIds.length} matched case(s): raw-full-file ${formatAgentSuccessMetric(difference.rawFullFileMean)}; context-pack ${formatAgentSuccessMetric(difference.contextPackMean)}; context-pack minus raw-full-file ${formatAgentSuccessMetric(difference.meanDifference)}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
lines.push("Matched comparison: not applicable (deterministic-fixture mode does not compare context treatments).");
|
|
87
|
+
}
|
|
88
|
+
section("F. Per-case results");
|
|
89
|
+
for (const entry of report.cases) {
|
|
90
|
+
lines.push(`Case ${entry.caseId} (${sanitize(entry.caseName)}) project=${entry.benchmarkProject} locality=${entry.taskLocality}`);
|
|
91
|
+
for (const treatment of entry.treatments) {
|
|
92
|
+
lines.push(` ${treatment.treatmentId}: status=${treatment.executionStatus} evidence=${treatment.evidenceAvailability}`, ` initial task success: ${formatAgentSuccessMetric(treatment.initialTaskSuccess)}; final task success: ${formatAgentSuccessMetric(treatment.finalTaskSuccess)}; attempts=${treatment.attemptCount}; repair attempts=${treatment.repairAttemptCount}; repair succeeded: ${formatAgentSuccessMetric(treatment.repairSucceeded)}`, ` task-check pass rate: ${formatAgentSuccessMetric(treatment.taskCheckPassRate)}; regression-check pass rate: ${formatAgentSuccessMetric(treatment.regressionCheckPassRate)}; required-fact coverage: ${formatAgentSuccessMetric(treatment.requiredFactCoverage)}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
section("G. Per-attempt repair history");
|
|
96
|
+
if (!realMode || report.repairHistory.length === 0) {
|
|
97
|
+
lines.push(realMode ? "No attempt history was recorded." : "Not applicable: deterministic-fixture mode runs a single fixture patch and no provider attempts.");
|
|
98
|
+
}
|
|
99
|
+
for (const history of report.repairHistory) {
|
|
100
|
+
lines.push(`Case ${history.caseId} / ${history.treatmentId}: ${history.attempts.length} attempt(s)`);
|
|
101
|
+
for (const attempt of history.attempts) {
|
|
102
|
+
lines.push(` attempt ${attempt.attemptNumber}: provider=${attempt.providerStatus}; patch=${attempt.patchOutcome}; verification=${attempt.verificationAvailability}; task success=${formatAgentSuccessMetric(attempt.taskSuccess)}; outcome=${attempt.failureCategory}${attempt.repairEligible ? " (repair-eligible)" : ""}`, ` duration: ${formatAgentSuccessMetric(attempt.providerDurationMs)}; tokens: ${attempt.tokenAvailability === "available" ? formatAgentSuccessMetric(attempt.providerTokens) : "unavailable"}`, ` artifacts: proposed patch=${attempt.proposedPatchPath ?? "none"}; applied patch=${attempt.appliedPatchPath ?? "none"}; agent files=${attempt.agentArtifactDirectory ?? "none"}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
section("H. Edit-quality and blast-radius measurements (final evaluated patch)");
|
|
106
|
+
for (const entry of report.cases) {
|
|
107
|
+
for (const treatment of entry.treatments) {
|
|
108
|
+
lines.push(`${entry.caseId} / ${treatment.treatmentId}: expected-edit coverage=${formatAgentSuccessMetric(treatment.expectedEditCoverage)}; edit-scope precision=${formatAgentSuccessMetric(treatment.editScopePrecision)}; unexpected changed files=${formatAgentSuccessMetric(treatment.unexpectedChangedFiles)}; protected mutations=${formatAgentSuccessMetric(treatment.protectedMutations)}`, ` changed files=${formatAgentSuccessMetric(treatment.changedFileCount)}${treatment.changedFiles ? ` [${treatment.changedFiles.items.join(", ")}${treatment.changedFiles.omittedCount > 0 ? `, +${treatment.changedFiles.omittedCount} more` : ""}]` : ""}; total churn=${formatAgentSuccessMetric(treatment.totalChurn)}; relative churn=${formatAgentSuccessMetric(treatment.relativeChurn)}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
section("I. Duration and token evidence");
|
|
112
|
+
for (const entry of report.cases) {
|
|
113
|
+
for (const treatment of entry.treatments) {
|
|
114
|
+
lines.push(`${entry.caseId} / ${treatment.treatmentId}: final-attempt provider duration=${formatAgentSuccessMetric(treatment.finalAttemptProviderDurationMs)}; final-attempt provider tokens=${formatAgentSuccessMetric(treatment.finalAttemptProviderTokens)}` +
|
|
115
|
+
(treatment.totalProviderDurationMs
|
|
116
|
+
? `; total provider duration across attempts=${formatAgentSuccessMetric(treatment.totalProviderDurationMs)}; total provider tokens across attempts=${formatAgentSuccessMetric(treatment.totalProviderTokens)}`
|
|
117
|
+
: ""));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const treatment of report.treatments) {
|
|
121
|
+
if (!treatment.repair)
|
|
122
|
+
continue;
|
|
123
|
+
for (const total of treatment.repair.providerDurationMs)
|
|
124
|
+
lines.push(`${treatment.treatmentId} provider duration [${AGENT_SUCCESS_BASIS_LABEL[total.basis] ?? total.basis}]: ${formatAgentSuccessTotal(total)}`);
|
|
125
|
+
for (const total of treatment.repair.providerTokens)
|
|
126
|
+
lines.push(`${treatment.treatmentId} provider tokens [${AGENT_SUCCESS_BASIS_LABEL[total.basis] ?? total.basis}]: ${formatAgentSuccessTotal(total)}`);
|
|
127
|
+
}
|
|
128
|
+
section("J. Warnings, failures and artifact references");
|
|
129
|
+
const errors = report.cases.flatMap((entry) => entry.treatments.flatMap((treatment) => treatment.errors.map((error) => ({ caseId: entry.caseId, treatmentId: treatment.treatmentId, ...error }))));
|
|
130
|
+
if (report.warnings.length === 0 && errors.length === 0)
|
|
131
|
+
lines.push("No warnings or recorded errors.");
|
|
132
|
+
for (const warning of report.warnings)
|
|
133
|
+
lines.push(`warning ${sanitize(warning.code)}: ${sanitize(warning.message)}`);
|
|
134
|
+
for (const error of errors)
|
|
135
|
+
lines.push(`error ${error.caseId} / ${error.treatmentId} attempt ${error.attemptNumber} ${sanitize(error.code)}: ${sanitize(error.message)}`);
|
|
136
|
+
for (const artifact of report.artifacts)
|
|
137
|
+
lines.push(`artifact ${sanitize(artifact.id)}: ${artifact.path ?? "[reference withheld]"}`);
|
|
138
|
+
return lines;
|
|
139
|
+
}
|
|
@@ -5,6 +5,7 @@ import { renderContextWindowScalingHtml } from "./renderContextWindowScalingHtml
|
|
|
5
5
|
import { renderRetrievalPrecisionRecallHtml } from "./renderRetrievalPrecisionRecallHtml.js";
|
|
6
6
|
import { renderRetrievalQueryStrategyComparisonHtml } from "./renderRetrievalQueryStrategyComparisonHtml.js";
|
|
7
7
|
import { renderContextPackGenerationHtml } from "./renderContextPackGenerationHtml.js";
|
|
8
|
+
import { renderAgentSuccessRateHtml } from "./renderAgentSuccessRateHtml.js";
|
|
8
9
|
export function renderPluginExperimentReportHtml(report) {
|
|
9
10
|
const redactedTarget = report.target.privacyProjection === "external-local-redacted";
|
|
10
11
|
return `<!DOCTYPE html>
|
|
@@ -115,6 +116,8 @@ export function renderPluginExperimentReportHtml(report) {
|
|
|
115
116
|
|
|
116
117
|
${renderContextPackGenerationHtml(report.contextPackGeneration ?? null)}
|
|
117
118
|
|
|
119
|
+
${renderAgentSuccessRateHtml(report.agentSuccessRate ?? null)}
|
|
120
|
+
|
|
118
121
|
<section>
|
|
119
122
|
<h2>Warnings, Skips, And Failures</h2>
|
|
120
123
|
${report.findings.length ? table(["Severity", "Code", "Message", "Variant", "Case"], report.findings.map((finding) => [
|
|
@@ -6,6 +6,7 @@ import { renderContextWindowScalingTextLines } from "./renderContextWindowScalin
|
|
|
6
6
|
import { renderRetrievalPrecisionRecallTextLines } from "./renderRetrievalPrecisionRecallText.js";
|
|
7
7
|
import { renderRetrievalQueryStrategyComparisonTextLines } from "./renderRetrievalQueryStrategyComparisonText.js";
|
|
8
8
|
import { renderContextPackGenerationTextLines } from "./renderContextPackGenerationText.js";
|
|
9
|
+
import { renderAgentSuccessRateTextLines } from "./renderAgentSuccessRateText.js";
|
|
9
10
|
function sanitizeScalar(value) {
|
|
10
11
|
const text = String(value);
|
|
11
12
|
let result = "";
|
|
@@ -691,6 +692,10 @@ export function renderPluginExperimentReportText(report) {
|
|
|
691
692
|
lines.push(...renderRetrievalQueryStrategyComparisonTextLines(retrievalQueryStrategyComparison));
|
|
692
693
|
}
|
|
693
694
|
// Additive: other plugins keep their existing text output unchanged.
|
|
695
|
+
const agentSuccessRate = report.agentSuccessRate ?? null;
|
|
696
|
+
if (agentSuccessRate !== null) {
|
|
697
|
+
lines.push(...renderAgentSuccessRateTextLines(agentSuccessRate));
|
|
698
|
+
}
|
|
694
699
|
const contextPackGeneration = report.contextPackGeneration ?? null;
|
|
695
700
|
if (contextPackGeneration !== null) {
|
|
696
701
|
pushSection(lines, "Context Pack Generation");
|
package/docs/METRICS.md
CHANGED
|
@@ -868,3 +868,73 @@ There is no composite score, winner, or ranking. Tests and call relationships ma
|
|
|
868
868
|
In external-local mode, analysis uses real identities before the privacy projection. Redacted placeholders never enter metric calculations. Durable external-local output has no pack body; the report preview presents redacted identities.
|
|
869
869
|
|
|
870
870
|
See [COMMANDS.md](COMMANDS.md#context-pack-generation-v082), [WORKFLOWS.md](WORKFLOWS.md#context-pack-generation-experiment), and [ARCHITECTURE.md](ARCHITECTURE.md#context-pack-generation-architecture-v082).
|
|
871
|
+
|
|
872
|
+
## Agent-success-rate metrics (v0.9.0)
|
|
873
|
+
|
|
874
|
+
Status: shipped in v0.9.0. The scientific owner of every per-treatment value is `analyzeAgentSuccessTreatment` in `src/experiments/plugins/agentSuccessRate/analysis.ts`; repair aggregation and paired differences are owned by `repairAnalysis.ts`. Values are persisted in `agent-success-rate-analysis.json` (schema `1.0.0`); `agent-success-rate-execution.json` holds the evidence they are computed from. `contextEffectEvaluated` is `false` in deterministic-fixture mode.
|
|
875
|
+
|
|
876
|
+
### Availability rules
|
|
877
|
+
|
|
878
|
+
Every metric is typed `available`, `unavailable`, or `not-applicable`, with a unit and, when not available, a reason.
|
|
879
|
+
|
|
880
|
+
- **Unavailable** means the evidence needed to compute the value does not exist (for example the provider reported no token usage, a check timed out, the patch was not applied, or the baseline was invalid). It is never converted to zero, never counted as a failure, and excluded from rates and means.
|
|
881
|
+
- **Not applicable** means the quantity is undefined by construction (for example a ratio whose denominator is zero, or `repairSucceeded` when no repair attempt ran).
|
|
882
|
+
- **Invalid baseline exclusion:** a treatment whose unmodified baseline is not evaluable (it needs at least one failing task check, all regression checks passing, and no check timing out or erroring) has no task-success verdict and is excluded from rates; this is a benchmark defect, not an agent failure.
|
|
883
|
+
- **Tri-state verdicts:** a verdict is true, false, or unknown. A failed check makes a conjunction false; otherwise a missing, timed-out, or errored check makes it unknown; only complete passing evidence makes it true.
|
|
884
|
+
|
|
885
|
+
### Task-success metrics
|
|
886
|
+
|
|
887
|
+
| Metric | Meaning and formula | Source, units, availability |
|
|
888
|
+
|---|---|---|
|
|
889
|
+
| `taskChecksPassed` | Every trusted task check passed on the changed state | boolean from post-edit verification; unknown if any task check is missing, timed out, or errored |
|
|
890
|
+
| `regressionSafe` | Every regression check that passed on the baseline still passes | boolean; only baseline-passing regression checks are considered |
|
|
891
|
+
| `requiredFactsSatisfied` | Every behavior fact marked required has all its verification checks passing | boolean |
|
|
892
|
+
| `protectedIntegrity` | Protected files are byte-intact after the patch | boolean from the protected-integrity comparison |
|
|
893
|
+
| `taskResolved` | `taskChecksPassed` AND `requiredFactsSatisfied` | boolean |
|
|
894
|
+
| `taskSuccess` | `taskResolved` AND `regressionSafe` AND `protectedIntegrity` intact. A patch that was rejected or not applied yields false; an uncomputable verdict yields unavailable | boolean; the only success verdict; agent prose is never evidence |
|
|
895
|
+
| `initialAttemptTaskSuccess` | `taskSuccess` of attempt 1 | boolean; real-agent repair evidence only |
|
|
896
|
+
| `finalTaskSuccess` | `taskSuccess` of the last attempt executed | boolean; equals `taskSuccess` |
|
|
897
|
+
| `repairSucceeded` | `initialAttemptTaskSuccess` is false AND `finalTaskSuccess` is true | boolean; not applicable when no repair attempt ran; unavailable if either verdict is unavailable |
|
|
898
|
+
| `repairSuccessRate` (aggregate) | repaired cases / repair-attempted cases with a determinate repair verdict | ratio; not applicable when no repair attempt ran for the treatment |
|
|
899
|
+
| `taskSuccessRate`, `initialAttemptSuccessRate`, `finalTaskSuccessRate` (aggregates) | successful cases / cases with a determinate verdict for that attempt basis | ratio; unavailable when no case has a determinate verdict |
|
|
900
|
+
|
|
901
|
+
First versus final attempt: `initialAttemptSuccessRate` and `finalTaskSuccessRate` are separate measurements. A repaired success raises the final rate and never the initial rate. Without repair evidence a single attempt makes the two equal.
|
|
902
|
+
|
|
903
|
+
### Check, fact, and edit-quality metrics
|
|
904
|
+
|
|
905
|
+
| Metric | Formula | Numerator / denominator | Notes |
|
|
906
|
+
|---|---|---|---|
|
|
907
|
+
| `taskCheckPassRate` | passed task checks / task checks | `taskCheckPassedCount` / `taskCheckTotalCount` | unavailable unless every task check has a complete result; not applicable with zero checks |
|
|
908
|
+
| `regressionCheckPassRate` | passed regression checks / regression checks | `regressionCheckPassedCount` / `regressionCheckTotalCount` | `regressionFailureCount` counts failed checks that passed on the baseline |
|
|
909
|
+
| `requiredFactCoverage` | satisfied required facts / required facts | `requiredFactsSatisfiedCount` / `requiredFactsTotal` | not applicable with no required facts |
|
|
910
|
+
| `factCoverage` | satisfied facts (required and optional) / all facts | satisfied / total facts | not applicable with no facts |
|
|
911
|
+
| `expectedEditCoverage` | changed files that were expected / expected edit files | `expectedEditFilesChangedCount` / `expectedEditFileCount` | ratio |
|
|
912
|
+
| `editScopePrecision` | changed files inside the allowed edit scope / changed files | `allowedEditChangedFileCount` / `changedFileCount` | not applicable when no file changed |
|
|
913
|
+
| `unexpectedChangedFileCount` | changed files minus changed files inside the allowed scope | count | files outside the allowed scope |
|
|
914
|
+
| `protectedMutationCount` | protected paths found mutated after the patch | count | unavailable if integrity could not be proven; `attemptedProtectedEditCount` counts protected paths a patch tried to edit |
|
|
915
|
+
| `changedFileCount`, `addedFileCount`, `modifiedFileCount`, `deletedFileCount` | counts of captured changed files by status | count | from the changed-file capture of the final attempt |
|
|
916
|
+
| `linesAdded`, `linesDeleted` | sums of per-file additions and deletions | lines | unavailable if any changed file has no line counts (binary); never estimated |
|
|
917
|
+
| `totalChurn` | `linesAdded` + `linesDeleted` | lines | the final patch's churn, not the churn accumulated over repair attempts |
|
|
918
|
+
| `relativeChurn` | `totalChurn` / `baselineTextLineCount` | ratio | unavailable when the baseline text-line count is unknown; not applicable at zero baseline lines |
|
|
919
|
+
|
|
920
|
+
Edit-quality and blast-radius metrics describe the final attempt only. A treatment that never applied a patch has these metrics unavailable, not zero.
|
|
921
|
+
|
|
922
|
+
### Time and token metrics
|
|
923
|
+
|
|
924
|
+
| Metric | Meaning | Source and caveat |
|
|
925
|
+
|---|---|---|
|
|
926
|
+
| `agentDurationMs` | Measured wall-clock duration of the provider attempt | unavailable in deterministic mode and when no provider ran; for repair runs, `firstAttemptProviderDurationMs`, `finalAttemptProviderDurationMs`, and `totalProviderDurationMs` are reported separately |
|
|
927
|
+
| `totalProviderDurationMs` | Sum of provider durations over attempts that ran | unavailable if any invoked attempt was not measured |
|
|
928
|
+
| `agentTotalTokens` (provider token usage) | Provider-reported total token usage for the attempt | unavailable when the provider reported none (source and reliability are recorded); `totalProviderTokens` sums over attempts and is unavailable if any invoked attempt lacks a total |
|
|
929
|
+
| `estimatedContextTokens` | Estimated size of the context supplied to the provider | a size estimate recorded in execution evidence, not provider-reported usage; never substituted for provider tokens |
|
|
930
|
+
| `baselineVerificationDurationMs`, `patchPipelineDurationMs`, `postEditVerificationDurationMs`, `evaluationDurationMs` | Measured durations of the evaluator's own stages | milliseconds; `totalEvaluationDurationMs` sums attempts |
|
|
931
|
+
|
|
932
|
+
Cumulative versus final: durations and tokens accumulate over all provider attempts (repair costs are included), while edit-quality and blast-radius metrics describe only the final patch.
|
|
933
|
+
|
|
934
|
+
### Paired comparisons and means
|
|
935
|
+
|
|
936
|
+
- Aggregate means (`meanTaskCheckPassRate`, `meanEditScopePrecision`, `meanTotalChurn`, and the other `mean*` entries) are unweighted arithmetic means over **matched** cases: cases for which the source metric is available in every treatment. Unavailable values are not converted to zero. A mean with no matched case is unavailable.
|
|
937
|
+
- The matched comparison counts, over cases with a determinate verdict in both treatments, `bothSucceeded`, `onlyRawFullFileSucceeded`, `onlyContextPackSucceeded`, and `neitherSucceeded`; incomplete cases are listed separately with the unavailable treatment IDs. With repair evidence a second matched comparison uses initial-attempt success.
|
|
938
|
+
- Paired differences report the mean of the `raw-full-file` values, the mean of the `context-pack` values, and the mean of `context-pack` minus `raw-full-file` over matched cases.
|
|
939
|
+
- These are **descriptive**. No weighted composite score, ranking, automatic winner, causal claim, or statistical-significance test is produced (`statisticalEffect` is `not-assessed`). The corpus is finite and controlled, so results do not generalize beyond it, and a single run carries no variance estimate.
|
|
940
|
+
- Provider telemetry can be unavailable, and in deterministic-fixture mode both treatments receive the same reference patch, so those results measure the pipeline only.
|