@hmharness/domain-harmony 0.13.1 → 0.13.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.
@@ -1,10 +1,21 @@
1
- /** Cause classes: signature -> fix. Order matters (first hit wins). */
1
+ /** Cause classes: signature -> fix. Order matters (first hit wins).
2
+ * day-28 SELFFEED hardening: the sdk-version signature matches hvigor's
3
+ * *error code* (Specification Limit Violation), not its mutable hint lines -
4
+ * the old generic `config` regex only caught this defect incidentally via
5
+ * the hint text. */
2
6
  const SIGNATURES = [
3
7
  {
4
8
  re: /Invalid value of DEVECO_SDK_HOME|sdk home|not find sdk|SdkHomePath/i,
5
9
  kind: 'sdk-home',
6
10
  fix: 'DEVECO_SDK_HOME is unset or wrong. Set HM_DEVECO_HOME (default C:\\DevEco-Studio) or export DEVECO_SDK_HOME=<DevEco>/sdk; our build wrapper already tries - set HM_DEVECO_HOME and retry.',
7
11
  },
12
+ {
13
+ // hvigor error code for an implausible compatibleSdkVersion etc. - match
14
+ // the code itself so hint-wording churn cannot break classification
15
+ re: /Specification Limit Violation|compatibleSdkVersion.*(invalid|not|unsupported)|unsupported sdk version|sdk version.*(invalid|not match)/i,
16
+ kind: 'sdk-version',
17
+ fix: 'compatibleSdkVersion in build-profile.json5 does not match an installed SDK. Check the value against hmh devices/check output (installed SDK line) and fix products[0].compatibleSdkVersion; the schema check does NOT validate version plausibility - this doctor class is the net that catches it.',
18
+ },
8
19
  {
9
20
  re: /signingConfigs|signing config|keystore|\.p12|\.cer|no signing/i,
10
21
  kind: 'signing',
package/dist/emulator.js CHANGED
@@ -192,7 +192,26 @@ export const harmonyEmulatorStop = {
192
192
  /* already gone */
193
193
  }
194
194
  }
195
- return { output: `stopped: ${targets.map((t) => `${t.hvd} (pid ${t.pid})`).join(', ')}` };
195
+ // verify, never trust the kill report (day-19 SELFFEED: taskkill returned
196
+ // success while Emulator.exe was still alive for seconds) - poll until the
197
+ // CIM query no longer sees the target pids, bounded at ~15s
198
+ const wantGone = new Set(targets.map((t) => t.pid));
199
+ let stillAlive = [];
200
+ for (let waited = 0; waited <= 15_000; waited += 2000) {
201
+ await new Promise((res) => setTimeout(res, waited === 0 ? 1000 : 2000));
202
+ const now = await runningEmulators();
203
+ stillAlive = now.map((r) => r.pid).filter((pid) => wantGone.has(pid));
204
+ if (stillAlive.length === 0)
205
+ break;
206
+ }
207
+ const stopped = targets.filter((t) => !stillAlive.includes(t.pid));
208
+ const stuck = targets.filter((t) => stillAlive.includes(t.pid));
209
+ const lines = [];
210
+ if (stopped.length > 0)
211
+ lines.push(`stopped: ${stopped.map((t) => `${t.hvd} (pid ${t.pid})`).join(', ')} (verified gone)`);
212
+ if (stuck.length > 0)
213
+ lines.push(`NOT stopped (process still alive after taskkill - kill it manually or retry): ${stuck.map((t) => `${t.hvd} (pid ${t.pid})`).join(', ')}`);
214
+ return { output: lines.join('\n'), ...(stuck.length > 0 ? { isError: true } : {}) };
196
215
  },
197
216
  };
198
217
  export const harmonyEmulatorCatalog = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/domain-harmony",
3
- "version": "0.13.1",
3
+ "version": "0.13.4",
4
4
  "description": "hmharness HarmonyOS domain core: device, toolchain, build, and project lifecycle capabilities. HarmonyOS is the framework's native domain, not an add-on.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",