skill
molecule-pipeline
Public Made by Adomby adom
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.
← Commit history
Merge PR #262: Carry fabrication sources through the molecule pipeline
6 files changed
+24−12
README.md+1−1@@ -86,7 +86,7 @@ sources. No partial molecules, no ambiguity about what "published" means. ## 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.
SKILL.md+7−2@@ -24,7 +24,7 @@ picks the chain and the downstream skills fill in the constraint knowledge | "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) |@@ -36,11 +36,16 @@ Detect the source EDA by asking or by the files at hand: `.kicad_pcb`/`.kicad_sc ## 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
docs/process.html+5−2@@ -68,7 +68,8 @@ Read the output: every <code>Could not add 3D model for MPn</code> line means a Find the design first with <code>fusion_mcp_call {"tool":"fusion_mcp_read","arguments":{"queryType":"document","operation":"search","name":"..."}}</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 {"command":"EDIT .s1"}</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 + <slug>-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 <slug>.glb # .brd boards work too</code></pre>@@ -83,9 +84,11 @@ Find the design first with <code>fusion_mcp_call {"tool":"fusion_ 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]</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><slug>.glb</code>.</strong> The wiki auto-converts the STEP to a plain <code><slug>.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's component-metadata row; without it <code>model_3d_path</code> is never set and import fails with "no published GLB".</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 <board> --out component-plan.json</code> then <code>gate package.json --plan component-plan.json --expect-board <board> --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 <model></code>.</li><li>Hero camera: <code>python3 scripts/hero_camera.py pose <slug>.glb --page page.json</code>.</li></ul> <h2>Stage 4 — Publish + verify (<code>adom-wiki</code>)</h2>
docs/process.md+6−2@@ -93,7 +93,9 @@ Never use KiCad's own GLB export for a molecule: it bypasses anchoring, gold pin 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`) @@ -126,9 +128,11 @@ The GLB carries `asset.extras.adomMolecule` — durable provenance you can check 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:
package.json+3−3@@ -1,6 +1,6 @@ { "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": [@@ -11,7 +11,7 @@ "skill" ], "dependencies": {- "adom/molecule-publish": "^2.0.0",+ "adom/molecule-publish": "^2.11.0", "adom/adom-molecule": "^1.1.3" }, "scripts": {@@ -57,4 +57,4 @@ "prompt": "Publish my molecule ABC and import it into my Hydrogen account" } ]-}+}
page.json+2−2@@ -1,6 +1,6 @@ { "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": [@@ -11,7 +11,7 @@ "skill" ], "dependencies": {- "adom/molecule-publish": "^2.0.0",+ "adom/molecule-publish": "^2.11.0", "adom/adom-molecule": "^1.1.3" }, "scripts": {