agentxchain 2.155.20 → 2.155.21

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.20",
3
+ "version": "2.155.21",
4
4
  "description": "CLI for AgentXchain — governed multi-agent software delivery",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3312,8 +3312,39 @@ export function initializeGovernedRun(root, config, options = {}) {
3312
3312
  }
3313
3313
  }
3314
3314
 
3315
+ // BUG-74: When a new run starts from an idle-expansion-derived intent,
3316
+ // set charter_materialization_pending so the first PM turn receives the
3317
+ // "You MUST create or update these planning artifacts" directive.
3318
+ const intakeCtx = options.intakeContext;
3319
+ if (intakeCtx?.category === 'pm_idle_expansion_derived') {
3320
+ updatedState.charter_materialization_pending = {
3321
+ charter: intakeCtx.charter || null,
3322
+ acceptance_contract: Array.isArray(intakeCtx.acceptance_contract)
3323
+ ? intakeCtx.acceptance_contract
3324
+ : [],
3325
+ suppressed_transition: 'implementation',
3326
+ source_turn_id: null,
3327
+ recorded_at: new Date().toISOString(),
3328
+ };
3329
+ }
3330
+
3315
3331
  writeState(root, updatedState);
3316
3332
 
3333
+ // BUG-74: emit event so consumers know materialization is required from run start
3334
+ if (updatedState.charter_materialization_pending) {
3335
+ emitRunEvent(root, 'charter_materialization_required', {
3336
+ run_id: runId,
3337
+ phase: updatedState.phase,
3338
+ status: 'active',
3339
+ payload: {
3340
+ suppressed_transition: 'implementation',
3341
+ reason: 'New run from idle-expansion-derived intent must materialize charter into planning artifacts.',
3342
+ new_intake_charter: updatedState.charter_materialization_pending.charter,
3343
+ source: 'run_initialization',
3344
+ },
3345
+ });
3346
+ }
3347
+
3317
3348
  const startupIntents = archiveStaleIntentsForRun(root, runId, {
3318
3349
  protocolVersion: updatedState.protocol_version || '2.x',
3319
3350
  });
package/src/lib/intake.js CHANGED
@@ -1139,6 +1139,7 @@ export function startIntent(root, intentId, options = {}) {
1139
1139
  const initResult = initializeGovernedRun(root, config, {
1140
1140
  provenance: startProvenance,
1141
1141
  allow_terminal_restart: allowCompletedRestart,
1142
+ intakeContext,
1142
1143
  });
1143
1144
  if (!initResult.ok) {
1144
1145
  return { ok: false, error: `run initialization failed: ${initResult.error}`, exitCode: 1 };