Closed general

fab_bundle accepts string maskColor/silkColor; the registry build then crashes in normalize ('str' object has no attribute 'get')

noah · ·closed by AdityaAngajala

What happened

fab_bundle.py create --stackup took a stackup with plain-string colours, and fab_bundle.py check, bundle_check.py and the registry's own fabrication stage all passed it. The registry build then crashed in normalize with an error that names no input:

REGISTRY_CHECK_FAILED: job failed: JOB_CHECK_FAILED: program of registry.pipeline.molecule@1 failed checks: normalize: normalize ('str' object has no attribute 'get')

(adom/am32-esc-mol32 build 70371; every stage before normalize passed.)

Cause

board-look/normalize/surface.py pick_colors reads stackup.maskColor and stackup.silkColor as {top, bottom} objects ((stackup.get(kind + "Color") or {}).get(side)). This record had:

"stackup": {"thicknessMm": 1.6, "maskColor": "green", "silkColor": "white", "finish": "HASL lead-free", "copperOz": 2}

docs/fabrication.md does say "by top/bottom", but the --stackup help in fab_bundle.py says only "JSON with known thicknessMm, maskColor, silkColor, finish", which reads naturally as one string each. With {"top": "green", "bottom": "green"} / {"top": "white", "bottom": "white"} the same sources built (build 70372, all stages passed).

A second, quieter one: the finish "HASL lead-free" is not in board-look.json's aliases ("lead-free hasl" and "lf hasl" are), so it silently falls back to the spec default.

Asks

  1. fab_bundle.py create / check (and bundle_check.py): refuse a string maskColor/silkColor with the shape to use, e.g. stackup.maskColor must be {"top": "<colour>", "bottom": "<colour>"}. Warn when finish is not one of the normalize aliases.
  2. --stackup help: show the shape, e.g. {"thicknessMm":1.6,"copperLayers":2,"maskColor":{"top":"green","bottom":"green"},"silkColor":{"top":"white","bottom":"white"},"finish":"ENIG"}.
  3. Registry: a malformed stackup should be a named check failure in the fabrication stage, not a Python AttributeError in normalize.

Versions

molecule-publish 3.0.0, adom-wiki 1.8.11, molecule program molecule@10 (pin 97182bee), board-look normalize 0.9.1 spec 0.6; exporter adom-aiflow 0.2.55, KiCad 10.0.6. Hydrogen local workspace (WSL2).

3 Replies

AdityaAngajala ·

Fixed on the publisher's side in molecule-publish 3.1.0, published today. The registry side (ask 3) is written and waits on a deploy.

Ask 1: the local checks. fab_bundle 1.2.0 checks the stackup in create, check and bundle_check.py (problem export-stackup):

  • Refused, with the shape to write: a colour given as one string ("maskColor": "green"), a side other than top or bottom, a thickness or layer count that is not a positive number, a finish that is not text, a malformed #rrggbb, a key written both ways (maskColor and maskColour) or misspelled (maskcolor). For this record: export.json stackup.maskColor must be {"top": "<colour>", "bottom": "<colour>"}, for example {"top": "green", "bottom": "green"}; it is "green". create refuses before it writes anything.
  • Warned, not refused: a name the board look has no colour for, and a key no build reads. Names match exactly, in any case. A near miss names the closest one, for example 'HASL lead free' is not a finish name the board look knows, so a build draws HASL there. Did you mean "hasl lead-free"?, followed by the names it knows. copperOz from this record gets "not read by any build".
  • Quiet: an empty value, "None" (what KiCad writes when nobody chose a finish) and "Not specified".
  • "HASL lead-free" is now one of the names, next to KiCad's HAL lead-free and HT_OSP. KiCad's Immersion nickel and User defined are real finishes the board look has no colour for: the warning says so and suggests nothing.

Ask 2. --stackup help shows the shape, and docs/fabrication.md lists the rules and every name.

Ask 3, the registry. molecule/11 vendors the same fab_bundle 1.2.0, so its fabrication stage refuses this record as a named fab-bundle failure, before normalize. If such a record ever reaches normalize, it now fails with a message naming the shape rather than a Python AttributeError. A name the board look has no colour for makes the build warn stackup-values, with the value, what it drew instead and the closest known name. It is on git-wiki branch molecule-11, not deployed yet. Until it is, a build of a record that skips the local checks still fails in normalize. I'll close this once molecule/11 is the active version.

AdityaAngajala ·

Update: the registry side (ask 3, molecule/11) is up for review as https://github.com/adom-inc/git-wiki/pull/333, tracked on the wiki as adom/wiki#274. This stays open until molecule/11 is deployed and made the active version. Until then, molecule-publish 3.1.0's local checks catch the stackup before the push.

AdityaAngajala ·

molecule/11 is the active molecule program on wiki.adom.inc as of today, 2026-11-18 (https://github.com/adom-inc/git-wiki/pull/333, tracked in adom/wiki#274). That covers ask 3:

  • A stackup colour given as one string is refused by the build's fab-bundle check, with the shape to write, before normalize.
  • A finish or colour name the board look has no colour for makes the build warn stackup-values, with the value, what was drawn instead and the closest known name.
  • The build refuses only a stackup it cannot draw. The other shape problems fab_bundle 1.2.0 refuses on the publisher's machine are a stackup-shape warning on the build, since molecule/10 built those records.

Asks 1 and 2 shipped in molecule-publish 3.1.0. Closing.

AdityaAngajala closed this ·

Log in to reply.