← All Pull Requests

Draft: Restore native SF Convert CLI via release assets (issue 1) #2

Open Draft opened by Josh Aberdeen

Fix native SF Convert CLI installation; upstream issue #1

This draft PR replaces the original skill-only install with a native, fail-closed executable installer that follows today's ADOM Wiki release-asset policy. The source edits and tests are ready for review, but the maintainer must supply an official matching-version Linux/x64 release binary before publication.

What broke

  • SF Convert v1.0.0 already had an installer that copied only a skill, never the native CLI.
  • Commit 433f75a removed the historical target/release executable before v1.0.3.
  • Since v1.0.6, package.json files[] excludes all build artefacts.
  • Current package v1.0.8 verifies signature and says build ready, yet adom-chip-fetcher doctor reports missing CLI; issue #1 confirms it.

What this PR changes

  • install.sh detects supported OS/arch, reads its matching package version, retrieves the executable using native adom-wiki release download from adom/adom-sfconvert, runs it, installs atomically to ~/.local/bin and continues to install the ADOM Claude skill. No executable asset = nonzero exit, not a false success.
  • uninstall.sh removes only the checksum-matching binary installed by the package; it leaves unrelated or replaced executables alone.
  • package.json adds the documented binary-release contract and test fixture files. Per adom-wiki pkg lint, compiled binaries stay out of skill tarballs and belong in release assets.
  • A deterministic smoke test converts a synthetic two-pin EAGLE .lbr to .kicad_sym, .kicad_mod and native SVG previews. The installer has an explicit local binary override solely for isolated offline tests.

Tested on the workstation's ADOM WSL Linux/x64

  • Official historical ADOM SF Convert CLI recovered from repo commit f8a1099 (package v1.0.2, internal Rust version 0.1.0, SHA-256 98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d).
  • EAGLE two-pin fixture: four expected CAD/SVG outputs PASS.
  • Public Altium .PcbLib fixture from embedded-society/altium-designer-mcp: KiCad footprint and SVG PASS.
  • Public .SchLib fixtures from akiselev/altium-cli-test-schlib: Diodes, TinyShuffle, SIM808 symbols and SVG PASS.
  • One other valid public .SchLib from embedded-society fails in the old parser due OLE directory ordering; not claimed fixed.
  • adom-wiki pkg lint: ZERO errors; binary-in-tarball warning eliminated.
  • adom-wiki pkg pack: self-contained text/skill package produced. Isolated offline installer test with explicit historical ADOM binary override PASS. Clean install/uninstall previously tested with package-contained prototype.

Maintainer action still required before merge/release

  • Rebuild current Rust source using ADOM's private altium-pcblib dependency. Do not relabel the recovered 0.1.0 binary as 1.0.8.
  • Upload the new per-platform binary to the same-version ADOM release using adom-wiki release upload adom/adom-sfconvert <version> <file> --platform linux --arch x64.
  • Test adom-wiki pkg install without an override and verify the CLI and Chip Fetcher doctor pass. Extend Altium .SchLib corpus; add other platforms only after verifying them.
  • Coordinate version bump and asset publishing order.

No Helmstation data, Circuit Forge code, proprietary customer CAD or private part libraries included. Test input is an original synthetic fixture. This PR contributes only to the existing native ADOM application and workflow.

References: adom/adom-sfconvert#1.

Diff Skip to comments

