@deeeed/metamask-harness 0.3.5 → 0.3.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.7 - 2026-07-04
4
+
5
+ ### Fixed
6
+ - **Overlay install manifest no longer advertises the retired `launch.sh`/`live.sh`** — mobile launch/live orchestration is in-process now (`mm-harness launch`), and `install_v1_runner_assets` deletes `scripts/launch.sh` and `scripts/live.sh` on both install paths. The product-owned/metadata-only manifest already advertised `verify` only, but the overlay manifest's `runtimeHelpers` still listed `launch: scripts/launch.sh` and `live: scripts/live.sh` — paths the same install had just removed, a manifest that pointed at nonexistent files. The overlay manifest now advertises `verify` only, matching the product-owned path. A new manifest-honesty contract check in `tests/contract/mobile-inject.test.sh` asserts every advertised `runtimeHelpers` path exists on disk and that `launch`/`live` are not advertised, for both the product-owned and a full overlay install, so this cannot recur in either mode.
7
+
8
+ ## 0.3.6 - 2026-07-04
9
+
10
+ ### Fixed
11
+ - **Install manifest carries target checkout identity (`targetRevision`)** — `adapters/mobile/inject.sh` stamps the target repo's `HEAD` (resolved once, up front, via `git rev-parse --verify HEAD`) and an explicit `installMode` into the mobile install manifest on both install paths (product-owned/metadata-only and overlay). Consumers (the farm recipe hook) can now gate their fast path on manifest identity matching the current checkout instead of manifest existence, closing the stale-manifest hole where a gitignored manifest survives a branch switch to a bridge-less checkout. Install now fails with teaching guidance when the target `HEAD` cannot be resolved (not-a-repo, unborn branch), instead of stamping an unusable `targetRevision`. Contract tests cover the identity stamp on both paths and the unborn-HEAD refusal.
12
+
3
13
  ## 0.3.5 - 2026-07-04
4
14
 
5
15
  ### Fixed
@@ -60,6 +60,19 @@ if ! command -v harness_root >/dev/null 2>&1; then
60
60
  exit 1
61
61
  fi
62
62
  TARGET="$(cd "$TARGET" && pwd)"
63
+ # The install stamps this checkout's HEAD into the manifest as its identity. If we
64
+ # cannot resolve it (not a git repo, unborn HEAD, git unavailable) we must not
65
+ # install with an unidentifiable target: a downstream consumer could not tell a
66
+ # stale manifest (left behind by a previous branch/tag) from a current one. Fail
67
+ # loud with escape guidance rather than stamping an "unknown" revision.
68
+ # --verify fails cleanly (no stdout) on an unborn HEAD, where plain `rev-parse
69
+ # HEAD` would echo the literal "HEAD" and slip past the emptiness check below.
70
+ TARGET_REV="$(git -C "$TARGET" rev-parse --verify HEAD 2>/dev/null || true)"
71
+ if [ -z "$TARGET_REV" ]; then
72
+ echo "Refusing mobile recipe harness install: cannot resolve the target checkout HEAD in $TARGET." >&2
73
+ echo "Next: ensure the target is a git checkout with at least one commit (git -C \"$TARGET\" rev-parse HEAD succeeds), then retry the install." >&2
74
+ exit 1
75
+ fi
63
76
  METAMASK_RUNNER_DIR="$RUNNER_DIR"
64
77
  METAMASK_RUNNER_SOURCE_KIND="runner-self"
65
78
  METAMASK_RUNNER_REVISION="$(git -C "$RUNNER_DIR" rev-parse HEAD 2>/dev/null || echo unknown)"
@@ -272,10 +285,11 @@ if [ "$FORCE_OVERLAY" = false ] && has_product_owned_mobile_harness; then
272
285
  fi
273
286
  node -e '
274
287
  const fs = require("fs");
