agentxchain 2.155.31 → 2.155.32
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/governed-state.js +44 -22
package/package.json
CHANGED
|
@@ -4701,29 +4701,51 @@ function _acceptGovernedTurnLocked(root, config, opts) {
|
|
|
4701
4701
|
|
|
4702
4702
|
const gateSemanticMode = config.gate_semantic_coverage_mode || 'strict';
|
|
4703
4703
|
if (uncoveredFiles.length > 0 && gateSemanticMode === 'strict') {
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4704
|
+
// BUG-81: In planning phase only, auto-strip the phase transition request
|
|
4705
|
+
// instead of permanently blocking. PM's partial planning work is preserved;
|
|
4706
|
+
// the phase stays in "planning" and the continuous loop re-dispatches PM to
|
|
4707
|
+
// complete gate artifacts. In implementation+ phases, gate failures still
|
|
4708
|
+
// reject — dev/qa claiming readiness without updating gate files is a real error.
|
|
4709
|
+
if (turnResult.phase_transition_request && state.phase === 'planning') {
|
|
4710
|
+
emitRunEvent(root, 'gate_transition_request_auto_stripped', {
|
|
4711
|
+
run_id: state.run_id,
|
|
4712
|
+
phase: state.phase,
|
|
4713
|
+
status: state.status,
|
|
4714
|
+
turn: { turn_id: currentTurn.turn_id, role_id: currentTurn.assigned_role },
|
|
4715
|
+
payload: {
|
|
4716
|
+
gate_id: exitGateId,
|
|
4717
|
+
uncovered_files: uncoveredFiles,
|
|
4718
|
+
declared_files: [...declaredFiles],
|
|
4719
|
+
rationale: 'Turn did not modify gate-required files; phase transition stripped to preserve partial planning work',
|
|
4720
|
+
},
|
|
4721
|
+
});
|
|
4722
|
+
delete turnResult.phase_transition_request;
|
|
4723
|
+
// Fall through — continue with acceptance without the phase transition
|
|
4724
|
+
} else {
|
|
4725
|
+
const coverageError = `Gate "${exitGateId}" is failing on ${uncoveredFiles.join(', ')}. Your turn did not modify ${uncoveredFiles.length === 1 ? 'that file' : 'those files'}. Either edit the file(s) to satisfy the gate, or remove the phase transition request.`;
|
|
4726
|
+
transitionToFailedAcceptance(root, state, currentTurn, coverageError, {
|
|
4727
|
+
error_code: 'gate_semantic_coverage',
|
|
4721
4728
|
stage: 'gate_semantic_coverage',
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4729
|
+
extra: {
|
|
4730
|
+
gate_id: exitGateId,
|
|
4731
|
+
uncovered_files: uncoveredFiles,
|
|
4732
|
+
declared_files: [...declaredFiles],
|
|
4733
|
+
gate_reasons: preGateResult.reasons,
|
|
4734
|
+
},
|
|
4735
|
+
});
|
|
4736
|
+
return {
|
|
4737
|
+
ok: false,
|
|
4738
|
+
error: coverageError,
|
|
4739
|
+
validation: {
|
|
4740
|
+
...validation,
|
|
4741
|
+
ok: false,
|
|
4742
|
+
stage: 'gate_semantic_coverage',
|
|
4743
|
+
error_class: 'gate_coverage_error',
|
|
4744
|
+
errors: uncoveredFiles.map(f => `Gate "${exitGateId}" is failing on "${f}". Your turn did not modify that file.`),
|
|
4745
|
+
warnings: [],
|
|
4746
|
+
},
|
|
4747
|
+
};
|
|
4748
|
+
}
|
|
4727
4749
|
}
|
|
4728
4750
|
}
|
|
4729
4751
|
}
|