← All Pull Requests

Restore-native-SF-Convert-CLI-via-release-assets #1

Open opened by Josh Aberdeen

Fixes

Addresses ADOM SF Convert issue #1: the skill package installs no adom-sfconvert executable, leaving ADOM Chip Fetcher at 12/13 sister tools.

Base upstream HEAD: 6a38876679967443a20a25f4cb235ccb85a578eb (checked before patch).

Root cause

The historical installer copied only the skill file. The bundled Rust build artifacts disappeared from source before package v1.0.3 and the package allowlist in later versions excludes all binaries. Package signature verification therefore passes despite a missing operational command.

Proposed source changes

  • install.sh: use the native adom-wiki release download for the package's exact version, --platform linux --arch x64, followed by release verify and a real adom-sfconvert version executable check before atomic installation. Error clearly if the matching binary asset is missing. Preserve independently installed binaries.
  • uninstall.sh: remove only the package-owned executable, keep modified copies; clean up skill and ownership marker.
  • tests/smoke.sh, tests/fixtures/test2pin.lbr, tests/README.md: deterministic isolated-home installer, native EAGLE/KiCad/SVG, and uninstall regression.
  • release-candidates/linux-x64/adom-sfconvert: hosted on contributor fork josh/adom-sfconvert, branch fix/sfconvert-release-asset-cli-20261105 only; ADOM upstream PRs accept text, so it is NOT in this upstream PR or install payload. Recovered unmodified ADOM-built Linux x64 binary from upstream v1.0.2 commit f8a1099aa39c9adc22b23e3805a809d9aa14b38c, SHA-256 98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d. Internal version 0.1.0. Staged as recovery/release candidate, NOT represented as current-source build.

No changes to package.json or Rust converter implementation; the upstream source remains intact. The upstream PR's text-only file set includes install.sh, uninstall.sh, tests/smoke.sh, tests/fixtures/test2pin.lbr, tests/README.md. A reviewed build must be uploaded as a separate signed ADOM release asset.

Tests completed (Linux x86_64 WSL, ADOM native workspace)

  • Recovered executable version returns 0.1.0, SHA-256 matches archived source.
  • Native conversions succeeded with actual ADOM test files: fusion-bridge/resources/samples/0603WAF3300T5E.lbr, board-to-molecule/assets/pins/MachinePinMediumShort.SchLib and MachinePinMediumShort.PcbLib. KiCad exports and native SVGs were generated.
  • bash tests/smoke.sh PASS using isolated HOME and mocked signed-release transport; covers installation, outputs and uninstall.
  • bash -n install.sh uninstall.sh tests/smoke.sh PASS.
  • adom-wiki pkg lint: 0 errors; existing optional listing-content warnings remain.
  • adom-wiki pkg pack: 7-file ~4.7 KB install tarball, no ELF included.
  • Native adom-wiki release download adom/adom-ds2sf 1.1.1 --platform linux --arch x64: succeeded with integrity_ok:true, verifying documented release transport behavior.
  • Local ADOM Chip Fetcher doctor became 13/13 after temporary manual install of recovered binary (this is a workstation hotfix only).

Important upstream acceptance still required

  1. Review the legacy binary's source provenance and decide whether to use it temporarily or rebuild current Rust source in ADOM's official build environment, including the native Altium dependencies.
  2. Publish a fresh package version AND its corresponding signed Linux-x64 adom-sfconvert release asset before declaring operational installation fixed. The currently published v1.0.8 has no release assets.
  3. Install the new package from scratch in a clean ADOM workspace, run all three native format tests with maintainer-owned fixtures, and rerun adom-chip-fetcher doctor.
  4. Add Windows/macOS/arm64 assets and platform installers separately if those platforms are supported. This PR intentionally fails clearly on unsupported platforms.
  5. The Chip Fetcher desktop/Bridge warning and unfinished part-library engineering are independent, not fixed by this package PR.

No Helmstation/Circuit Forge designs, libraries, hardware qualifications, proprietary schematics, or private project code are included.

Diff Skip to comments (1)

