agentxchain 2.128.0 → 2.130.0

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.
Files changed (38) hide show
  1. package/README.md +2 -0
  2. package/bin/agentxchain.js +38 -4
  3. package/package.json +1 -1
  4. package/scripts/verify-post-publish.sh +55 -5
  5. package/src/commands/accept-turn.js +14 -0
  6. package/src/commands/checkpoint-turn.js +35 -0
  7. package/src/commands/connector.js +17 -2
  8. package/src/commands/doctor.js +151 -1
  9. package/src/commands/events.js +7 -1
  10. package/src/commands/init.js +42 -11
  11. package/src/commands/inject.js +1 -1
  12. package/src/commands/mission.js +803 -7
  13. package/src/commands/reissue-turn.js +122 -0
  14. package/src/commands/reject-turn.js +60 -6
  15. package/src/commands/restart.js +81 -10
  16. package/src/commands/resume.js +20 -9
  17. package/src/commands/run.js +13 -0
  18. package/src/commands/status.js +58 -4
  19. package/src/commands/step.js +49 -10
  20. package/src/commands/validate.js +78 -20
  21. package/src/lib/cli-version.js +106 -0
  22. package/src/lib/connector-probe.js +146 -5
  23. package/src/lib/continuous-run.js +22 -87
  24. package/src/lib/coordinator-dispatch.js +25 -0
  25. package/src/lib/dispatch-bundle.js +39 -0
  26. package/src/lib/governed-state.js +624 -11
  27. package/src/lib/governed-templates.js +1 -0
  28. package/src/lib/intake.js +233 -77
  29. package/src/lib/mission-plans.js +510 -6
  30. package/src/lib/missions.js +65 -6
  31. package/src/lib/normalized-config.js +50 -15
  32. package/src/lib/repo-observer.js +8 -2
  33. package/src/lib/run-events.js +5 -0
  34. package/src/lib/run-loop.js +25 -0
  35. package/src/lib/runner-interface.js +2 -0
  36. package/src/lib/session-checkpoint.js +18 -2
  37. package/src/lib/turn-checkpoint.js +221 -0
  38. package/src/templates/governed/full-local-cli.json +71 -0
@@ -257,9 +257,11 @@ You are QA. Your mandate: **${role.mandate}**
257
257
  - \`.planning/ship-verdict.md\` — your overall ship/no-ship recommendation
258
258
  - \`.planning/RELEASE_NOTES.md\` — user-facing release notes with impact and verification summary
259
259
 
260
- ## You Cannot Modify Code
260
+ ## File Access
261
261
 
262
- You have \`review_only\` write authority. You may NOT modify product files. You may only create/modify files under \`.planning/\` and \`.agentxchain/reviews/\`. Your artifact type must be \`review\`.
262
+ ${role.write_authority === 'review_only'
263
+ ? 'You have `review_only` write authority. You may NOT modify product files. You may only create/modify files under `.planning/` and `.agentxchain/reviews/`. Your artifact type must be `review`.'
264
+ : 'You have direct write access for this role. Use it to create or update QA-owned evidence and verification artifacts directly in the repo. Do not make unrelated product changes. Your artifact type should normally be `workspace` when you modify repo files directly.'}
263
265
 
264
266
  ## Runtime Truth
265
267
 
@@ -337,9 +339,11 @@ You are invoked when the normal PM → Dev → QA loop is stuck:
337
339
  - You may NOT override human decisions — escalate to \`human\` if needed
338
340
  - Every override must be recorded as a decision with clear rationale
339
341
 
340
- ## You Cannot Modify Code
342
+ ## File Access
341
343
 
342
- You have \`review_only\` write authority. Like QA, you must raise at least one objection (protocol requirement). Your artifact type is \`review\`.
344
+ ${role.write_authority === 'review_only'
345
+ ? 'You have `review_only` write authority. Like QA, you must raise at least one objection (protocol requirement). Your artifact type is `review`.'
346
+ : 'You have direct write access for this role. Use it sparingly to resolve tactical deadlocks or correct governance artifacts when necessary. Do not use Director authority as a shortcut around the normal PM -> Dev -> QA loop.'}
343
347
 
344
348
  ## Objection Requirement
345
349
 
@@ -513,6 +517,16 @@ function formatRuntimeSummary(runtimeId, runtime) {
513
517
  return `${command} (${runtime.prompt_transport || runtime.type})`;
514
518
  }
515
519
 
520
+ function runtimeMatchesDefaultGovernedLocalCli(runtime) {
521
+ if (!runtime || runtime.type !== 'local_cli') return false;
522
+ const command = Array.isArray(runtime.command) ? runtime.command : [];
523
+ return (
524
+ runtime.cwd === DEFAULT_GOVERNED_LOCAL_DEV_RUNTIME.cwd
525
+ && runtime.prompt_transport === DEFAULT_GOVERNED_LOCAL_DEV_RUNTIME.prompt_transport
526
+ && JSON.stringify(command) === JSON.stringify(DEFAULT_GOVERNED_LOCAL_DEV_RUNTIME.command)
527
+ );
528
+ }
529
+
516
530
  function hasTemplateDefinedRouting(template) {
517
531
  return Boolean(template?.scaffold_blueprint?.routing && Object.keys(template.scaffold_blueprint.routing).length > 0);
518
532
  }
@@ -620,9 +634,15 @@ function buildScaffoldConfigFromTemplate(template, localDevRuntime, workflowKitC
620
634
  (Array.isArray(runtimeOptions.devCommand) && runtimeOptions.devCommand.length > 0)
621
635
  || (typeof runtimeOptions.devPromptTransport === 'string' && runtimeOptions.devPromptTransport.trim())
622
636
  );
623
-
624
- if (!blueprint || Object.values(roles).some((role) => role?.runtime === 'local-dev') || explicitLocalDevRequested) {
625
- runtimes['local-dev'] = localDevRuntime;
637
+ const defaultLocalRuntimeIds = Object.entries(runtimes)
638
+ .filter(([, runtime]) => runtimeMatchesDefaultGovernedLocalCli(runtime))
639
+ .map(([runtimeId]) => runtimeId);
640
+
641
+ if (!blueprint || defaultLocalRuntimeIds.length > 0 || explicitLocalDevRequested) {
642
+ const runtimeIdsToReplace = defaultLocalRuntimeIds.length > 0 ? defaultLocalRuntimeIds : ['local-dev'];
643
+ for (const runtimeId of runtimeIdsToReplace) {
644
+ runtimes[runtimeId] = cloneJsonCompatible(localDevRuntime);
645
+ }
626
646
  }
627
647
 
628
648
  if (explicitLocalDevRequested && roles?.dev?.runtime === 'manual-dev') {
@@ -813,14 +833,23 @@ export function scaffoldGoverned(dir, projectName, projectId, templateId = 'gene
813
833
  // TALK.md
814
834
  writeFileSync(join(dir, 'TALK.md'), `# ${projectName} — Team Talk File\n\nCanonical human-readable handoff log for all agents.\n\n---\n\n`);
