agentxchain 2.155.59 → 2.155.60
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/package.json
CHANGED
|
@@ -1421,6 +1421,47 @@ export function normalizeTurnResult(tr, config, context = {}) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
|
+
// ── BUG-106: auto-declare expected_exit_code when verification.status is "pass" ──
|
|
1425
|
+
// When verification.status is "pass" but some machine_evidence commands have
|
|
1426
|
+
// non-zero exit codes without expected_exit_code, the agent clearly intended
|
|
1427
|
+
// those failures (e.g. testing error handling). Auto-set expected_exit_code to
|
|
1428
|
+
// match exit_code so the Stage D validator passes. This is safe because the
|
|
1429
|
+
// agent explicitly declared the overall verification as passing.
|
|
1430
|
+
if (
|
|
1431
|
+
normalized.verification
|
|
1432
|
+
&& typeof normalized.verification === 'object'
|
|
1433
|
+
&& !Array.isArray(normalized.verification)
|
|
1434
|
+
&& normalized.verification.status === 'pass'
|
|
1435
|
+
&& Array.isArray(normalized.verification.machine_evidence)
|
|
1436
|
+
) {
|
|
1437
|
+
const patchedEvidence = [];
|
|
1438
|
+
let anyPatched = false;
|
|
1439
|
+
normalized.verification.machine_evidence.forEach((entry, index) => {
|
|
1440
|
+
if (
|
|
1441
|
+
entry
|
|
1442
|
+
&& typeof entry === 'object'
|
|
1443
|
+
&& typeof entry.exit_code === 'number'
|
|
1444
|
+
&& entry.exit_code !== 0
|
|
1445
|
+
&& !Number.isInteger(entry.expected_exit_code)
|
|
1446
|
+
) {
|
|
1447
|
+
patchedEvidence.push({ ...entry, expected_exit_code: entry.exit_code });
|
|
1448
|
+
anyPatched = true;
|
|
1449
|
+
corrections.push(`verification.machine_evidence[${index}].expected_exit_code: set to ${entry.exit_code} (verification.status is "pass")`);
|
|
1450
|
+
normalizationEvents.push({
|
|
1451
|
+
field: `verification.machine_evidence[${index}].expected_exit_code`,
|
|
1452
|
+
original_value: null,
|
|
1453
|
+
normalized_value: entry.exit_code,
|
|
1454
|
+
rationale: 'verification_pass_expected_exit_code_inferred',
|
|
1455
|
+
});
|
|
1456
|
+
} else {
|
|
1457
|
+
patchedEvidence.push(entry);
|
|
1458
|
+
}
|
|
1459
|
+
});
|
|
1460
|
+
if (anyPatched) {
|
|
1461
|
+
normalized.verification = { ...normalized.verification, machine_evidence: patchedEvidence };
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1424
1465
|
// ── BUG-90: normalize missing artifact.type ─────────────────────────
|
|
1425
1466
|
if (
|
|
1426
1467
|
normalized.artifact
|