275
- const [runnerOwnerDir, runnerOwnerRevision, runnerDir, runnerRevision, runnerSourceKind, adapterRuntime, target, scriptDir, manifestPath, harnessRoot, harnessRel, cleanupCommand] = process.argv.slice(1);
288
+ const [runnerOwnerDir, runnerOwnerRevision, runnerDir, runnerRevision, runnerSourceKind, adapterRuntime, target, scriptDir, manifestPath, harnessRoot, harnessRel, cleanupCommand, targetRevision] = process.argv.slice(1);
276
289
  const m = {
277
290
  adapter: "mobile",
278
291
  installMode: "product-owned",
292
+ targetRevision,
279
293
  installedAt: new Date().toISOString(),
280
294
  source: {
281
295
  runnerOwnerDir,
@@ -308,7 +322,7 @@ if [ "$FORCE_OVERLAY" = false ] && has_product_owned_mobile_harness; then
308
322
  note: "This checkout already contains the Mobile in-app bridge. Runner install only writes recipe-harness metadata and must not overwrite tracked in-app bridge files."
309
323
  };
310
324
  fs.writeFileSync(manifestPath, JSON.stringify(m, null, 2) + "\n");
311
- ' "$RUNNER_DIR" "$SOURCE_REV" "$METAMASK_RUNNER_DIR" "$METAMASK_RUNNER_REVISION" "$METAMASK_RUNNER_SOURCE_KIND" "$ADAPTER_DIR" "$TARGET" "$SCRIPT_DIR" "$HARNESS_DIR/manifest.json" "$HARNESS_ROOT" "$HARNESS_REL" "$CLEANUP_COMMAND"
325
+ ' "$RUNNER_DIR" "$SOURCE_REV" "$METAMASK_RUNNER_DIR" "$METAMASK_RUNNER_REVISION" "$METAMASK_RUNNER_SOURCE_KIND" "$ADAPTER_DIR" "$TARGET" "$SCRIPT_DIR" "$HARNESS_DIR/manifest.json" "$HARNESS_ROOT" "$HARNESS_REL" "$CLEANUP_COMMAND" "$TARGET_REV"
312
326
  echo "Installed mobile recipe harness metadata only (in-app bridge detected): $HARNESS_DIR/manifest.json"
313
327
  exit 0
314
328
  fi
@@ -637,9 +651,11 @@ SOURCE_REV="$(git -C "$RUNNER_DIR" rev-parse HEAD 2>/dev/null || echo unknown)"
637
651
  CLEANUP_COMMAND="RECIPE_HARNESS_ROOT=$HARNESS_ROOT $(printf '%q' "$CLEANUP_SH") --target $(printf '%q' "$TARGET")"
638
652
  node -e '
639
653
  const fs = require("fs");
640
- const [runnerOwnerDir, runnerOwnerRevision, runnerDir, runnerRevision, runnerSourceKind, adapterRuntime, target, backupDir, scriptDir, manifestPath, mobileAgenticSource, harnessRoot, harnessRel, cleanupCommand] = process.argv.slice(1);
654
+ const [runnerOwnerDir, runnerOwnerRevision, runnerDir, runnerRevision, runnerSourceKind, adapterRuntime, target, backupDir, scriptDir, manifestPath, mobileAgenticSource, harnessRoot, harnessRel, cleanupCommand, targetRevision] = process.argv.slice(1);
641
655
  const m = {
642
656
  adapter: "mobile",
657
+ installMode: "overlay",
658
+ targetRevision,
643
659
  installedAt: new Date().toISOString(),
644
660
  source: {
645
661
  runnerOwnerDir,
@@ -653,9 +669,12 @@ node -e '
653
669
  protocolVersion: "v1",
654
670
  actionManifestPath: harnessRel + "/action-manifest.json",
655
671
  runnerEntrypoint: harnessRel + "/runner/bin/mm-harness",
672
+ // launch/live orchestration is in-process (mm-harness launch); only verify
673
+ // remains a shell helper. install_v1_runner_assets deletes scripts/launch.sh
674
+ // and scripts/live.sh, so advertising them here would be a manifest that
675
+ // points at files this same install removed. Keep this in sync with the
676
+ // product-owned block above (verify only).
656
677
  runtimeHelpers: {
657
- launch: harnessRel + "/scripts/launch.sh",
658
- live: harnessRel + "/scripts/live.sh",
659
678
  verify: harnessRel + "/scripts/verify.sh"
660
679
  },
661
680
  installedPaths: [harnessRel + "/runner", harnessRel + "/scripts", harnessRel + "/action-manifest.json", "app/dev-tools/AgenticService"],
@@ -669,7 +688,7 @@ node -e '
669
688
  ]
670
689
  };
671
690
  fs.writeFileSync(manifestPath, JSON.stringify(m, null, 2) + "\n");
672
- ' "$RUNNER_DIR" "$SOURCE_REV" "$METAMASK_RUNNER_DIR" "$METAMASK_RUNNER_REVISION" "$METAMASK_RUNNER_SOURCE_KIND" "$ADAPTER_DIR" "$TARGET" "$BACKUP_DIR" "$SCRIPT_DIR" "$HARNESS_DIR/manifest.json" "${MOBILE_AGENTIC_SOURCE:-}" "$HARNESS_ROOT" "$HARNESS_REL" "$CLEANUP_COMMAND"
691
+ ' "$RUNNER_DIR" "$SOURCE_REV" "$METAMASK_RUNNER_DIR" "$METAMASK_RUNNER_REVISION" "$METAMASK_RUNNER_SOURCE_KIND" "$ADAPTER_DIR" "$TARGET" "$BACKUP_DIR" "$SCRIPT_DIR" "$HARNESS_DIR/manifest.json" "${MOBILE_AGENTIC_SOURCE:-}" "$HARNESS_ROOT" "$HARNESS_REL" "$CLEANUP_COMMAND" "$TARGET_REV"
673
692
 
674
693
  ENSURE_DEPS="$SCRIPT_DIR/../shared/ensure-runner-deps.sh"
675
694
  if [ -f "$ENSURE_DEPS" ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"