agentic-workflow-manager 9.20.3 → 9.20.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/sensors/status.js +6 -1
- package/dist/tests/commands/sensors/status.test.js +62 -0
- package/package.json +2 -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
|
@@ -215,7 +215,12 @@ function projectSensorCheck(sensor, cwd) {
|
|
|
215
215
|
function packBoundOnly(manifest) {
|
|
216
216
|
const sensors = Object.fromEntries(Object.entries(manifest.sensors).filter(([, sensor]) => !(0, manifest_1.isProjectDeclaredSensor)(sensor)));
|
|
217
217
|
const pack = 'pack' in manifest && typeof manifest.pack === 'string' ? manifest.pack : '';
|
|
218
|
-
return {
|
|
218
|
+
return {
|
|
219
|
+
schemaVersion: 2,
|
|
220
|
+
pack,
|
|
221
|
+
sensors,
|
|
222
|
+
...(manifest.packSelection === 'explicit' ? { packSelection: 'explicit' } : {}),
|
|
223
|
+
};
|
|
219
224
|
}
|
|
220
225
|
/** Live pack sensor ids, or null when the pack cannot be resolved (fail closed). */
|
|
221
226
|
function livePackSensorIds(source) {
|
|
@@ -268,6 +268,68 @@ describe('computeSensorStatus', () => {
|
|
|
268
268
|
fs_1.default.rmSync(home, { recursive: true, force: true });
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
|
+
it('keeps packSelection explicit through status so explicit-opt-in sensors do not false-drift', async () => {
|
|
272
|
+
// Regression for #231: packBoundOnly used to drop packSelection before
|
|
273
|
+
// resolveStaticV2Compatibility. Without it, applies() leaves explicit-opt-in
|
|
274
|
+
// sensors not-applicable and status reports "compatibility drift: initialized
|
|
275
|
+
// prettier, resolved not-applicable" even though run() (which keeps the field)
|
|
276
|
+
// would certify the same manifest.
|
|
277
|
+
const previousHome = process.env.AWM_HOME;
|
|
278
|
+
const home = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'awm-status-home-'));
|
|
279
|
+
try {
|
|
280
|
+
process.env.AWM_HOME = home;
|
|
281
|
+
const registry = path_1.default.join(home, 'registries', 'baseline');
|
|
282
|
+
fs_1.default.mkdirSync(path_1.default.join(registry, 'sensor-packs', 'js-ts'), { recursive: true });
|
|
283
|
+
fs_1.default.writeFileSync(path_1.default.join(home, 'registries.json'), JSON.stringify([{ name: 'baseline', remote: 'https://example.test/baseline.git' }]));
|
|
284
|
+
fs_1.default.writeFileSync(path_1.default.join(registry, 'sensor-packs', 'js-ts', 'pack.json'), JSON.stringify({
|
|
285
|
+
schemaVersion: 2, name: 'js-ts', description: 'test', detects: ['package.json'],
|
|
286
|
+
coverage: { schemaVersion: 1, classes: { format: { description: 'format', detectors: [{ sensor: 'format' }], remedy: { summary: 'Fix format', command: 'awm sensors init --pack js-ts' } } } },
|
|
287
|
+
sensors: { format: {
|
|
288
|
+
applicability: { kind: 'explicit-opt-in' },
|
|
289
|
+
variants: [{
|
|
290
|
+
id: 'prettier', priority: 10, certifiedRange: '>=3.0.0 <4.0.0',
|
|
291
|
+
requirements: { tool: 'prettier', toolRange: '>=3.0.0 <4.0.0', runtime: 'node', runtimeRange: '>=0.0.0' },
|
|
292
|
+
assets: [], formatter: 'prettier', probe: { kind: 'package-script-present', script: 'format' },
|
|
293
|
+
command: { executable: 'prettier', resolution: 'node-modules-bin', args: ['.'] },
|
|
294
|
+
}],
|
|
295
|
+
} },
|
|
296
|
+
}));
|
|
297
|
+
fs_1.default.writeFileSync(path_1.default.join(tmpDir, 'package.json'), JSON.stringify({
|
|
298
|
+
devDependencies: { prettier: '^3.0.0' },
|
|
299
|
+
scripts: { format: 'prettier .' },
|
|
300
|
+
}));
|
|
301
|
+
fs_1.default.mkdirSync(path_1.default.join(tmpDir, 'node_modules', 'prettier'), { recursive: true });
|
|
302
|
+
fs_1.default.writeFileSync(path_1.default.join(tmpDir, 'node_modules', 'prettier', 'package.json'), JSON.stringify({ version: '3.3.3' }));
|
|
303
|
+
fs_1.default.mkdirSync(path_1.default.join(tmpDir, 'node_modules', '.bin'), { recursive: true });
|
|
304
|
+
fs_1.default.writeFileSync(path_1.default.join(tmpDir, 'node_modules', '.bin', 'prettier'), '#!/bin/sh\nexit 0\n');
|
|
305
|
+
fs_1.default.chmodSync(path_1.default.join(tmpDir, 'node_modules', '.bin', 'prettier'), 0o755);
|
|
306
|
+
fs_1.default.mkdirSync(path_1.default.join(tmpDir, '.awm'), { recursive: true });
|
|
307
|
+
fs_1.default.writeFileSync(path_1.default.join(tmpDir, '.awm', 'sensors.json'), JSON.stringify({
|
|
308
|
+
schemaVersion: 2, pack: 'js-ts', packSelection: 'explicit',
|
|
309
|
+
sensors: { format: {
|
|
310
|
+
enabled: true, variantId: 'prettier',
|
|
311
|
+
command: { executable: 'prettier', resolution: 'node-modules-bin', args: ['.'] },
|
|
312
|
+
assets: [],
|
|
313
|
+
initializedCompatibility: {
|
|
314
|
+
state: 'certified', reason: 'range-and-probe', variantId: 'prettier',
|
|
315
|
+
toolVersion: '3.3.3', runtimeVersion: process.versions.node,
|
|
316
|
+
certifiedRange: '>=3.0.0 <4.0.0', evidence: [],
|
|
317
|
+
},
|
|
318
|
+
} },
|
|
319
|
+
}));
|
|
320
|
+
const result = await (0, status_1.computeSensorStatus)(tmpDir);
|
|
321
|
+
expect(result.checks.format?.detail ?? '').not.toMatch(/compatibility drift/i);
|
|
322
|
+
expect(result.checks.format).toMatchObject({ ok: true });
|
|
323
|
+
expect(result.overall).toBe('READY');
|
|
324
|
+
}
|
|
325
|
+
finally {
|
|
326
|
+
if (previousHome === undefined)
|
|
327
|
+
delete process.env.AWM_HOME;
|
|
328
|
+
else
|
|
329
|
+
process.env.AWM_HOME = previousHome;
|
|
330
|
+
fs_1.default.rmSync(home, { recursive: true, force: true });
|
|
331
|
+
}
|
|
332
|
+
});
|
|
271
333
|
it('marks disabled sensors as ok', async () => {
|
|
272
334
|
fs_1.default.mkdirSync(path_1.default.join(tmpDir, '.awm'), { recursive: true });
|
|
273
335
|
fs_1.default.writeFileSync(path_1.default.join(tmpDir, '.awm', 'sensors.json'), JSON.stringify({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-workflow-manager",
|
|
3
|
-
"version": "9.20.
|
|
3
|
+
"version": "9.20.4",
|
|
4
4
|
"main": "dist/src/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"awm": "./dist/src/index.js"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"lint": "eslint . --config eslint.config.awm.mjs --cache --format json",
|
|
27
27
|
"depcheck": "depcruise --config .dep-cruiser.awm.js src",
|
|
28
28
|
"test": "jest --runInBand",
|
|
29
|
+
"test:wait-npm-publication": "node --test ../.github/scripts/wait-npm-publication.test.cjs",
|
|
29
30
|
"start": "ts-node src/index.ts",
|
|
30
31
|
"prerelease": "npm run build",
|
|
31
32
|
"release": "node dist/src/release/index.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|