agentic-workflow-manager 3.2.1 → 3.2.2

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.
@@ -42,7 +42,26 @@ async function runInitSteps(deps) {
42
42
  steps.push(await wrapStep('project.constitutionInjection', 'project', () => (0, steps_1.stepConstitutionInjection)(deps)));
43
43
  steps.push(await wrapStep('project.context', 'project', () => (0, steps_1.stepContext)(deps)));
44
44
  }
45
+ // Re-gather fresh so the report reflects whatever the steps above just
46
+ // installed. `results` deliberately keeps every check — including project
47
+ // ones — so the render still shows real project state (e.g. "run awm sync")
48
+ // when one exists; only `overall`, the exit-code verdict, needs scoping.
49
+ //
50
+ // If this run started with project scope nulled — `--machine-only`
51
+ // (init.ts's effectiveCtx), or genuinely no project at this cwd — `overall`
52
+ // must reflect only what THIS run attempted. `runChecks` otherwise mixes
53
+ // machine + project results into one flat `overall` (checks.ts), so a
54
+ // `--machine-only` bootstrap into an already-initialized project with
55
+ // unrelated unsynced bundles reports "degraded" and callers gating on it
56
+ // (`runInit`'s exit code) fail a run that fully succeeded at everything it
57
+ // was asked to do — the exact shape of a real Codex Cloud bootstrap script
58
+ // aborting under `set -euo pipefail` right after `awm init`.
45
59
  const after = (0, checks_1.runChecks)((0, context_1.gatherContext)({ cwd: deps.cwd, bundles: deps.bundles, agent: deps.agent }));
60
+ if (deps.ctx.project === null) {
61
+ after.overall = after.results
62
+ .filter((r) => r.level === 'machine')
63
+ .some((r) => r.status === 'missing') ? 'degraded' : 'healthy';
64
+ }
46
65
  return {
47
66
  steps,
48
67
  applied: steps.filter((s) => s.action === 'applied').length,
@@ -96,6 +96,34 @@ describe('runInitSteps — orchestrator', () => {
96
96
  fs_1.default.rmSync(bareCwd, { recursive: true, force: true });
97
97
  }
98
98
  });
99
+ it('machine-only inside an already-initialized project with unsynced bundles still reaches overall healthy', async () => {
100
+ // Reproduces a real Codex Cloud bootstrap: `awm init --agent codex --yes
101
+ // --machine-only` run with cwd inside an existing, previously-initialized
102
+ // project (its own `.awm/profile.json` already committed, declaring bundles
103
+ // this machine-only run was never asked to sync). The bare-cwd test above
104
+ // can't catch this — there, `ctx.project` is null for two reasons at once
105
+ // (machineOnly AND no project exists), so it never exercises "machineOnly
106
+ // nulled a project that actually has real, degraded content."
107
+ const root = path_1.default.join(tmpHome, 'existing-project');
108
+ fs_1.default.mkdirSync(path_1.default.join(root, '.awm'), { recursive: true });
109
+ fs_1.default.writeFileSync(path_1.default.join(root, 'package.json'), JSON.stringify({ dependencies: { next: '14.0.0' } }));
110
+ // Declares the "dev" bundle active, but its skills were never symlinked —
111
+ // exactly `active bundles (N missing)` in the real report the user saw.
112
+ fs_1.default.writeFileSync(path_1.default.join(root, '.awm', 'profile.json'), JSON.stringify({ extensions: ['dev'] }));
113
+ const deps = buildDeps(root);
114
+ deps.ctx.project = null; // what init.ts's effectiveCtx does for --machine-only
115
+ const { runInitSteps } = require('../../../src/core/init/orchestrator');
116
+ const out = await runInitSteps(deps);
117
+ // The steps this run actually attempted (machine-only) all succeeded —
118
+ // that must be reflected in the caller's exit code.
119
+ expect(out.steps.every((s) => s.action !== 'failed')).toBe(true);
120
+ expect(out.after.results.find((r) => r.id === 'machine.devCore')?.status).toBe('ok');
121
+ // Project state exists and IS genuinely degraded, and it must stay visible
122
+ // in the report (the CLI's own render still shows it) — but it must not
123
+ // drag down the overall verdict for a run that never touched project scope.
124
+ expect(out.after.results.some((r) => r.id === 'project.activation' && r.status === 'missing')).toBe(true);
125
+ expect(out.after.overall).toBe('healthy');
126
+ });
99
127
  it('project repo: applies activation/sensors, flags constitution+context as pending', async () => {
100
128
  const root = path_1.default.join(tmpHome, 'repo');
101
129
  fs_1.default.mkdirSync(path_1.default.join(root, '.awm'), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-workflow-manager",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "main": "dist/src/index.js",
5
5
  "bin": {
6
6
  "awm": "./dist/src/index.js"