--- a/install.sh+++ b/install.sh@@ -1,7 +1,37 @@ #!/usr/bin/env bash-set -e+set -euo pipefail 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"+SKILL_SOURCE="$HERE/skills/adom-sfconvert/SKILL.md"+SKILL_TARGET="$HOME/.claude/skills/adom-sfconvert/SKILL.md"+BIN_DIR="${ADOM_BIN_DIR:-$HOME/.local/bin}"+STATE_DIR="${ADOM_SFCONVERT_STATE_DIR:-$HOME/.local/share/adom-sfconvert}"+case "$(uname -s)/$(uname -m)" in+  Linux/x86_64) OS=linux; ARCH=x64 ;;+  *) echo "ERROR: SF Convert CLI has no verified release for $(uname -s)/$(uname -m)" >&2; exit 1 ;;+esac+[[ -f "$SKILL_SOURCE" ]] || { echo "ERROR: missing SF Convert skill" >&2; exit 1; }+VERSION="$(python3 - "$HERE/package.json" <<'PY'+import json,sys+print(json.load(open(sys.argv[1]))['version'])+PY+)"+mkdir -p "$BIN_DIR" "$STATE_DIR" "$(dirname "$SKILL_TARGET")"+TEMP="$(mktemp "$BIN_DIR/.adom-sfconvert.XXXXXXXX")"+trap 'rm -f "$TEMP"' EXIT+if [[ -n "${ADOM_SFCONVERT_TEST_BINARY:-}" ]]; then+  # Explicit offline test override only; normal installation uses signed ADOM release.+  install -m 0755 "$ADOM_SFCONVERT_TEST_BINARY" "$TEMP"+else+  command -v adom-wiki >/dev/null || { echo "ERROR: adom-wiki CLI missing" >&2; exit 1; }+  adom-wiki release download adom/adom-sfconvert "$VERSION" --platform "$OS" --arch "$ARCH" --out "$TEMP"+  chmod 0755 "$TEMP"+fi+"$TEMP" version >/dev/null+HASH="$(sha256sum "$TEMP" | awk '{print $1}')"+mv -f "$TEMP" "$BIN_DIR/adom-sfconvert"+printf '%s\n' "$HASH" > "$STATE_DIR/installed.sha256"+cp -f "$SKILL_SOURCE" "$SKILL_TARGET"+"$BIN_DIR/adom-sfconvert" version+echo "Installed native ADOM SF Convert CLI -> $BIN_DIR/adom-sfconvert"+echo "Installed ADOM SF Convert skill -> $SKILL_TARGET"+--- a/uninstall.sh+++ b/uninstall.sh@@ -1,3 +1,18 @@ #!/usr/bin/env bash-rm -rf "$HOME/.claude/skills/adom-sfconvert"-echo "Removed adom-sfconvert skill"+set -euo pipefail+BIN="${ADOM_BIN_DIR:-$HOME/.local/bin}/adom-sfconvert"+STATE="${ADOM_SFCONVERT_STATE_DIR:-$HOME/.local/share/adom-sfconvert}/installed.sha256"+if [[ -f "$BIN" && -f "$STATE" ]]; then+  expected="$(cat "$STATE")"+  actual="$(sha256sum "$BIN" | awk '{print $1}')"+  if [[ "$actual" == "$expected" ]]; then+    rm -f "$BIN" "$STATE"+    echo "Removed package-managed ADOM SF Convert CLI"+  else+    echo "Keeping CLI because it differs from this package's installed binary: $BIN"+  fi+fi+rm -f "$HOME/.claude/skills/adom-sfconvert/SKILL.md"+rmdir "$HOME/.claude/skills/adom-sfconvert" 2>/dev/null || true+echo "Removed ADOM SF Convert skill"+--- a/package.json+++ b/package.json@@ -1,48 +1,52 @@⋯ 1 unchanged line ⋯   "slug": "adom-sfconvert",   "version": "1.0.8",   "type": "skill",-  "description": "Native Rust converter: EAGLE/Fusion .lbr + Altium .SchLib/.PcbLib \u2192 KiCad symbol+footprint, rendering each format's OWN geometry. No KiCad install, no service round-trip.",+  "description": "Native Rust converter: EAGLE/Fusion .lbr + Altium .SchLib/.PcbLib → KiCad symbol+footprint, rendering each format's OWN geometry. No KiCad install, no service round-trip.",   "dependencies": {     "adom/altium-schlib": "*",     "adom/altium-pcblib": "*"⋯ 34 unchanged lines ⋯     "SKILL.md",     "install.sh",     "uninstall.sh",-    "package.json"+    "package.json",+    "tests/test-smoke.sh",+    "tests/fixtures/two-pin.lbr",+    "docs/SFCONVERT_RELEASE_ASSET_CONTRACT.md"   ] }+--- a/tests/test-smoke.sh+++ b/tests/test-smoke.sh@@ -0,0 +1,20 @@+#!/usr/bin/env bash+set -euo pipefail+HERE="$(cd "$(dirname "$0")" && pwd)"+ROOT="$(dirname "$HERE")"+BIN="${1:-$ROOT/bin/linux-x86_64/adom-sfconvert}"+BIN="$(readlink -f "$BIN")"+"$BIN" version | grep -Eq '^adom-sfconvert [0-9]+'+OUT="$(mktemp -d)"+trap 'rm -rf "$OUT"' EXIT+"$BIN" convert "$HERE/fixtures/two-pin.lbr" --out-dir "$OUT" --name sfconvert_test+for f in sfconvert_test.kicad_sym sfconvert_test.kicad_mod sfconvert_test-symbol.svg sfconvert_test-footprint.svg; do+  [[ -s "$OUT/$f" ]] || { echo "FAIL: missing $f" >&2; exit 1; }+done+grep -q '(pad "1"' "$OUT/sfconvert_test.kicad_mod"+grep -q '(pad "2"' "$OUT/sfconvert_test.kicad_mod"+grep -q '(number "1"' "$OUT/sfconvert_test.kicad_sym"+grep -q '(number "2"' "$OUT/sfconvert_test.kicad_sym"+grep -q '<svg' "$OUT/sfconvert_test-footprint.svg"+echo "SF Convert EAGLE symbol/footprint/SVG smoke test: PASS"+--- a/tests/fixtures/two-pin.lbr+++ b/tests/fixtures/two-pin.lbr@@ -0,0 +1,19 @@+<?xml version="1.0" encoding="utf-8"?>+<eagle version="9.6.2">+<drawing><library>+<packages><package name="AUDIT2">+<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="AUDIT2">+<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="AUDIT2"><gates>+<gate name="G$1" symbol="AUDIT2" x="0" y="0"/>+</gates><devices><device name="" package="AUDIT2"><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/docs/SFCONVERT_RELEASE_ASSET_CONTRACT.md+++ b/docs/SFCONVERT_RELEASE_ASSET_CONTRACT.md@@ -0,0 +1,37 @@+# SF Convert binary distribution contract++Upstream issue: adom/adom-sfconvert#1.++The published SF Convert package currently installs the skill only. A signed+ADOM package can pass integrity verification without containing a runnable CLI.+The native ADOM Wiki linter now requires compiled executables to be uploaded+as platform **release assets**, rather than embedded into the skill tarball.++The proposed installer uses:+  adom-wiki release download adom/adom-sfconvert <package-version> \+    --platform linux --arch x64 --out <temporary-path>++It validates that the downloaded executable runs before atomically installing+it in ~/.local/bin. The skill remains installed in ~/.claude/skills.++**Required upstream release action:** ADOM's authorised release maintainer must+publish a rebuilt Linux/x64 executable as a release asset for the same version+before publishing the corresponding package. An unavailable release asset is+an installation ERROR, not a green health check.++An isolated legacy recovery binary exists from the official source archive at+commit f8a1099 (published SF Convert 1.0.2). Its SHA-256 is+98e18a9b56a0bbaece7e04cb49c6134433f7a8344649c734f059b13e6c5a7f9d+and its internal version is 0.1.0. It is **not** being represented as a+fresh 1.0.8 build or included in this text-only PR.++Validation: synthetic EAGLE fixture passes, public PcbLib fixture passes, and+three public SchLib fixtures pass. One other public SchLib failed in the+legacy reader (OLE name ordering). The maintainer should rebuild current Rust+source with the private ADOM altium-pcblib crate and extend fixture coverage+before general availability.++ADOM_SFCONVERT_TEST_BINARY allows isolated offline installer tests using an+explicit local binary source. It is not used in ordinary ADOM Wiki installs.+No project/user schematic, PCB or proprietary files are part of this change.+

Comments

No comments yet.

Log in to comment.