agentic-workflow-manager 9.12.2 → 9.12.4
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/dist/src/commands/job/index.js +61 -0
- package/dist/src/commands/watch/admission-recovery.js +13 -2
- package/dist/src/commands/watch/apply.js +118 -2
- package/dist/src/commands/watch/generations.js +1 -1
- package/dist/src/commands/watch/index.js +12 -2
- package/dist/src/commands/watch/supervisor.js +114 -24
- package/dist/src/core/admission/index.js +2 -0
- package/dist/src/core/admission/registry-contracts.js +74 -3
- package/dist/src/core/journal/requests.js +6 -0
- package/dist/src/core/journal/types.js +40 -3
- package/dist/tests/commands/watch/admission-recovery.test.js +44 -0
- package/dist/tests/commands/watch/plan-lifecycle.test.js +47 -1
- package/dist/tests/commands/watch/reopened-196.test.js +1042 -0
- package/dist/tests/commands/watch/supervisor-loop.test.js +23 -2
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/secure_fs.node +0 -0
- package/prebuilds/darwin-x64/secure_fs.node +0 -0
- package/prebuilds/win32-arm64/secure_fs.node +0 -0
- package/prebuilds/win32-x64/secure_fs.node +0 -0
|
@@ -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'
|
|
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
|
-
|
|
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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|