agentxchain 2.155.5 → 2.155.7
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 +1 -1
- package/src/lib/continuous-run.js +15 -0
- package/src/lib/governed-state.js +56 -0
package/package.json
CHANGED
|
@@ -762,6 +762,21 @@ async function dispatchIdleExpansion(context, session, contOpts, absVisionPath,
|
|
|
762
762
|
`- Every proposed intent MUST cite at least one VISION.md heading from the snapshot below.`,
|
|
763
763
|
`- Output MUST be a structured idle_expansion_result (new_intake_intent or vision_exhausted).`,
|
|
764
764
|
``,
|
|
765
|
+
`OUTPUT FORMAT — you MUST do one of these:`,
|
|
766
|
+
`(a) Include "idle_expansion_result" as a top-level key in your turn-result.json, OR`,
|
|
767
|
+
`(b) Save the result as a sibling file named idle-expansion-result.json next to your turn-result.json in the staging directory.`,
|
|
768
|
+
``,
|
|
769
|
+
`The JSON object MUST have this shape:`,
|
|
770
|
+
` { "kind": "new_intake_intent", "expansion_iteration": ${currentIteration},`,
|
|
771
|
+
` "title": "...", "priority": "p1|p2|p3", "template": "generic",`,
|
|
772
|
+
` "charter": "...", "acceptance_contract": ["criterion 1", ...],`,
|
|
773
|
+
` "vision_traceability": { "headings": ["heading from snapshot"], "rationale": "..." } }`,
|
|
774
|
+
`OR:`,
|
|
775
|
+
` { "kind": "vision_exhausted", "expansion_iteration": ${currentIteration},`,
|
|
776
|
+
` "headings": [{"heading": "...", "status": "complete|deferred|out_of_scope", "reason": "..."}] }`,
|
|
777
|
+
``,
|
|
778
|
+
`Do NOT just describe the result in text — you must produce the actual JSON object.`,
|
|
779
|
+
``,
|
|
765
780
|
`VISION headings snapshot:`,
|
|
766
781
|
visionHeadings || ' (none captured)',
|
|
767
782
|
``,
|
|
@@ -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,
|