muse/book-reading-clip-lamp

A Wi‑Fi/USB‑C ESP32‑S3 reading lamp with OV5640 camera, microphone, speaker amplifier, rechargeable Li‑Po power management, six-LED boost light, USB protection/charging detection, and a clip/gooseneck enclosure with external FlexPIFA antenna.

Version
0.4.3
License
unset
Stars
0

work-schematic-m11/findings.txt

SCHEMATIC SHEET BOUNDARIES / TOOLCHAIN UPDATE — 12 October 2026

Root cause
The old layout put its heading at max(component schY)+7.3 and footer at
min(component schY)-3. Neither position was tied to the physical page border.
ANSI B is 431.8 x 279.4 mm, roughly 46.75 x 30.25 schematic units. Automatic
page centering does not enlarge that page to contain its children.

Why the tools missed the text
The official schematic placement/style analyzer 0.0.56 had no sheet-boundary
rule; 0.0.57 still has none. All 42 rules were enabled, but successful style
analysis did not prove text containment. Core 0.0.2112's
insertSchematicElementOutsideSheetWarnings and upgraded core 0.0.2132's
warnIfSchematicElementsOutsideSheet check schematic_component,
schematic_net_label and schematic_trace only. They omit schematic_text.
Core's automatic centering also estimates text with fixed 0.2 height and
0.1-per-character width, without honoring font size or anchor. The prior
validation relied on the style pass and did not add a text-boundary check.
The old Light-sheet trace overflow was a core warning, not an analyzer issue.

Correction
All ten sheets now specify fixed ANSI B dimensions. Functional content is
translated to a measured center within the drawing area. Title, three notes
and footer use reserved page bands; the PCB coordinates and netlist stay fixed.
Updated symbol widths and moved USB ESD / CC pull-up schematic symbols for
the latest analyzer's label spacing and rail path rules.

Prevention
check-schematic-style.mjs still resolves the latest official bundle online
and enables every rule. It now also runs schematic-sheet-bounds.mjs, which
checks text, symbols, labels, wires, ports and simple graphic bounds against
the 5 mm inner border. Text bounds account for font size, anchor, rotation
and multiple lines using core's approximate character-width metric. This is
a geometric guard plus visual review, not pixel-perfect font metrology.
The report explicitly separates styleIssueCount and boundaryIssueCount.
Any issue returns failure. No DRC or style rule was disabled.

The fixture in tests/fixtures/schematic-text-overflow.json contains the actual
old USBPower page and annotations. The regression catches both title and
footer overflow. Three other tests cover inset text, all four edges, full text
extent versus anchor, font size, rotation, multiline text and shifted pages.
Run bun run test:schematic-bounds or bun run check:schematic.

Upstream UI scope
The dev-server Run Style Analysis button still uses the upstream analyzer.
The new containment guard belongs to this project's check:schematic command;
this change does not patch or publish the upstream analyzer package.

Verification
Latest tscircuit 0.0.2839; core 0.0.2132; CLI 0.1.2303; runframe 0.0.2966.
Latest analyzer 0.0.57: 42 rules, ten sheets, zero style and boundary issues.
Full build, TypeScript, netlist, schematic placement, all-layer Gerber shorts,
routing guard and existing circuit audits pass. PCB placement has zero errors
and the existing J2 orientation advisory. The upgraded checker adds five
45-degree routing-style advisories on unchanged copper. No fabrication hold
was cleared by this schematic-only change. Copper and electrical connectivity
match the M10 baseline; exact evidence is validation-summary.json.
The dev server at localhost:3020 was restarted with the upgraded dependency.
USBPower title and footer were visually checked inside the border.