agentxchain 2.155.1 → 2.155.3

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.1",
3
+ "version": "2.155.3",
4
4
  "description": "CLI for AgentXchain — governed multi-agent software delivery",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1155,7 +1155,30 @@ export async function advanceContinuousRunOnce(context, session, contOpts, execu
1155
1155
  return { ok: true, status: 'session_budget', action: 'session_budget_exhausted', stop_reason: 'session_budget' };
1156
1156
  }
1157
1157
 
1158
- // Idle-cycle check: on_idle policy determines behavior
1158
+ reconcileContinuousStartupState(context, session, contOpts, log);
1159
+
1160
+ const reconcileBlock = maybeAutoReconcileOperatorCommits(context, session, contOpts, log);
1161
+ if (reconcileBlock) return reconcileBlock;
1162
+
1163
+ const startupGovernedState = loadProjectState(root, context.config);
1164
+ if (startupGovernedState?.status === 'blocked') {
1165
+ const retried = await maybeAutoRetryGhostBlocker(context, session, contOpts, startupGovernedState, log);
1166
+ if (retried) return retried;
1167
+ session.status = 'paused';
1168
+ writeContinuousSession(root, session);
1169
+ return {
1170
+ ok: true,
1171
+ status: 'blocked',
1172
+ action: 'still_blocked',
1173
+ run_id: session.current_run_id || startupGovernedState.run_id || null,
1174
+ recovery_action: getBlockedRecoveryAction(startupGovernedState),
1175
+ blocked_category: getBlockedCategory(startupGovernedState),
1176
+ };
1177
+ }
1178
+
1179
+ // Idle-cycle check: on_idle policy determines behavior. This MUST run after
1180
+ // startup blocked/reconcile checks so perpetual mode cannot enqueue new
1181
+ // idle-expansion work into a run that is already ineligible to start.
1159
1182
  if (session.idle_cycles >= contOpts.maxIdleCycles) {
1160
1183
  if (contOpts.onIdle === 'perpetual' && contOpts.idleExpansion) {
1161
1184
  // BUG-60: perpetual mode — dispatch PM idle-expansion instead of exiting
@@ -1193,11 +1216,6 @@ export async function advanceContinuousRunOnce(context, session, contOpts, execu
1193
1216
  return { ok: true, status: 'idle_exit', action: 'max_idle_reached', stop_reason: 'idle_exit' };
1194
1217
  }
1195
1218
 
1196
- reconcileContinuousStartupState(context, session, contOpts, log);
1197
-
1198
- const reconcileBlock = maybeAutoReconcileOperatorCommits(context, session, contOpts, log);
1199
- if (reconcileBlock) return reconcileBlock;
1200
-
1201
1219
  // Paused-session guard: if session is paused (blocked run awaiting unblock),
1202
1220
  // check governed state before attempting to advance. Without this guard, the
1203
1221
  // loop would try to startIntent() on a blocked project, hit the blocked-state
@@ -10,6 +10,16 @@ const CRITICAL_DELETION_PATHS = new Set([
10
10
  '.planning/acceptance-matrix.md',
11
11
  ]);
12
12
 
13
+ // Files under .agentxchain/ that are documentation or operator-customizable
14
+ // configuration, NOT core governed state. Modifications to these should not
15
+ // block operator-commit reconciliation.
16
+ const RECONCILE_SAFE_AGENTXCHAIN_PATHS = new Set([
17
+ '.agentxchain/SESSION_RECOVERY.md',
18
+ ]);
19
+ const RECONCILE_SAFE_AGENTXCHAIN_PREFIXES = [
20
+ '.agentxchain/prompts/',
21
+ ];
22
+
13
23
  function git(root, args) {
14
24
  return execFileSync('git', args, {
15
25
  cwd: root,
@@ -90,16 +100,26 @@ function summarizeCommit(root, sha) {
90
100
  };
91
101
  }
92
102
 
103
+ function isReconcileSafeAgentxchainPath(pathName) {
104
+ if (RECONCILE_SAFE_AGENTXCHAIN_PATHS.has(pathName)) return true;
105
+ for (const prefix of RECONCILE_SAFE_AGENTXCHAIN_PREFIXES) {
106
+ if (pathName.startsWith(prefix)) return true;
107
+ }
108
+ return false;
109
+ }
110
+
93
111
  function classifyUnsafeCommit(commit) {
94
112
  for (const entry of commit.name_status) {
95
113
  for (const pathName of entry.paths) {
96
114
  if (pathName === '.agentxchain' || pathName.startsWith('.agentxchain/')) {
97
- return {
98
- error_class: 'governance_state_modified',
99
- message: `Commit ${commit.sha.slice(0, 8)} modifies governed state path ${pathName}; reconcile cannot auto-accept .agentxchain edits.`,
100
- commit: commit.sha,
101
- path: pathName,
102
- };
115
+ if (!isReconcileSafeAgentxchainPath(pathName)) {
116
+ return {
117
+ error_class: 'governance_state_modified',
118
+ message: `Commit ${commit.sha.slice(0, 8)} modifies governed state path ${pathName}; reconcile cannot auto-accept .agentxchain edits.`,
119
+ commit: commit.sha,
120
+ path: pathName,
121
+ };
122
+ }
103
123
  }
104
124
  if (entry.status.startsWith('D') && CRITICAL_DELETION_PATHS.has(pathName)) {
105
125
  return {
@@ -239,6 +259,8 @@ export function reconcileOperatorHead(root, opts = {}) {
239
259
  safety_checks: {
240
260
  baseline_is_ancestor: true,
241
261
  rejected_state_paths: ['.agentxchain/'],
262
+ reconcile_safe_paths: [...RECONCILE_SAFE_AGENTXCHAIN_PATHS],
263
+ reconcile_safe_prefixes: [...RECONCILE_SAFE_AGENTXCHAIN_PREFIXES],
242
264
  rejected_deletions: [...CRITICAL_DELETION_PATHS],
243
265
  },
244
266
  },