agentxchain 2.155.4 → 2.155.6

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.4",
3
+ "version": "2.155.6",
4
4
  "description": "CLI for AgentXchain — governed multi-agent software delivery",
5
5
  "type": "module",
6
6
  "bin": {
@@ -6723,6 +6723,12 @@ function evaluateIntentCoverage(turnResult, intakeContext, { state = null, confi
6723
6723
  continue;
6724
6724
  }
6725
6725
 
6726
+ const idleExpansionCoverage = evaluateIdleExpansionConditionalCoverage(item, turnResult, intakeContext);
6727
+ if (idleExpansionCoverage === true) {
6728
+ addressed.push(item);
6729
+ continue;
6730
+ }
6731
+
6726
6732
  // Check 1: Structural — intent_response field with explicit status
6727
6733
  const structuralEntry = responseMap.get(normalizedItem);
6728
6734
  if (structuralEntry && ['addressed', 'deferred', 'rejected'].includes(structuralEntry.status)) {
@@ -6748,6 +6754,56 @@ function evaluateIntentCoverage(turnResult, intakeContext, { state = null, confi
6748
6754
  return { addressed, unaddressed };
6749
6755
  }
6750
6756
 
6757
+ function evaluateIdleExpansionConditionalCoverage(item, turnResult, intakeContext) {
6758
+ if (intakeContext?.source !== 'vision_idle_expansion') {
6759
+ return null;
6760
+ }
6761
+
6762
+ const result = turnResult?.idle_expansion_result;
6763
+ if (!result || typeof result !== 'object' || Array.isArray(result)) {
6764
+ return null;
6765
+ }
6766
+
6767
+ const normalizedItem = typeof item === 'string' ? item.toLowerCase().trim() : '';
6768
+ if (normalizedItem.startsWith('if new_intake_intent')) {
6769
+ if (result.kind !== 'new_intake_intent') {
6770
+ return true;
6771
+ }
6772
+
6773
+ const intent = result.new_intake_intent;
6774
+ return Boolean(
6775
+ intent
6776
+ && typeof intent === 'object'
6777
+ && !Array.isArray(intent)
6778
+ && typeof intent.charter === 'string'
6779
+ && intent.charter.trim()
6780
+ && Array.isArray(intent.acceptance_contract)
6781
+ && intent.acceptance_contract.length > 0
6782
+ && typeof intent.priority === 'string'
6783
+ && intent.priority.trim()
6784
+ && Array.isArray(result.vision_traceability)
6785
+ && result.vision_traceability.length > 0,
6786
+ );
6787
+ }
6788
+
6789
+ if (normalizedItem.startsWith('if vision_exhausted')) {
6790
+ if (result.kind !== 'vision_exhausted') {
6791
+ return true;
6792
+ }
6793
+
6794
+ const exhausted = result.vision_exhausted;
6795
+ return Boolean(
6796
+ exhausted
6797
+ && typeof exhausted === 'object'
6798
+ && !Array.isArray(exhausted)
6799
+ && Array.isArray(exhausted.classification)
6800
+ && exhausted.classification.length > 0,
6801
+ );
6802
+ }
6803
+
6804
+ return null;
6805
+ }
6806
+
6751
6807
  export {
6752
6808
  STATE_PATH,
6753
6809
  HISTORY_PATH,
@@ -562,7 +562,7 @@ function normalizeIdleExpansionSidecar(sidecar, context) {
562
562
  };
563
563
  }
564
564
 
565
- return result;
565
+ return normalizeIdleExpansionMutualExclusionSentinel(result).value;
566
566
  }
567
567
 
568
568
  function normalizeVisionTraceabilityForTurnResult(traceability) {
@@ -1020,6 +1020,14 @@ export function normalizeTurnResult(tr, config, context = {}) {
1020
1020
  normalized.artifacts_created = coerced;
1021
1021
  }
1022
1022
 
1023
+ const idleExpansionCleanup = normalizeIdleExpansionMutualExclusionSentinel(
1024
+ normalized.idle_expansion_result,
1025
+ );
1026
+ if (idleExpansionCleanup.changed) {
1027
+ normalized.idle_expansion_result = idleExpansionCleanup.value;
1028
+ corrections.push(idleExpansionCleanup.correction);
1029
+ }
1030
+
1023
1031
  // ── Rule 2: exit-gate-as-phase auto-correction ────────────────────────
1024
1032
  const gates = config?.gates;
1025
1033
  if (
@@ -1173,6 +1181,28 @@ export function normalizeTurnResult(tr, config, context = {}) {
1173
1181
  return { normalized, corrections };
1174
1182
  }
1175
1183
 
1184
+ function normalizeIdleExpansionMutualExclusionSentinel(result) {
1185
+ if (!result || typeof result !== 'object' || Array.isArray(result)) {
1186
+ return { changed: false, value: result, correction: '' };
1187
+ }
1188
+
1189
+ if (
1190
+ result.kind === 'new_intake_intent'
1191
+ && ('vision_exhausted' in result)
1192
+ && (result.vision_exhausted === false || result.vision_exhausted === null)
1193
+ ) {
1194
+ const normalized = { ...result };
1195
+ delete normalized.vision_exhausted;
1196
+ return {
1197
+ changed: true,
1198
+ value: normalized,
1199
+ correction: 'idle_expansion_result.vision_exhausted: removed false sentinel for new_intake_intent',
1200
+ };
1201
+ }
1202
+
1203
+ return { changed: false, value: result, correction: '' };
1204
+ }
1205
+
1176
1206
  // ── Helpers ──────────────────────────────────────────────────────────────────
1177
1207
 
1178
1208
  function result(stage, errorClass, errors, warnings = []) {