--- a/install.sh+++ b/install.sh@@ -1,7 +1,64 @@ #!/usr/bin/env bash-set -e-HERE="$(cd "$(dirname "$0")" && pwd)"-DEST="$HOME/.claude/skills/adom-sfconvert"-mkdir -p "$DEST"-cp -f "$HERE/skills/adom-sfconvert/SKILL.md" "$DEST/SKILL.md"-echo "Installed adom-sfconvert skill → $DEST"+set -euo pipefail+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+SKILL_DIR="$HOME/.claude/skills/adom-sfconvert"+BIN_DIR="$HOME/.local/bin"+STATE_DIR="$HOME/.local/share/adom-sfconvert"+REF="adom/adom-sfconvert"+RECOVERED_LEGACY_SHA256="98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d"++if [[ "$(uname -s)/$(uname -m)" != "Linux/x86_64" ]]; then+  echo "ERROR: SF Convert release asset for this platform is not yet available (only Linux x64 supported by this installer)." >&2+  exit 1+fi+VERSION="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "$HERE/package.json" | head -n 1)"+if [[ -z "$VERSION" ]]; then+  echo "ERROR: package.json has no version; cannot select signed ADOM release asset." >&2+  exit 1+fi+WIKI_BIN="$(command -v adom-wiki || true)"+if [[ -z "$WIKI_BIN" && -x "$HOME/.local/bin/adom-wiki" ]]; then+  WIKI_BIN="$HOME/.local/bin/adom-wiki"+fi+if [[ -z "$WIKI_BIN" ]]; then+  echo "ERROR: adom-wiki CLI required to download and verify the signed release asset." >&2+  exit 1+fi+TMP="$(mktemp -d)"+trap 'rm -rf "$TMP"' EXIT+if ! "$WIKI_BIN" release download "$REF" "$VERSION" --platform linux --arch x64 --out "$TMP"; then+  echo "ERROR: ADOM release $REF $VERSION has no downloadable Linux x64 executable. Maintainer must run: adom-wiki release upload $REF $VERSION <built-executable> --platform linux --arch x64" >&2+  exit 1+fi+if ! "$WIKI_BIN" release verify "$REF" "$VERSION" --platform linux --arch x64; then+  echo "ERROR: ADOM release asset integrity verification failed." >&2+  exit 1+fi+SOURCE_BIN="$TMP/adom-sfconvert"+if [[ ! -s "$SOURCE_BIN" ]]; then+  echo "ERROR: Missing $SOURCE_BIN in verified release download." >&2+  exit 1+fi+NEW_SHA256="$(sha256sum "$SOURCE_BIN" | cut -d ' ' -f1)"+if [[ -f "$BIN_DIR/adom-sfconvert" ]]; then+  CURRENT_SHA256="$(sha256sum "$BIN_DIR/adom-sfconvert" | cut -d ' ' -f1)"+  OWNED_SHA256="$(cat "$STATE_DIR/installed.sha256" 2>/dev/null || true)"+  if [[ "$CURRENT_SHA256" != "$NEW_SHA256" && "$CURRENT_SHA256" != "$OWNED_SHA256" && "$CURRENT_SHA256" != "$RECOVERED_LEGACY_SHA256" ]]; then+    echo "ERROR: Existing adom-sfconvert was not installed by this package; refusing to overwrite." >&2+    exit 1+  fi+fi+mkdir -p "$BIN_DIR" "$SKILL_DIR" "$STATE_DIR"+TEMP_BIN="$(mktemp "$BIN_DIR/.adom-sfconvert.XXXXXXXX")"+trap 'rm -rf "$TMP"; rm -f "$TEMP_BIN"' EXIT+install -m 0755 "$SOURCE_BIN" "$TEMP_BIN"+if ! "$TEMP_BIN" version 1>/dev/null; then+  echo "ERROR: Signed SF Convert asset failed executable smoke test." >&2+  exit 1+fi+mv -f "$TEMP_BIN" "$BIN_DIR/adom-sfconvert"+cp -f "$HERE/skills/adom-sfconvert/SKILL.md" "$SKILL_DIR/SKILL.md"+printf '%s\n' "$NEW_SHA256" > "$STATE_DIR/installed.sha256"+echo "Installed verified ADOM SF Convert $VERSION CLI -> $BIN_DIR/adom-sfconvert"+echo "Installed adom-sfconvert skill -> $SKILL_DIR"+--- a/uninstall.sh+++ b/uninstall.sh@@ -1,3 +1,20 @@ #!/usr/bin/env bash+set -euo pipefail+TARGET="$HOME/.local/bin/adom-sfconvert"+STATE_DIR="$HOME/.local/share/adom-sfconvert"+RECOVERED_LEGACY_SHA256="98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d"+if [[ -f "$TARGET" ]]; then+  CURRENT_SHA256="$(sha256sum "$TARGET" | cut -d ' ' -f1)"+  OWNED_SHA256="$(cat "$STATE_DIR/installed.sha256" 2>/dev/null || true)"+  if [[ "$CURRENT_SHA256" == "$OWNED_SHA256" || "$CURRENT_SHA256" == "$RECOVERED_LEGACY_SHA256" ]]; then+    rm -f "$TARGET"+    echo "Removed package-owned adom-sfconvert CLI"+  else+    echo "NOTICE: Kept independently modified adom-sfconvert at $TARGET" >&2+  fi+fi+rm -f "$STATE_DIR/installed.sha256"+rmdir "$STATE_DIR" 2>/dev/null || true rm -rf "$HOME/.claude/skills/adom-sfconvert" echo "Removed adom-sfconvert skill"+--- a/tests/smoke.sh+++ b/tests/smoke.sh@@ -0,0 +1,57 @@+#!/usr/bin/env bash+set -euo pipefail+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+TEST_ROOT="$(mktemp -d)"+trap 'rm -rf "$TEST_ROOT"' EXIT+export HOME="$TEST_ROOT/home"+mkdir -p "$HOME" "$TEST_ROOT/mock"+if [[ -z "${ADOM_TEST_RELEASE_BINARY:-}" ]]; then+  if [[ -f "$HERE/release-candidates/linux-x64/adom-sfconvert" ]]; then+    export ADOM_TEST_RELEASE_BINARY="$HERE/release-candidates/linux-x64/adom-sfconvert"+  else+    echo "ERROR: set ADOM_TEST_RELEASE_BINARY to the official Linux-x64 release candidate when running this test from the upstream text-only PR." >&2+    exit 2+  fi+fi+test -s "$ADOM_TEST_RELEASE_BINARY"+cat > "$TEST_ROOT/mock/adom-wiki" <<'MOCK'+#!/usr/bin/env bash+set -euo pipefail+if [[ "$1/$2" == "release/download" ]]; then+  while [[ "$#" -gt 0 ]]; do+    if [[ "$1" == "--out" ]]; then+      shift+      cp "$ADOM_TEST_RELEASE_BINARY" "$1/adom-sfconvert"+      echo '{"assets":[{"integrity_ok":true}]}'+      exit 0+    fi+    shift+  done+elif [[ "$1/$2" == "release/verify" ]]; then+  echo '{"verified":true}'+  exit 0+fi+exit 1+MOCK+chmod +x "$TEST_ROOT/mock/adom-wiki"+export PATH="$TEST_ROOT/mock:$PATH"+bash "$HERE/install.sh"+CLI="$HOME/.local/bin/adom-sfconvert"+test -x "$CLI"+[[ "$("$CLI" version)" == adom-sfconvert\ * ]]+"$CLI" convert "$HERE/tests/fixtures/test2pin.lbr" --out-dir "$TEST_ROOT/out" --name TEST2+test -s "$TEST_ROOT/out/TEST2.kicad_sym"+test -s "$TEST_ROOT/out/TEST2.kicad_mod"+test -s "$TEST_ROOT/out/TEST2-symbol.svg"+test -s "$TEST_ROOT/out/TEST2-footprint.svg"+grep -q '(number "1"' "$TEST_ROOT/out/TEST2.kicad_sym"+grep -q '(number "2"' "$TEST_ROOT/out/TEST2.kicad_sym"+grep -q '(pad "1"' "$TEST_ROOT/out/TEST2.kicad_mod"+grep -q '(pad "2"' "$TEST_ROOT/out/TEST2.kicad_mod"+test "$(cat "$HOME/.local/share/adom-sfconvert/installed.sha256")" = "$(sha256sum "$ADOM_TEST_RELEASE_BINARY" | cut -d " " -f1)"+bash "$HERE/uninstall.sh"+test ! -e "$CLI"+test ! -e "$HOME/.local/share/adom-sfconvert/installed.sha256"+test ! -e "$HOME/.claude/skills/adom-sfconvert/SKILL.md"+echo "PASS: mock signed-release download, installer, executable, conversion and uninstall"+--- a/tests/fixtures/test2pin.lbr+++ b/tests/fixtures/test2pin.lbr@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8"?>+<eagle version="9.6.2"><drawing><library>+<packages><package name="TEST2"><smd name="1" x="-1.27" y="0" dx="1" dy="1" layer="1"/><smd name="2" x="1.27" y="0" dx="1" dy="1" layer="1"/></package></packages>+<symbols><symbol name="TEST2"><pin name="A" x="-5.08" y="0" length="short" rot="R0"/><pin name="B" x="5.08" y="0" length="short" rot="R180"/></symbol></symbols>+<devicesets><deviceset name="TEST2"><gates><gate name="G$1" symbol="TEST2" x="0" y="0"/></gates><devices><device name="" package="TEST2"><connects><connect gate="G$1" pin="A" pad="1"/><connect gate="G$1" pin="B" pad="2"/></connects></device></devices></deviceset></devicesets>+</library></drawing></eagle>+--- a/tests/README.md+++ b/tests/README.md@@ -0,0 +1,40 @@+# SF Convert executable package smoke test++Current SF Convert package installs only a Claude skill. It omits its Rust+converter executable. The CLI is required by ADOM Chip Fetcher.++This patch installs the CLI through the **official ADOM Wiki release asset**+mechanism, with platform/arch selection and registry integrity verification.+The executable must be uploaded by the upstream maintainer for the release+version, BEFORE users install the package. This source PR cannot attach+an asset to the maintainer's signed release.++Run `ADOM_TEST_RELEASE_BINARY=/path/to/reviewed/adom-sfconvert bash tests/smoke.sh` on Linux x86_64. In the contributor checkout it also discovers the forked release-candidate path automatically. It uses a temporary isolated HOME+and a **mock** ADOM release response to test the installer contract and a+synthetic EAGLE fixture. It does not test ADOM's real release verification,+which was separately confirmed with the published adom-ds2sf 1.1.1 asset.++The ADOM-built executable recovered from SF Convert v1.0.2 source history is+staged in the contributor fork at `josh/adom-sfconvert` branch+`fix/sfconvert-release-asset-cli-20261105`, path+`release-candidates/linux-x64/adom-sfconvert`. The ADOM upstream PR itself+is text-only, so the executable is **not included in its file-set diff or+the install package tarball**. Source: `f8a1099aa39c9adc22b23e3805a809d9aa14b38c`.+SHA-256:+`98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d`.+It reports internal `0.1.0`; it is a tested RECOVERY artifact, not a+rebuild of the latest Rust source. ADOM maintainers should replace it with+a fresh build from current Rust source (requires Altium dependency crates).+Only Linux x64 has been validated.++Real source-native ADOM conversion smoke tests passed on the recovered+executable, with generated KiCad export and native SVG previews:+- `fusion-bridge/resources/samples/0603WAF3300T5E.lbr`+- `board-to-molecule/assets/pins/MachinePinMediumShort.SchLib`+- `board-to-molecule/assets/pins/MachinePinMediumShort.PcbLib`++Upstream release gate: publish new package and a per-platform native asset+with identical version number; verify `adom-wiki release assets`, install+in clean HOME, run conversion suite and `adom-chip-fetcher doctor`.+Do not mark the fix complete upstream merely because the package is signed.+

Comments

Josh Aberdeen ·

Contribution consolidation: please treat this PR #1 as the primary fix for issue #1. I closed duplicate PR #3 after verifying equivalent native installer logic. PR #3 contains an optional improvement to its smoke test: retrieve the official v1.0.2 Linux executable from ADOM history using adom-wiki repo show with ref f8a1099aa39c9adc22b23e3805a809d9aa14b38c and verify SHA256 98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d. This allows a reproducible isolated test without distributing ELF in a PR. All ADOM release-asset signing and clean-build acceptance gates remain mandatory; the historical binary is only a recovery candidate.

Log in to comment.