agentxchain 2.155.41 → 2.155.43

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentxchain",
3
- "version": "2.155.41",
3
+ "version": "2.155.43",
4
4
  "description": "CLI for AgentXchain — governed multi-agent software delivery",
5
5
  "type": "module",
6
6
  "bin": {
@@ -494,7 +494,7 @@ function renderPrompt(role, roleId, turn, state, config, root) {
494
494
  lines.push('- `summary`: concise description of what you did this turn');
495
495
  lines.push('- `decisions[].id`: pattern `DEC-NNN` (increment from previous turn)');
496
496
  lines.push('- `decisions[].category`: one of `implementation`, `architecture`, `scope`, `process`, `quality`, `release`');
497
- lines.push('- `objections[].id`: pattern `OBJ-NNN`');
497
+ lines.push('- `objections[].id`: pattern `OBJ-NNN` where NNN is digits only (e.g. `OBJ-001`, `OBJ-002`). Do NOT append extra suffixes like `-M31` or use non-numeric characters after `OBJ-`.');
498
498
  lines.push('- `objections[].severity`: one of `low`, `medium`, `high`, `blocking`');
499
499
  lines.push('- `verification.status`: one of `pass`, `fail`, `skipped`');
500
500
  lines.push('- `verification.status: "pass"` is valid only when every `verification.machine_evidence[].exit_code` is `0`');
@@ -1048,26 +1048,45 @@ export function normalizeTurnResult(tr, config, context = {}) {
1048
1048
  if (objection === null || typeof objection !== 'object' || Array.isArray(objection)) {
1049
1049
  return objection;
1050
1050
  }
1051
- const statement = typeof objection.statement === 'string' ? objection.statement.trim() : '';
1051
+
1052
+ let patched = objection;
1053
+
1054
+ // ── BUG-89: normalize invalid objection IDs to OBJ-NNN ──────────
1055
+ const validIdPattern = /^OBJ-\d+$/;
1056
+ const currentId = typeof patched.id === 'string' ? patched.id : '';
1057
+ if (!validIdPattern.test(currentId)) {
1058
+ const normalizedId = `OBJ-${String(index + 1).padStart(3, '0')}`;
1059
+ corrections.push(`objections[${index}].id: rewritten "${currentId || '(missing)'}" → ${normalizedId}`);
1060
+ normalizationEvents.push({
1061
+ field: `objections[${index}].id`,
1062
+ original_value: patched.id ?? null,
1063
+ normalized_value: normalizedId,
1064
+ rationale: 'invalid_objection_id_rewritten',
1065
+ });
1066
+ patched = { ...patched, id: normalizedId };
1067
+ }
1068
+
1069
+ // ── BUG-79: normalize missing statement from summary/detail ─────
1070
+ const statement = typeof patched.statement === 'string' ? patched.statement.trim() : '';
1052
1071
  if (statement) {
1053
- return objection;
1072
+ return patched;
1054
1073
  }
1055
- const summary = typeof objection.summary === 'string' ? objection.summary.trim() : '';
1056
- const detail = typeof objection.detail === 'string' ? objection.detail.trim() : '';
1074
+ const summary = typeof patched.summary === 'string' ? patched.summary.trim() : '';
1075
+ const detail = typeof patched.detail === 'string' ? patched.detail.trim() : '';
1057
1076
  const sourceField = summary ? 'summary' : detail ? 'detail' : null;
1058
1077
  const sourceValue = summary || detail;
1059
1078
  if (!sourceField) {
1060
- return objection;
1079
+ return patched;
1061
1080
  }
1062
1081
  corrections.push(`objections[${index}].statement: copied from ${sourceField}`);
1063
1082
  normalizationEvents.push({
1064
1083
  field: `objections[${index}].statement`,
1065
- original_value: objection.statement ?? null,
1084
+ original_value: patched.statement ?? null,
1066
1085
  normalized_value: sourceValue,
1067
1086
  rationale: `copied_from_${sourceField}`,
1068
1087
  });
1069
1088
  return {
1070
- ...objection,
1089
+ ...patched,
1071
1090
  statement: sourceValue,
1072
1091
  };
1073
1092
  });