← All Pull Requests

Carry fabrication sources through the molecule pipeline #1

Merged opened by AdityaAngajala 2026-10-19

Update the routing contract and process docs so EDA molecule exports carry -fab.zip and export.json through publishing. Require verification before publishing and against the downloaded commit, and depend on molecule-publish 2.11.0. tscircuit keeps its existing circuit-input path.

Validation: package lint reports no errors. This does not enable registry serving or change any model selection.

Diff Skip to comments

--- a/docs/process.html+++ b/docs/process.html@@ -1,118 +1,121 @@⋯ 67 unchanged lines ⋯ Find the design first with <code>fusion_mcp_call {&quot;tool&quot;:&quot;fusion_mcp_read&quot;,&quot;arguments&quot;:{&quot;queryType&quot;:&quot;document&quot;,&quot;operation&quot;:&quot;search&quot;,&quot;name&quot;:&quot;...&quot;}}</code> (APS search needs a fresh sign-in; MCP search works with any open document).</li><li>Export sources: <code>fusion_export_eagle_source</code> for the <code>.brd</code>, switch with <code>fusion_electron_run {&quot;command&quot;:&quot;EDIT .s1&quot;}</code>, export the <code>.sch</code>, switch back with <code>EDIT .brd</code>.</li><li><code>fusion_show_3d_board</code>, then <code>fusion_export_step</code> (and <code>fusion_export_f3d</code> / <code>fusion_export_usdz</code> / silkscreen screenshots if you want the kitchen sink).</li><li><code>pull_file</code> the bundle: <code>.brd</code>, <code>.sch</code>, <code>.step</code> (+ extras).</li></ol> <h3>Altium (<code>altium-export-molecule</code>)</h3> <p>Native STEP export with the machine-pin models baked in, board metadata derived for OCCT, then the same converter call as everyone else. The skill ends when the OCCT artifacts are on the container; it never packages or publishes.</p>-<p>Gate for all three: the bundle on the container has <strong>STEP + board + schematic</strong> (a molecule without its schematic is not reproducible and <code>molecule-publish</code> refuses it).</p>+<p>Gate for all three: the bundle on the container has <strong>STEP + board + schematic + &lt;slug&gt;-fab.zip + export.json</strong> (a molecule without its schematic is not reproducible and <code>molecule-publish</code> refuses it).</p>+<p>Collect both sides of copper, mask and silk, outline and drill on every EDA export. The publisher checks the fabrication bundle before publishing and verifies the downloaded commit's source/member hashes.</p> <h2>Stage 2 — Convert: STEP → anchored GLB + footprint/symbol (<code>step2glb</code>)</h2> <p>One command, run on the container, does the whole OCCT molecule pipeline server-side:</p> <pre><code>step2glb convert ABC.step --board ABC.kicad_pcb --pin large -o &lt;slug&gt;.glb     # .brd boards work too</code></pre>⋯ 8 unchanged lines ⋯   ABC.kicad_pcb | .brd    board source   ABC.kicad_sch | .sch    schematic source   ABC.step                STEP (reproducibility)+  &lt;slug&gt;-fab.zip     Gerbers and drill+  export.json            exporter versions and source/member hashes   &lt;slug&gt;_footprint.json   OCCT artifact (wire-attach Z)   &lt;slug&gt;_symbol.json      OCCT artifact-  README.md, screenshots/hero.png, [silk PNGs, .f3d, .usdz, gerbers, bom, cpl]</code></pre>+  README.md, screenshots/hero.png, [silk PNGs, .f3d, .usdz, bom, cpl]</code></pre> <p>Rules that bite:</p> <ul><li><strong>Name the GLB <code>&lt;slug&gt;.glb</code>.</strong> The wiki auto-converts the STEP to a plain <code>&lt;slug&gt;.glb</code> at publish time and points <code>model_3d_path</code> at it; an anchored GLB with any other name is shadowed by the plain one and every import gets an unanchored model.</li><li>The <code>component</code> block is what creates the page&#x27;s component-metadata row; without it <code>model_3d_path</code> is never set and import fails with &quot;no published GLB&quot;.</li><li>Key the page by MPN, never by value. Do not ship a hand-made <code>page.json</code>.</li><li>Component dependencies are enforced before publish: <code>python3 scripts/component_graph.py plan &lt;board&gt; --out component-plan.json</code> then <code>gate package.json --plan component-plan.json --expect-board &lt;board&gt; --resolve</code> (declared coverage + every dependency resolves to a real page). Missing component pages: Stage 2.6 auto-creates them.</li><li>Stamp what you tested on: <code>python3 scripts/tested_with.py stamp package.json --family &lt;model&gt;</code>.</li><li>Hero camera: <code>python3 scripts/hero_camera.py pose &lt;slug&gt;.glb --page page.json</code>.</li></ul> <h2>Stage 4 — Publish + verify (<code>adom-wiki</code>)</h2>⋯ 27 unchanged lines ⋯--- a/docs/process.md+++ b/docs/process.md@@ -1,205 +1,210 @@⋯ 92 unchanged lines ⋯  Native STEP export with the machine-pin models baked in, board metadata derived for OCCT, then the same converter call as everyone else. The skill ends when the OCCT artifacts are on the container; it never packages or publishes. -Gate for all three: the bundle on the container has **STEP + board + schematic** (a molecule without its schematic is not reproducible and `molecule-publish` refuses it).+Gate for all three: the bundle on the container has **STEP + board + schematic + `<slug>-fab.zip` + `export.json`** (a molecule without its schematic is not reproducible and `molecule-publish` refuses it). +For each EDA, collect fabrication layers on every export and verify them with molecule-publish's `scripts/fab_bundle.py` before handing off. Preserve native board sources and mark imported backfills honestly.+ ## Stage 2 — Convert: STEP → anchored GLB + footprint/symbol (`step2glb`)  One command, run on the container, does the whole OCCT molecule pipeline server-side:⋯ 25 unchanged lines ⋯   ABC.kicad_pcb | .brd    board source   ABC.kicad_sch | .sch    schematic source   ABC.step                STEP (reproducibility)+  <slug>-fab.zip          Gerbers and drill+  export.json            exporter versions and source/member hashes   <slug>_footprint.json   OCCT artifact (wire-attach Z)   <slug>_symbol.json      OCCT artifact-  README.md, screenshots/hero.png, [silk PNGs, .f3d, .usdz, gerbers, bom, cpl]+  README.md, screenshots/hero.png, [silk PNGs, .f3d, .usdz, bom, cpl] ```  Rules that bite:⋯ 68 unchanged lines ⋯ - "Get molecule ABC into my Hydrogen account." → Stage 6. - "Publish my molecule ABC and import it into my Hydrogen account." → Stages 1–6, each gated before the next. - "Wire ABC to DEF in the 3D editor." → Stage 7.+--- a/package.json+++ b/package.json@@ -1,60 +1,61 @@ {   "slug": "molecule-pipeline",-  "version": "1.1.2",+  "version": "1.2.0",   "type": "skill",   "description": "Top-level router for moving molecules between EDA tools, the wiki, and Hydrogen: one entry point that routes publish/import intents to the right skill chain and enforces the pipeline invariants.",   "tags": [⋯ 4 unchanged lines ⋯     "skill"   ],   "dependencies": {-    "adom/molecule-publish": "^2.0.0",+    "adom/molecule-publish": "^2.11.0",     "adom/adom-molecule": "^1.1.3"   },   "scripts": {⋯ 40 unchanged lines ⋯     }   ] }+--- a/page.json+++ b/page.json@@ -1,69 +1,69 @@ {   "slug": "molecule-pipeline",-  "version": "1.1.2",+  "version": "1.2.0",   "type": "skill",   "description": "Top-level router for moving molecules between EDA tools, the wiki, and Hydrogen: one entry point that routes publish/import intents to the right skill chain and enforces the pipeline invariants.",   "tags": [⋯ 4 unchanged lines ⋯     "skill"   ],   "dependencies": {-    "adom/molecule-publish": "^2.0.0",+    "adom/molecule-publish": "^2.11.0",     "adom/adom-molecule": "^1.1.3"   },   "scripts": {⋯ 52 unchanged lines ⋯--- a/README.md+++ b/README.md@@ -1,101 +1,102 @@⋯ 85 unchanged lines ⋯  ## The invariants (why results are consistent) -1. The full published set (GLB + STEP + schematic + board + metadata) always reaches the wiki — you supply the sources, the tools generate and attach the rest.+1. The full published set (GLB + STEP + schematic + board + metadata, plus `<slug>-fab.zip` and `export.json` for EDA molecules) reaches the wiki. The publisher checks fabrication sources before publishing and verifies the downloaded commit's hashes. 2. The **only** GLB is the OCCT-converted one — never an EDA's native export. 3. STEP is exported on the design machine so custom 3D models survive. 4. Every stage verifies before the next starts; a failed gate stops the run.⋯ 6 unchanged lines ⋯ - [`adom-molecule`](https://wiki.adom.inc/adom/adom-molecule) — the CLI + import skill - [`adom-step2glb`](https://wiki.adom.inc/adom/adom-step2glb) — the OCCT conversion service/CLI - [`kicad-to-molecule`](https://wiki.adom.inc/adom/kicad-to-molecule) — make a plain PCB molecule-ready first+--- a/SKILL.md+++ b/SKILL.md@@ -1,74 +1,80 @@⋯ 23 unchanged lines ⋯ | "publish/export this molecule" + source is **KiCad** | `kicad-export-molecule` → hands off to `molecule-publish` | | ... source is **Fusion 360** | `fusion-export-molecule` → `molecule-publish` | | ... source is **Altium** | `altium-export-molecule` (direct-path redesign in progress — owner Barrett) |-| "I already have the files" (STEP + schematic + board) | straight to `molecule-publish` |+| "I already have the files" (STEP + schematic + board + fab zip + export record) | straight to `molecule-publish`; missing fabrication files return to the EDA exporter | | "get/import molecule X to Hydrogen" | `adom-molecule-import` | | "publish AND import" (full trip) | EDA skill → `molecule-publish` → `adom-molecule-import`, in order, verifying each stage before the next | | "publish my board" — a plain KiCad/EAGLE board, staying a board | `molecule-publish` BOARD MODE (plain convert, tag `board`, APM render + deps; no anchoring gates) |⋯ 5 unchanged lines ⋯ ## Invariants (hold across every route)  1. **The full published set reaches the wiki** — shape-conditional:-   molecules = OCCT GLB + STEP + schematic + board + footprint/symbol JSON;+   EDA molecules = OCCT GLB + STEP + schematic + board + footprint/symbol JSON+   + `<slug>-fab.zip` + `export.json`;    plain boards = GLB + STEP + every schematic sheet + board + project file    (no footprint/symbol — no machine pins). Both also carry APM's `render/`    assets + component `dependencies`. A page missing its shape's set is    incomplete.+   The EDA exporter captures fabrication data on every export; molecule-publish+   checks its source and member hashes before publishing and after fetching the+   pushed commit. tscircuit retains its circuit/build inputs instead: the pipeline+   writes its Gerbers. Existing pages receive a separately recorded backfill. 2. **The only GLB is OCCT's.** EDA-native GLB export (KiCad, Fusion,    service-kicad) is never used for molecules. 3. **STEP is exported on the design machine** so machine-pin/contact/marker⋯ 25 unchanged lines ⋯ - `adom-molecule-import` — wiki → Hydrogen (ships with adom/adom-molecule) - `kicad-to-molecule` — molecule-ize a plain PCB first - `adom-step2glb` — the conversion CLI/service underneath+

Comments

No comments yet.

Log in to comment.