agentic-workflow-manager 9.12.2 → 9.12.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.
@@ -58,6 +58,7 @@ const currentnessCheck = __importStar(require("../../../src/core/currentness/che
58
58
  const sensorCommands = __importStar(require("../../../src/commands/sensors/run"));
59
59
  const preferencesConfig = __importStar(require("../../../src/utils/config"));
60
60
  const providers_1 = require("../../../src/providers");
61
+ const adapterModule = __importStar(require("../../../src/core/journal/adapter"));
61
62
  jest.setTimeout(60000);
62
63
  // runSupervisorLoop's full external-controller lifecycle (spawn stub codex ->
63
64
  // identity captured by the wrapper -> adopted via collectControllerGeneration's
@@ -93,6 +94,18 @@ const admitted = async () => ({
93
94
  state: 'admitted', planState: 'valid', executionMode: 'desatendido',
94
95
  journal: 'current', currentness: 'current', sensors: 'pass', diagnostics: [],
95
96
  });
97
+ /** Lifecycle fixtures do not spawn a real controller. Explicitly adopt a
98
+ * simulated native identity before expecting job dispatch. */
99
+ function adoptFixtureController(repo) {
100
+ const state = (0, store_1.readJournal)(repo, 'main').state;
101
+ const gen = (0, generations_1.activeGeneration)(state);
102
+ gen.processRef = { pid: process.pid, processGroup: process.pid, startTime: 'fixture',
103
+ spawnNonce: gen.spawnNonce, argvDigest: gen.launchArgvDigest, psArgsDigest: 'b'.repeat(64) };
104
+ (0, store_1.writeJournal)(repo, 'main', state);
105
+ const adapter = adapterModule.adapterFor('codex');
106
+ jest.spyOn(adapterModule, 'adapterFor').mockReturnValue({ ...adapter,
107
+ activity: () => ({ cpuTime: '0', groupSize: 1 }), safeToReplace: () => 'indeterminate' });
108
+ }
96
109
  /** Legacy fixtures predate compact-only admission; make their execution contract explicit. */
97
110
  function initUnattendedFixture(repo) {
98
111
  (0, init_1.initWatch)(repo, 'main');
@@ -266,6 +279,8 @@ describe('supervisor loop', () => {
266
279
  try {
267
280
  let sawContinueWithLiveJob = false;
268
281
  let outcome = 'continue';
282
+ expect(await sup.tick()).toBe('continue');
283
+ adoptFixtureController(repo);
269
284
  for (let i = 0; i < 400 && outcome !== 'complete'; i++) {
270
285
  outcome = await sup.tick();
271
286
  const s = (0, store_1.readJournal)(repo, 'main').state;
@@ -280,7 +295,8 @@ describe('supervisor loop', () => {
280
295
  expect(final.cycle.status).toBe('COMPLETE');
281
296
  expect(typeof final.cycle.completedAt).toBe('string');
282
297
  expect(Object.values(final.jobs).every((j) => j.executionState === 'exited' && j.verdict === 'pass')).toBe(true);
283
- expect(final.generations.every((entry) => entry.state === 'terminated' && entry.processRef === undefined)).toBe(true);
298
+ expect(final.generations.every((entry) => entry.state === 'terminated'
299
+ && (entry.processRef === undefined || entry.processRef.pid === process.pid))).toBe(true);
284
300
  expect(controllerSpawnAttempts).toBeGreaterThan(0);
285
301
  }
286
302
  finally {
@@ -356,6 +372,8 @@ describe('supervisor loop', () => {
356
372
  };
357
373
  const sup = new supervisor_1.Supervisor(repo, 'main', cfg, lifecycleSpawner, undefined, admitted);
358
374
  let outcome = 'continue';
375
+ expect(await sup.tick()).toBe('continue');
376
+ adoptFixtureController(repo);
359
377
  for (let i = 0; i < 400 && outcome !== 'complete'; i++) {
360
378
  outcome = await sup.tick();
361
379
  await new Promise((r) => setTimeout(r, 50));
@@ -367,7 +385,10 @@ describe('supervisor loop', () => {
367
385
  for (const t of final.tracks)
368
386
  expect(['REMOVED', 'DECLARED']).toContain(t.phase);
369
387
  const { refIsAlive } = require('../../../src/core/journal/process');
370
- expect(final.generations.every((entry) => entry.state === 'terminated' && (entry.processRef === undefined || !refIsAlive(entry.processRef)))).toBe(true);
388
+ // The fixture adopts this Jest process as its controller; it is
389
+ // intentionally not killed on COMPLETE and remains alive on Windows.
390
+ expect(final.generations.every((entry) => entry.state === 'terminated'
391
+ && (entry.processRef === undefined || entry.processRef.pid === process.pid || !refIsAlive(entry.processRef)))).toBe(true);
371
392
  }
372
393
  finally {
373
394
  fs_1.default.rmSync(tracksRoot, { recursive: true, force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-workflow-manager",
3
- "version": "9.12.2",
3
+ "version": "9.12.3",
4
4
  "main": "dist/src/index.js",
5
5
  "bin": {
6
6
  "awm": "./dist/src/index.js"
Binary file
Binary file