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.
- package/README.md +2 -0
- package/bin/agentxchain.js +38 -4
- package/package.json +1 -1
- package/scripts/verify-post-publish.sh +55 -5
- package/src/commands/accept-turn.js +14 -0
- package/src/commands/checkpoint-turn.js +35 -0
- package/src/commands/connector.js +17 -2
- package/src/commands/doctor.js +151 -1
- package/src/commands/events.js +7 -1
- package/src/commands/init.js +42 -11
- package/src/commands/inject.js +1 -1
- package/src/commands/mission.js +803 -7
- package/src/commands/reissue-turn.js +122 -0
- package/src/commands/reject-turn.js +60 -6
- package/src/commands/restart.js +81 -10
- package/src/commands/resume.js +20 -9
- package/src/commands/run.js +13 -0
- package/src/commands/status.js +58 -4
- package/src/commands/step.js +49 -10
- package/src/commands/validate.js +78 -20
- package/src/lib/cli-version.js +106 -0
- package/src/lib/connector-probe.js +146 -5
- package/src/lib/continuous-run.js +22 -87
- package/src/lib/coordinator-dispatch.js +25 -0
- package/src/lib/dispatch-bundle.js +39 -0
- package/src/lib/governed-state.js +624 -11
- package/src/lib/governed-templates.js +1 -0
- package/src/lib/intake.js +233 -77
- package/src/lib/mission-plans.js +510 -6
- package/src/lib/missions.js +65 -6
- package/src/lib/normalized-config.js +50 -15
- package/src/lib/repo-observer.js +8 -2
- package/src/lib/run-events.js +5 -0
- package/src/lib/run-loop.js +25 -0
- package/src/lib/runner-interface.js +2 -0
- package/src/lib/session-checkpoint.js +18 -2
- package/src/lib/turn-checkpoint.js +221 -0
- package/src/templates/governed/full-local-cli.json +71 -0
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, readdirSync } from 'fs';
|
|
18
18
|
import { join } from 'path';
|
|
19
|
+
import { execSync } from 'child_process';
|
|
19
20
|
import { getActiveTurn, getActiveTurns } from './governed-state.js';
|
|
20
21
|
import { renderInheritedContextMarkdown } from './run-context-inheritance.js';
|
|
22
|
+
import { isOperationalPath } from './repo-observer.js';
|
|
21
23
|
import { renderRepoDecisionsMarkdown } from './repo-decisions.js';
|
|
22
24
|
import {
|
|
23
25
|
DISPATCH_INDEX_PATH,
|
|
@@ -83,6 +85,25 @@ export function writeDispatchBundle(root, state, config, opts = {}) {
|
|
|
83
85
|
const bundleDir = join(root, getDispatchTurnDir(turn.turn_id));
|
|
84
86
|
const warnings = [...(opts.warnings || [])];
|
|
85
87
|
|
|
88
|
+
// BUG-5: Warn operator about dirty workspace files at dispatch time
|
|
89
|
+
try {
|
|
90
|
+
const statusOutput = execSync('git status --porcelain', { cwd: root, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
91
|
+
if (statusOutput) {
|
|
92
|
+
const dirtyFiles = statusOutput.split('\n').map(l => l.slice(3).trim()).filter(Boolean);
|
|
93
|
+
const nonOperationalDirty = dirtyFiles.filter(f => !isOperationalPath(f));
|
|
94
|
+
if (nonOperationalDirty.length > 0) {
|
|
95
|
+
const baseline = turn.baseline;
|
|
96
|
+
const snapshotKeys = baseline?.dirty_snapshot ? Object.keys(baseline.dirty_snapshot) : [];
|
|
97
|
+
const unsnapshotted = nonOperationalDirty.filter(f => !snapshotKeys.includes(f));
|
|
98
|
+
if (unsnapshotted.length > 0) {
|
|
99
|
+
warnings.push(
|
|
100
|
+
`Workspace has ${unsnapshotted.length} uncommitted file(s) not in the dispatch baseline: ${unsnapshotted.slice(0, 5).join(', ')}${unsnapshotted.length > 5 ? '...' : ''}. These will be excluded from files_changed validation. If the subprocess modifies them, add them to files_changed.`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} catch { /* non-fatal — skip if git unavailable */ }
|
|
106
|
+
|
|
86
107
|
// Clear and recreate only the targeted turn bundle
|
|
87
108
|
try {
|
|
88
109
|
rmSync(bundleDir, { recursive: true, force: true });
|
|
@@ -311,6 +332,24 @@ function renderPrompt(role, roleId, turn, state, config, root) {
|
|
|
311
332
|
lines.push('');
|
|
312
333
|
}
|
|
313
334
|
|
|
335
|
+
if (turn.intake_context) {
|
|
336
|
+
lines.push('### Active Injected Intent — respond to this as your primary charter');
|
|
337
|
+
lines.push('');
|
|
338
|
+
if (turn.intake_context.charter) {
|
|
339
|
+
lines.push(turn.intake_context.charter);
|
|
340
|
+
lines.push('');
|
|
341
|
+
}
|
|
342
|
+
if (Array.isArray(turn.intake_context.acceptance_contract) && turn.intake_context.acceptance_contract.length > 0) {
|
|
343
|
+
lines.push('Acceptance contract:');
|
|
344
|
+
turn.intake_context.acceptance_contract.forEach((requirement, index) => {
|
|
345
|
+
lines.push(`${index + 1}. ${requirement}`);
|
|
346
|
+
});
|
|
347
|
+
lines.push('');
|
|
348
|
+
}
|
|
349
|
+
lines.push('You must explicitly address every acceptance item in your turn summary, artifacts, or verification evidence. Do not treat this as background context.');
|
|
350
|
+
lines.push('');
|
|
351
|
+
}
|
|
352
|
+
|
|
314
353
|
// Retry context
|
|
315
354
|
if (turn.attempt > 1 && turn.last_rejection) {
|
|
316
355
|
lines.push('## Previous Attempt Failed');
|