815
835
 
816
- // .gitignore additions
836
+ // .gitignore additions with inline comments so operators know what to commit vs. ignore
817
837
  const gitignorePath = join(dir, '.gitignore');
818
- const requiredIgnores = ['.env', '.agentxchain/staging/', '.agentxchain/dispatch/'];
838
+ const gitignoreContent = [
839
+ '# AgentXchain — secrets',
840
+ '.env',
841
+ '',
842
+ '# AgentXchain — transient execution artifacts (never commit)',
843
+ '.agentxchain/staging/',
844
+ '.agentxchain/dispatch/',
845
+ '.agentxchain/transactions/',
846
+ ].join('\n') + '\n';
847
+ const requiredPaths = ['.env', '.agentxchain/staging/', '.agentxchain/dispatch/', '.agentxchain/transactions/'];
819
848
  if (!existsSync(gitignorePath)) {
820
- writeFileSync(gitignorePath, requiredIgnores.join('\n') + '\n');
849
+ writeFileSync(gitignorePath, gitignoreContent);
821
850
  } else {
822
851
  const existingIgnore = readFileSync(gitignorePath, 'utf8');
823
- const missing = requiredIgnores.filter(entry => !existingIgnore.split(/\r?\n/).includes(entry));
852
+ const missing = requiredPaths.filter(entry => !existingIgnore.split(/\r?\n/).includes(entry));
824
853
  if (missing.length > 0) {
825
854
  const prefix = existingIgnore.endsWith('\n') ? '' : '\n';
826
855
  writeFileSync(gitignorePath, existingIgnore + prefix + missing.join('\n') + '\n');
@@ -864,6 +893,8 @@ async function initGoverned(opts) {
864
893
  console.error(' cli-tool Governed scaffold for a CLI tool');
865
894
  console.error(' library Governed scaffold for a reusable package');
866
895
  console.error(' web-app Governed scaffold for a web application');
896
+ console.error(' full-local-cli Human-gated automation pattern with all roles on local_cli');
897
+ console.error(' enterprise-app Governed scaffold for multi-role enterprise delivery');
867
898
  process.exit(1);
868
899
  }
869
900
  selectedTemplate = loadGovernedTemplate(templateId);
@@ -74,7 +74,7 @@ export async function injectCommand(description, opts) {
74
74
  console.log('');
75
75
  console.log(chalk.red.bold(' ⚡ Preemption marker written'));
76
76
  console.log(chalk.dim(' The current run will yield after the active turn completes.'));
77
- console.log(chalk.dim(' The scheduler/continuous loop will pick up this intent next.'));
77
+ console.log(chalk.dim(' The next dispatch (manual resume, step --resume, or continuous loop) will consume this intent.'));
78
78
  }
79
79
 
80
80
  console.log('');