Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

store: Solder — Autonomous Circuit's KiCad-native pipeline, wrapped as an agent

31803smitheafe38dce28f
diff --git a/store/agents/solder/.gitignore b/store/agents/solder/.gitignore
new file mode 100644
index 000000000..12d09bc65
--- /dev/null
+++ b/store/agents/solder/.gitignore
@@ -0,0 +1,5 @@
+# The wrapped project, fetched by toolchain/setup.sh — never source here.
+upstream/
+upstream.partial/
+# The board pipeline's Python, made by toolchain/setup.sh.
+.venv/
diff --git a/store/agents/solder/LICENSE b/store/agents/solder/LICENSE
new file mode 100644
index 000000000..cf1e02bda
--- /dev/null
+++ b/store/agents/solder/LICENSE
@@ -0,0 +1,23 @@
+MIT License
+
+Copyright (c) 2026 Autonomous (the Harness wrapper: harness.json, VERSIONS, toolchain/, README.md).
+Autonomous Circuit itself is not part of this package; it is fetched from its own repository at
+setup time and is under that repository's LICENSE.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/solder/README.md b/store/agents/solder/README.md
new file mode 100644
index 000000000..d799b5a52
--- /dev/null
+++ b/store/agents/solder/README.md
@@ -0,0 +1,40 @@
+# Solder, as a Harness agent
+
+[Harness](https://github.com/autonomous-ai/openharness) agent package for the **KiCad-native**
+pipeline of [Autonomous Circuit](https://github.com/autonomous-ai/autonomous-circuit): describe a board
+in the chat pane and get a real KiCad project — a wired schematic, copper KiCad's own ERC/DRC has
+checked, a prototype packet a fab can quote — with the project's own live board view in the pane beside
+the agent. Runs on Claude Code.
+
+Solder is the sibling of [Autonomous Circuit](../autonomous-circuit/) (the v1 pipeline, tscircuit
+sources, the same repository's `main`), not its replacement: the two wrap different branches of one
+repository, and a user who wants a KiCad project picks Solder.
+
+This folder is a **wrapper**. It holds no Circuit code: `toolchain/setup.sh` fetches the project from
+its own public repository at the commit `VERSIONS` pins (everything but its product library and
+examples) into `upstream/`, then runs the Solder package's own setup there
+(`upstream/harness/kicad/`). The manifest points the agent at that package's `AGENTS.md`, skill and
+template; the doctor, workspace init and viewer are that package's own scripts, run against the copy.
+
+- `harness.json` — name, category, engine, and paths into `upstream/harness/kicad/`.
+- `VERSIONS` — the repository, the pinned commit (on its `feat/v2-kicad-native` branch), the sparse patterns.
+- `toolchain/runtimes.sh` — the store's copy: a Node and a venv Python of the package's own.
+- `toolchain/fetch-upstream.sh` — the read-only, sparse, blob-less fetch; `setup.sh`, `doctor.sh`,
+ `init-workspace.sh`, `viewer.sh`, `python` hand off to the package's scripts of the same names.
+
+What the machine must have: **KiCad** (`brew install --cask kicad` — kicad-cli and its bundled Python with
+`pcbnew`; the doctor fails without them), the engine CLI, git. Node and Python come with the package;
+Freerouting and the viewer are vendored by setup.
+
+## Credit and stewardship
+
+Autonomous Circuit is its own project, [autonomous-ai/autonomous-circuit](https://github.com/autonomous-ai/autonomous-circuit),
+under its repository's licence (MIT). Nothing of it is changed or copied here. Bugs in board generation
+belong in that repository, bugs in the wrapper belong here, and a newer Solder is a bump of
+`UPSTREAM_COMMIT` in `VERSIONS`.
+
+```sh
+harness dsh check "$PWD" # conformance (warns: the project arrives with setup)
+harness dsh install "$PWD" --link # this checkout as the installed agent
+python3 -m unittest discover -s toolchain # the wrapper's own tests
+```
diff --git a/store/agents/solder/VERSIONS b/store/agents/solder/VERSIONS
new file mode 100644
index 000000000..b916ee90b
--- /dev/null
+++ b/store/agents/solder/VERSIONS
@@ -0,0 +1,10 @@
+# Solder — Autonomous Circuit's KiCad-native pipeline, wrapped here as it is on its v2 branch.
+# The v2 pipeline lives on `feat/v2-kicad-native` (its main carries the v1 pipeline that
+# autonomous/autonomous-circuit wraps); a newer Solder is a bump of UPSTREAM_COMMIT to a later
+# commit on that branch. The fetch is by commit, so an unmerged branch is fine.
+UPSTREAM_NAME="autonomous-circuit"
+UPSTREAM_REPO="https://github.com/autonomous-ai/autonomous-circuit.git"
+UPSTREAM_COMMIT="92dcd44935871fbe3fb2c926ac9cab21ff78db79"
+# Everything but its product library and examples (118 MB a board build never reads).
+UPSTREAM_SPARSE_MODE="no-cone"
+UPSTREAM_SPARSE="/* !/products/ !/examples/"
diff --git a/store/agents/solder/harness.json b/store/agents/solder/harness.json
new file mode 100644
index 000000000..0c2926d0d
--- /dev/null
+++ b/store/agents/solder/harness.json
@@ -0,0 +1,36 @@
+{
+ "spec": 1,
+ "id": "autonomous/solder",
+ "name": "Solder",
+ "category": "PCB",
+ "author": "Autonomous",
+ "description": "Describe a board; get a KiCad-native PCB — a real schematic, DRC-checked copper, a prototype packet — with a live board view.",
+ "engine": "claude",
+ "workspace": {
+ "template": "upstream/harness/kicad/template",
+ "marker": "project.json",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "upstream/harness/kicad/AGENTS.md",
+ "skills": ["upstream/harness/kicad/skills"],
+ "env": {
+ "SOLDER_PYTHON": "${dsh}/upstream/harness/kicad/toolchain/python",
+ "CIRCUIT_PYTHON": "${dsh}/toolchain/python",
+ "SOLDER_ROOT": "${dsh}/upstream",
+ "SOLDER_BLOCKS": "${dsh}/upstream/packages/golden-blocks/blocks",
+ "CIRCUIT_TOOLCHAIN": "${dsh}/upstream/toolchain",
+ "CIRCUIT_SKILLS_DIR": "${workspace}/.claude/skills",
+ "DISABLE_AUTOUPDATER": "1"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "command": "toolchain/viewer.sh",
+ "url": "http://127.0.0.1:${port}/"
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/solder/store.json b/store/agents/solder/store.json
new file mode 100644
index 000000000..d87726eef
--- /dev/null
+++ b/store/agents/solder/store.json
@@ -0,0 +1,6 @@
+{
+ "upstream": "https://github.com/autonomous-ai/autonomous-circuit",
+ "license": "MIT",
+ "tagline": "A real KiCad board: wired schematic, DRC-checked copper, a prototype packet",
+ "screenshots": []
+}
diff --git a/store/agents/solder/toolchain/doctor.sh b/store/agents/solder/toolchain/doctor.sh
new file mode 100755
index 000000000..792894afe
--- /dev/null
+++ b/store/agents/solder/toolchain/doctor.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# The package's own doctor, run against the fetched copy. cwd = the install dir.
+# The copy at the pin, the venv, then Solder's doctor: engine CLI, node, kicadpy on the venv,
+# kicad-cli and pcbnew (required), Freerouting vendored, the viewer built.
+set -uo pipefail
+cd "$(dirname "$0")/.."
+. ./VERSIONS
+. toolchain/runtimes.sh
+if [ ! -f upstream/.harness-commit ]; then
+ echo "miss autonomous-circuit is not fetched — run toolchain/setup.sh"; exit 1
+fi
+[ "$(cat upstream/.harness-commit)" = "${UPSTREAM_COMMIT}" ] \
+ && echo "ok autonomous-circuit @ ${UPSTREAM_COMMIT:0:12} (Solder, v2 branch)" \
+ || echo "warn autonomous-circuit @ $(cut -c1-12 upstream/.harness-commit), VERSIONS pins ${UPSTREAM_COMMIT:0:12} — run toolchain/setup.sh"
+harness_node 22.12 >/dev/null || true
+venv=0
+.venv/bin/python -c 'import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1 \
+ || { echo "miss .venv (the pipeline's Python >= 3.10) — run toolchain/setup.sh"; venv=1; }
+[ -x upstream/harness/kicad/toolchain/doctor.sh ] || { echo "miss upstream/harness/kicad/toolchain/doctor.sh"; exit 1; }
+CIRCUIT_TOOLCHAIN="${CIRCUIT_TOOLCHAIN:-$PWD/upstream/toolchain}" CIRCUIT_PYTHON="${CIRCUIT_PYTHON:-$PWD/toolchain/python}" \
+ upstream/harness/kicad/toolchain/doctor.sh
+code=$?
+exit $((code ? code : venv))
diff --git a/store/agents/solder/toolchain/fetch-upstream.sh b/store/agents/solder/toolchain/fetch-upstream.sh
new file mode 100755
index 000000000..05dd88c28
--- /dev/null
+++ b/store/agents/solder/toolchain/fetch-upstream.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Fetch the wrapped project into upstream/ at the commit VERSIONS pins — read-only, from its public
+# repository, sparse and blob-less so only the folders a build needs come down. Idempotent: a matching
+# upstream/.harness-commit means it is already there. Sourced by setup.sh; cwd = the package dir.
+set -euo pipefail
+. ./VERSIONS
+if [ -f upstream/.harness-commit ] && [ "$(cat upstream/.harness-commit)" = "${UPSTREAM_COMMIT}" ]; then
+ echo "ok ${UPSTREAM_NAME} @ ${UPSTREAM_COMMIT:0:12} already fetched"
+ exit 0
+fi
+command -v git >/dev/null 2>&1 || { echo "miss git on PATH"; exit 1; }
+echo " fetching ${UPSTREAM_REPO} @ ${UPSTREAM_COMMIT:0:12} (${UPSTREAM_SPARSE_MODE} sparse: ${UPSTREAM_SPARSE})"
+# The copy in upstream/ stays until the new one is complete: a fetch that fails (offline, a bad pin)
+# leaves the install that worked.
+rm -rf upstream.partial
+git init -q upstream.partial
+git -C upstream.partial remote add origin "${UPSTREAM_REPO}"
+# Split the patterns on spaces WITHOUT globbing: `/*` is a sparse pattern, not the filesystem root.
+read -r -a patterns <<<"${UPSTREAM_SPARSE}"
+git -C upstream.partial sparse-checkout set --"${UPSTREAM_SPARSE_MODE}" -- "${patterns[@]}"
+git -C upstream.partial fetch -q --depth 1 --filter=blob:none origin "${UPSTREAM_COMMIT}"
+git -C upstream.partial checkout -q FETCH_HEAD
+echo "${UPSTREAM_COMMIT}" > upstream.partial/.harness-commit
+rm -rf upstream
+mv upstream.partial upstream
+echo "ok ${UPSTREAM_NAME} @ ${UPSTREAM_COMMIT:0:12} fetched ($(du -sh upstream | cut -f1))"
diff --git a/store/agents/solder/toolchain/init-workspace.sh b/store/agents/solder/toolchain/init-workspace.sh
new file mode 100755
index 000000000..57c83bade
--- /dev/null
+++ b/store/agents/solder/toolchain/init-workspace.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+# The package's own workspace init, cwd = the new workspace. Solder's init expects HARNESS_DSH_DIR
+# to be its own package dir (it runs `$HARNESS_DSH_DIR/toolchain/python` to seed the verdict).
+set -euo pipefail
+here="$(cd "$(dirname "$0")/.." && pwd)"
+HARNESS_DSH_DIR="$here/upstream/harness/kicad" CIRCUIT_PYTHON="${CIRCUIT_PYTHON:-$here/toolchain/python}" \
+ exec "$here/upstream/harness/kicad/toolchain/init-workspace.sh"
diff --git a/store/agents/solder/toolchain/python b/store/agents/solder/toolchain/python
new file mode 100755
index 000000000..3534c122c
--- /dev/null
+++ b/store/agents/solder/toolchain/python
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# The pipeline's host Python: the venv setup.sh made, with Harness's Node on PATH for the tools
+# that shell out to it. Solder's own `toolchain/python` (in upstream/) honours CIRCUIT_PYTHON, which
+# the manifest points here — so `"$SOLDER_PYTHON" -m kicadpy…` runs on this interpreter.
+here="$(cd "$(dirname "$0")/.." && pwd)"
+. "$here/toolchain/runtimes.sh"
+harness_node 22.12 >&2 || true
+exec "$here/.venv/bin/python" "$@"
diff --git a/store/agents/solder/toolchain/runtimes.sh b/store/agents/solder/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/solder/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/solder/toolchain/setup.sh b/store/agents/solder/toolchain/setup.sh
new file mode 100755
index 000000000..af3884a25
--- /dev/null
+++ b/store/agents/solder/toolchain/setup.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+# Runs once at install, cwd = the install dir: a Node and a Python of the package's own, then fetch
+# Autonomous Circuit at the pinned commit and run the Solder package's OWN setup in it (Freerouting
+# jar + JRE, the board viewer). KiCad is the machine's — doctor.sh reports it afterwards.
+set -euo pipefail
+cd "$(dirname "$0")/.."
+. toolchain/runtimes.sh
+harness_node 22.12 || exit 1
+harness_venv .venv 3.12 3.10 || exit 1
+toolchain/fetch-upstream.sh
+[ -x upstream/harness/kicad/toolchain/setup.sh ] || { echo "miss upstream/harness/kicad/toolchain/setup.sh"; exit 1; }
+HARNESS_DSH_DIR="$PWD/upstream/harness/kicad" CIRCUIT_PYTHON="$PWD/toolchain/python" \
+ upstream/harness/kicad/toolchain/setup.sh
diff --git a/store/agents/solder/toolchain/test_toolchain.py b/store/agents/solder/toolchain/test_toolchain.py
new file mode 100644
index 000000000..cff6f0f0e
--- /dev/null
+++ b/store/agents/solder/toolchain/test_toolchain.py
@@ -0,0 +1,162 @@
+"""python3 -m unittest discover -s toolchain — the Solder wrapper holds together.
+
+The wrapper is a manifest, a pin and five hand-off scripts. These tests check the manifest's every
+path points into `upstream/harness/kicad/` (the package this wraps), the pin is a full commit of the
+project's public repository, the scripts exist, are executable and hand off to the right upstream
+script with the environment Solder's own scripts expect, and `runtimes.sh` is the store's copy. No
+network, no install: the hand-offs are exercised against a stub `upstream/` in a temp dir.
+"""
+import hashlib
+import json
+import os
+import re
+import shutil
+import stat
+import subprocess
+import tempfile
+import unittest
+from pathlib import Path
+
+TOOLCHAIN = Path(__file__).resolve().parent
+PACKAGE = TOOLCHAIN.parent
+STORE = PACKAGE.parents[1]
+UPSTREAM_PKG = "upstream/harness/kicad"
+SCRIPTS = ("fetch-upstream.sh", "setup.sh", "doctor.sh", "init-workspace.sh", "viewer.sh", "python")
+# A stub of a Solder package script: says which one ran, with what, where; exits with $STUB_EXIT.
+STUB = ('#!/bin/sh\necho "{name} dsh=$HARNESS_DSH_DIR python=${{CIRCUIT_PYTHON:-}} toolchain=${{CIRCUIT_TOOLCHAIN:-}} '
+ 'pwd=$(pwd -P)"\nexit "${{STUB_EXIT:-0}}"\n')
+
+
+def manifest() -> dict:
+ return json.loads((PACKAGE / "harness.json").read_text())
+
+
+def versions_value(key: str) -> str:
+ match = re.search(rf'^{key}="([^"]*)"$', (PACKAGE / "VERSIONS").read_text(), re.M)
+ assert match, key
+ return match.group(1)
+
+
+class ManifestTest(unittest.TestCase):
+
+ def test_identity(self):
+ m = manifest()
+ self.assertEqual((m["spec"], m["id"], m["name"], m["category"]), (1, "autonomous/solder", "Solder", "PCB"))
+ self.assertIn(m["engine"], ("claude", "codex"))
+ self.assertEqual(m["verdict"], ".harness/verdict.json")
+
+ def test_every_project_path_points_into_the_wrapped_package(self):
+ m = manifest()
+ for rel in (m["workspace"]["template"], m["agent"]["instructions"], *m["agent"]["skills"]):
+ self.assertTrue(rel.startswith(UPSTREAM_PKG + "/"), rel)
+ self.assertEqual(m["workspace"]["marker"], "project.json")
+
+ def test_the_agent_runs_the_pipeline_on_the_wrappers_python(self):
+ env = manifest()["agent"]["env"]
+ self.assertEqual(env["SOLDER_PYTHON"], "${dsh}/" + UPSTREAM_PKG + "/toolchain/python")
+ self.assertEqual(env["CIRCUIT_PYTHON"], "${dsh}/toolchain/python")
+ self.assertEqual(env["SOLDER_ROOT"], "${dsh}/upstream")
+ self.assertEqual(env["CIRCUIT_TOOLCHAIN"], "${dsh}/upstream/toolchain")
+ expected = ".agents/skills" if manifest()["engine"] == "codex" else ".claude/skills"
+ self.assertTrue(env["CIRCUIT_SKILLS_DIR"].endswith(expected))
+
+ def test_the_wrappers_own_scripts_are_named_and_executable(self):
+ m = manifest()
+ for rel in (m["workspace"]["init"], m["toolchain"]["setup"], m["toolchain"]["doctor"], m["viewer"]["command"]):
+ self.assertTrue(rel.startswith("toolchain/"), rel)
+ self.assertTrue(os.access(PACKAGE / rel, os.X_OK), rel)
+ for name in SCRIPTS:
+ self.assertTrue(os.access(TOOLCHAIN / name, os.X_OK), name)
+
+ def test_versions_pins_a_full_commit_of_the_projects_public_repository(self):
+ self.assertRegex(versions_value("UPSTREAM_COMMIT"), r"^[0-9a-f]{40}$")
+ self.assertEqual(versions_value("UPSTREAM_REPO"), "https://github.com/autonomous-ai/autonomous-circuit.git")
+ self.assertEqual(versions_value("UPSTREAM_SPARSE_MODE"), "no-cone")
+
+ def test_runtimes_is_the_stores_copy(self):
+ ours = hashlib.sha256((TOOLCHAIN / "runtimes.sh").read_bytes()).hexdigest()
+ theirs = hashlib.sha256((STORE / "tools" / "runtimes.sh").read_bytes()).hexdigest()
+ self.assertEqual(ours, theirs, "run node store/tools/sync-runtimes.mjs")
+
+ def test_store_json_credits_the_upstream(self):
+ s = json.loads((PACKAGE / "store.json").read_text())
+ self.assertEqual(s["upstream"], "https://github.com/autonomous-ai/autonomous-circuit")
+ self.assertEqual(s["license"], "MIT")
+ self.assertLessEqual(len(s["tagline"]), 80)
+
+
+class HandoffTest(unittest.TestCase):
+ """Each hand-off script runs the stub of its upstream twin with the environment Solder expects."""
+
+ def setUp(self):
+ self.tmp = Path(tempfile.mkdtemp())
+ self.install = self.tmp / "install"
+ (self.install / "toolchain").mkdir(parents=True)
+ for name in ("init-workspace.sh", "viewer.sh", "doctor.sh", "runtimes.sh"):
+ shutil.copy(TOOLCHAIN / name, self.install / "toolchain" / name)
+ shutil.copy(PACKAGE / "VERSIONS", self.install / "VERSIONS")
+ pkg = self.install / UPSTREAM_PKG / "toolchain"
+ pkg.mkdir(parents=True)
+ for name in ("init-workspace.sh", "viewer.sh", "doctor.sh"):
+ path = pkg / name
+ path.write_text(STUB.format(name=name))
+ path.chmod(path.stat().st_mode | stat.S_IEXEC)
+ (self.install / "upstream" / ".harness-commit").write_text(versions_value("UPSTREAM_COMMIT"))
+ # A venv python that answers the version probe.
+ venv = self.install / ".venv" / "bin"
+ venv.mkdir(parents=True)
+ (venv / "python").write_text('#!/bin/sh\nexit 0\n')
+ (venv / "python").chmod(0o755)
+ self.env = {k: v for k, v in os.environ.items() if not k.startswith(("HARNESS_", "CIRCUIT_"))}
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp, ignore_errors=True)
+
+ def run_script(self, name, cwd=None, **extra):
+ return subprocess.run([str(self.install / "toolchain" / name)], cwd=cwd or self.install,
+ env={**self.env, **extra}, capture_output=True, text=True, timeout=60)
+
+ def test_init_runs_the_packages_own_in_the_workspace_with_its_package_dir(self):
+ ws = self.tmp / "ws"
+ ws.mkdir()
+ out = self.run_script("init-workspace.sh", cwd=ws)
+ self.assertEqual(out.returncode, 0, out.stderr)
+ self.assertIn(f"init-workspace.sh dsh={self.install}/{UPSTREAM_PKG} python={self.install}/toolchain/python", out.stdout)
+ self.assertIn(f"pwd={ws.resolve()}", out.stdout)
+
+ def test_viewer_hands_off_with_the_package_dir_and_the_venv_python(self):
+ out = self.run_script("viewer.sh", HARNESS_VIEWER_PORT="1", HARNESS_WORKSPACE=str(self.tmp))
+ self.assertEqual(out.returncode, 0, out.stderr)
+ self.assertIn(f"viewer.sh dsh={self.install}/{UPSTREAM_PKG} python={self.install}/toolchain/python", out.stdout)
+
+ def test_doctor_at_the_pin_hands_over_with_toolchain_and_python(self):
+ out = self.run_script("doctor.sh")
+ self.assertEqual(out.returncode, 0, out.stderr + out.stdout)
+ self.assertIn("ok autonomous-circuit @ " + versions_value("UPSTREAM_COMMIT")[:12], out.stdout)
+ self.assertIn(f"doctor.sh dsh= python={self.install}/toolchain/python toolchain={self.install}/upstream/toolchain", out.stdout)
+
+ def test_doctor_before_setup_is_a_miss(self):
+ (self.install / "upstream" / ".harness-commit").unlink()
+ out = self.run_script("doctor.sh")
+ self.assertEqual(out.returncode, 1)
+ self.assertIn("miss autonomous-circuit is not fetched", out.stdout)
+
+ def test_doctor_warns_when_the_copy_is_behind_the_pin(self):
+ (self.install / "upstream" / ".harness-commit").write_text("0" * 40)
+ out = self.run_script("doctor.sh")
+ self.assertIn("warn autonomous-circuit @ 000000000000, VERSIONS pins", out.stdout)
+
+ def test_doctor_relays_the_packages_failure(self):
+ out = self.run_script("doctor.sh", STUB_EXIT="1")
+ self.assertEqual(out.returncode, 1)
+
+ def test_doctor_without_the_venv_is_a_miss_and_still_asks_the_package(self):
+ shutil.rmtree(self.install / ".venv")
+ out = self.run_script("doctor.sh")
+ self.assertEqual(out.returncode, 1)
+ self.assertIn("miss .venv", out.stdout)
+ self.assertIn("doctor.sh dsh=", out.stdout)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/store/agents/solder/toolchain/viewer.sh b/store/agents/solder/toolchain/viewer.sh
new file mode 100755
index 000000000..6156d88c2
--- /dev/null
+++ b/store/agents/solder/toolchain/viewer.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# The project's own board viewer (viewer-only mode over the agent's workspace), on the port Harness
+# hands it, on a Node of the package's own.
+set -euo pipefail
+here="$(cd "$(dirname "$0")/.." && pwd)"
+. "$here/toolchain/runtimes.sh"
+harness_node 22.12 || exit 1
+HARNESS_DSH_DIR="$here/upstream/harness/kicad" CIRCUIT_PYTHON="${CIRCUIT_PYTHON:-$here/toolchain/python}" \
+ exec "$here/upstream/harness/kicad/toolchain/viewer.sh"