vlabs

Reference

Constraints & rules

The renderer is permissive by design — invalid references return null and are silently skipped rather than throwing. But circuits that violate these rules will look wrong or incomplete. Treat them as hard requirements.


Component ids

  • Every id in components[] must be unique.
  • Every id referenced in show[] or highlight must exist in components[].
  • Wire from/to that reference non-existent ids produce no wire (silent skip).

show[] — cumulative invariant

  • Each step's show[] must be a superset of the previous step's show[].
  • Never remove an id between steps.
  • The final step's show[] must include every component id.
  • First step's show[] must be ['bb'].

IC placement

  • All gates use row: 'e'.
  • Each IC occupies exactly 7 consecutive columns.
  • Minimum 2-column gap between adjacent ICs.
  • Do not place any component past column 30 on the standard breadboard, or past column 63 on the long-breadboard.

Resistor + LED pairing

  • Every LED must have a current-limiting resistor in series (330Ω typical).
  • Resistor at col N → resistor p2 at col N+3 → LED anode at col N+2 (not N+4). The LED is placed 2 cols after the resistor start.
  • LED cathode must always connect to a ground rail.
The resistor → LED column arithmetic

Resistor at col 22 → p1 at col 22, p2 at col 25. LED at col 24 → anode at col 24, cathode at col 25. Wire: resistor p2 (col 25) → LED anode (col 24). They share the same node because they're in the same column on the same row.

Wires

  • Every wire must have a valid from and to — both must resolve to a position.
  • Wires with unresolvable endpoints are silently dropped (no crash, but missing connections).
  • Each ground return wire should use a unique col on the rail to avoid overlap.

truthTable

  • If present, inputs and outputs arrays must be non-empty.
  • Every row.inputs key must be in the inputs array.
  • Every row.outputs key must be in the outputs array.
  • activeInputs keys in steps must match truthTable.inputs keys exactly.

Validating before committing

There's no automated validator yet. Manual checklist:

  1. All ids in show[] exist in components[]
  2. Column ranges of components on the same row don't overlap
  3. Every IC is on row 'e' with 7-col spacing
  4. Every LED has a resistor and a ground wire
  5. show[] only grows — never shrinks
  6. Last step's show[] contains all component ids
  7. activeInputs keys match truthTable.inputs
Let AI validate for you

Paste the generated circuit into Claude and ask it to check against this constraints list. It will catch column collisions, missing ground wires, and non-cumulative show arrays.