diff --git a/.gitattributes b/.gitattributes index 88d3773..1c44f69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,6 +18,8 @@ docs/evaluation/** -text whitespace=cr-at-eol examples/gpio-indicator/** -text examples/** -text whitespace=cr-at-eol docs/demos/** -text whitespace=cr-at-eol +# The recorded bring-up demos bind this test file's exact source bytes. +tests/examples/test_bringup.py text eol=lf # These captured Rover inputs are already LF in Git. Keep their checkout bytes # stable on Windows without rewriting existing CAD or archived source content. projects/rover-pdb/buck-motor.kicad_sch text eol=lf diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index fb4b06f..048ada4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -36,7 +36,7 @@ jobs: tests/test_package_smoke.py tests/test_toolchain.py tests/test_doctor.py tests/test_cli_encoding.py tests/test_demo.py tests/test_demo_change.py tests/test_project.py tests/test_evaluate.py tests/test_media_evidence.py tests/test_media_publication.py tests/test_check_readme.py - tests/test_check_examples.py + tests/test_check_examples.py tests/test_example_explorer.py tests/examples tests/test_state.py tests/test_status_cli.py tests/test_update_guard.py tests/test_transaction.py tests/test_cleanup.py tests/test_release.py tests/test_stock.py tests/test_sch_io_multiline.py @@ -55,6 +55,8 @@ jobs: run: uv run --locked python tools/evaluate.py - name: Example sources, exact-part coverage and recorded native artifacts run: uv run --locked python tools/check_examples.py + - name: Native views, pins, evidence and identities in the offline explorer + run: uv run --locked python tools/build_example_explorer.py --verify - name: Verify all four offline handovers against saved sources run: | uv run --locked pcb-copilot verify-report docs/demos/gpio-review --project examples/gpio-indicator diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..4cc6ba6 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,55 @@ +name: Publish example explorer + +on: + workflow_run: + workflows: [Software and package checks] + types: [completed] + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: example-explorer-pages + cancel-in-progress: false + +jobs: + deploy: + if: >- + (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || + (github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_repository.full_name == github.repository) + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.event.workflow_run.head_sha || github.sha }} + persist-credentials: false + - name: Require the current main revision + shell: bash + run: | + test "$(git rev-parse HEAD)" = "$(git ls-remote https://github.com/${{ github.repository }}.git refs/heads/main | cut -f1)" + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: '3.11' + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + - name: Verify the exact retained site against saved example sources + run: | + uv sync --locked + uv run --locked python tools/build_example_explorer.py --verify + - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 + - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4 + with: + path: docs/demos/example-explorer + - name: Publish the verified standalone explorer + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/README.md b/README.md index 0a472c7..ba5ea2b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Software and package checks](https://github.com/devkyber/PCB/actions/workflows/checks.yml/badge.svg)](https://github.com/devkyber/PCB/actions/workflows/checks.yml) -![Three native KiCad examples: USB-C power entry, an I2C temperature sensor and an RS-485 interface](docs/media/examples-gallery.png) +[![Three native KiCad examples: USB-C power entry, an I2C temperature sensor and an RS-485 interface](docs/media/examples-gallery.png)](https://devkyber.github.io/PCB/) Prepare scoped changes, check the candidate, inspect the native views, and apply it explicitly. Keep manufacturer evidence and engineering decisions with the @@ -13,18 +13,18 @@ design through to a gated manufacturing package. **[Get started](docs/QUICKSTART.md)** · **[Explore the examples](examples/README.md)** · **[Make an offline handover](docs/HANDOVER.md)** · **[Read the workflow](docs/WORKFLOW.md)** -## Three new boards, with their working exposed +## Follow a signal through three native boards [![A twelve-second walkthrough of the three new boards and their actual native schematics](docs/media/examples-gallery.gif)](docs/media/examples-gallery.mp4) *Recorded native CAD renders and schematic captures of unbuilt prototypes. -The USB-C example retains eight connector manufacturing findings and has no -PPTC body model. [Source and artifact hashes](docs/media/examples-manifest.json) +All three report zero native ERC/DRC violations and zero unconnected items. +The USB-C PPTC body is not modeled. [Source and artifact hashes](docs/media/examples-manifest.json) bind this gallery to the exact saved designs.* | Example | Circuit and files | Current engineering boundary | | --- | --- | --- | -| [USB-C power entry](examples/usb-c-power/README.md) | Independent CC resistors, PPTC, transient shunt and indicator. [Schematic](examples/usb-c-power/output/schematic.pdf) · [3D model](examples/usb-c-power/output/usb-c-power.glb) | Routed; ERC and pin-net parity pass. Eight connector annular-ring/NPTH-clearance findings block manufacturing review. No PD or current-advertisement detection. | +| [USB-C power entry](examples/usb-c-power/README.md) | Six-contact USB4125 power-only connector, independent CC resistors, PPTC and transient shunt. [Schematic](examples/usb-c-power/output/schematic.pdf) · [3D model](examples/usb-c-power/output/usb-c-power.glb) | Native ERC/DRC and parity pass. Manufacturer lands meet the unchanged geometry baseline. Physical fit, protection behavior, assembly and human decisions remain open; no PD or current sensing. | | [I²C temperature sensor](examples/i2c-sensor/README.md) | MCP9808 MSOP, eight selectable addresses and ALERT. [Schematic](examples/i2c-sensor/output/schematic.pdf) · [3D model](examples/i2c-sensor/output/i2c-sensor.glb) | Native ERC/DRC and parity pass. Bus behavior, physical fit, supplier assembly and human decisions remain open. | | [RS-485 interface](examples/rs485-interface/README.md) | THVD1450, explicit control defaults and removable termination. [Schematic](examples/rs485-interface/output/schematic.pdf) · [3D model](examples/rs485-interface/output/rs485-interface.glb) | Native ERC/DRC and parity pass. Short bench-link prototype; isolation, surge/EMC and hardware behavior are unqualified. | @@ -33,6 +33,26 @@ archives, routed copper, native review views and a source-bound artifact inventory. All remain **unbuilt DRAFTs**. The smaller [GPIO indicator](examples/gpio-indicator/README.md) remains the first-run example. +The **[browser workbench](https://devkyber.github.io/PCB/)** needs no KiCad or +hardware connection. Search by reference or MPN, choose a numbered pin and +highlight its actual saved net. Inspect native copper, schematic and 3D views +beside the matching source evidence. The simplified net map omits pours and +exact pad shapes; the native copper views retain complete geometry. +[Download it for offline use or rebuild it](docs/EXPLORER.md). + +Try the source-backed bring-up tools without hardware: + +```sh +python examples/i2c-sensor/bringup.py demo +python examples/rs485-interface/bringup.py demo +``` + +The [sensor guide](examples/i2c-sensor/BRINGUP.md) covers identity, signed +big-endian temperature decoding, address shunts and ALERT configuration. The +[RS-485 guide](examples/rs485-interface/BRINGUP.md) covers termination load/power +bounds and explicit driver timing around the last UART stop bit. These are +checked calculations and transaction recipes, not recorded bench results. + ## Get a first result Use Git, **Python 3.11+** and @@ -167,6 +187,7 @@ remain separate from the educational examples. Frozen boards under | --- | --- | | [Quickstart](docs/QUICKSTART.md) | Setup and first useful result | | [Example catalog](examples/README.md) | Circuits, assumptions and native artifacts | +| [Interactive explorer](docs/EXPLORER.md) | Follow native pads/nets, inspect views and source evidence | | [Handover](docs/HANDOVER.md) | Generate and verify offline review packets | | [Workflow](docs/WORKFLOW.md) | Preview, apply, review and release | | [Architecture](docs/ARCHITECTURE.md) | Ownership and implementation boundaries | diff --git a/docs/EXPLORER.md b/docs/EXPLORER.md new file mode 100644 index 0000000..7d24a33 --- /dev/null +++ b/docs/EXPLORER.md @@ -0,0 +1,64 @@ +# Follow a signal through the examples + +The [interactive explorer](https://devkyber.github.io/PCB/) combines the three +native KiCad examples in one browser workbench. It uses saved PCB pad and track +coordinates, actual schematic/3D/copper captures and archived manufacturer +evidence. It works without KiCad or a hardware connection. + +Choose a board and search for a reference, part number, pin or net. Selecting a +component opens its exact MPN, native numbered pads and source documents. +Select a pin's net to highlight its contacts and routed segments. For example, +the sensor's SDA network connects J1 pin 4, R1 pin 2 and U1 pin 1. The pin labels +and net memberships come from saved CAD, checked against the project netmap. + +The connectivity map simplifies pad shapes and omits filled zones and arcs. +Dashed routes are on the bottom copper layer; the map remains oriented from the +top. Use the native top/bottom copper images for full geometry. The bottom image +is mirrored as viewed from the underside. Neither surface replaces editable +CAD or a mechanical drawing. Download the embedded vector schematic for +readable circuit-scale inspection. + +All boards remain unbuilt DRAFTs. The displayed ERC/DRC counts are retained +native reports; opening or verifying the explorer does not rerun them. Board +behavior, physical fit, supplier assembly and current human release decisions +remain open. The [complete handovers](HANDOVER.md) retain the full review. + +## Run the saved explorer offline + +Download [index.html](demos/example-explorer/index.html) using GitHub's raw-file +download control, then open the saved HTML in a browser. Images, vector PDFs, +scripts and circuit data are embedded; the workbench makes no network requests. +Clicking a manufacturer or review link opens the explicitly selected source. + +For a local checkout, serve the same saved bundle with standard Python: + +```sh +python -m http.server 8765 --bind 127.0.0.1 --directory docs/demos/example-explorer +``` + +Open `http://127.0.0.1:8765/`. No dependency installation is needed to view it. + +## Rebuild and verify + +```sh +uv run python tools/build_example_explorer.py --verify +# Requires KiCad Python and current example capture/review packets: +uv run python tools/build_example_explorer.py +``` + +The builder reads an isolated copy of the declared inputs with KiCad Python. It +reconciles every numbered electrical pad against the netmap, checks current +artifact/handovers, and embeds the captured native views with the complete input +ledger. It rechecks sources around transactional publication. Native extraction, verification or source +failures preserve the previous complete bundle. + +Verification needs no KiCad. It checks the retained HTML hash, required source +artifact inventory, all embedded image/PDF bytes, component identities, evidence +metadata and URLs, native finding counts, pin-net maps and current input ledgers. +It rejects stale sources, linked paths and packet files replaced during the +check. Hashes establish recorded identities, not capture authenticity or the +quality of the engineering review. + +GitHub Pages publishes only this verified standalone bundle after successful +main-branch software/package checks. Its [workflow](../.github/workflows/pages.yml) +uses GitHub's [custom Pages deployment actions](https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages). diff --git a/docs/QUICKSTART.md b/docs/QUICKSTART.md index 918b509..e77c170 100644 --- a/docs/QUICKSTART.md +++ b/docs/QUICKSTART.md @@ -1,5 +1,10 @@ # Quickstart +To inspect the examples before installing tools, open the +[interactive browser workbench](https://devkyber.github.io/PCB/). Search native +parts and pins, trace saved nets, and inspect the schematic/copper/3D views beside +their source evidence. It also works as a [downloaded offline file](EXPLORER.md). + Start with the small four-channel GPIO indicator, then try a checked schematic change in a disposable copy. The example is an unbuilt educational `DRAFT`; the demo records no owner approval or fabrication release. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 847be0d..95523f7 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -47,9 +47,11 @@ Implemented next examples: [USB-C power](../examples/usb-c-power/README.md), [I²C temperature](../examples/i2c-sensor/README.md) and [RS-485](../examples/rs485-interface/README.md) each retain native CAD, exact part evidence, routed copper, full-page visual review and hashed native outputs. -The USB-C footprint exposes eight unresolved manufacturing-geometry findings; -the other two have clean native ERC/DRC and parity. These are still unbuilt -prototypes with open supplier assembly and human decisions. +USB-C revision B resolves the original connector conflict with an official +six-contact power-only footprint, retaining manufacturer lands and the existing +geometry rules. All three have clean native ERC/DRC and parity. The sensor and +RS-485 guides include tested, source-backed offline bring-up tools. These remain +unbuilt prototypes with open supplier assembly, physical and human decisions. Done when the procedure reproduces offline from the archived inputs and the remaining engineering results have measured evidence. Owner boards and frozen @@ -81,6 +83,11 @@ and board view together with scoped findings and the captured source ledger. The verifier checks packet bytes, embedded native images/review consistency, and optional current-project identity without requiring KiCad. +The [interactive example explorer](EXPLORER.md) also exposes current native +pad/net membership, selected-part identities, evidence and board views in one +standalone browser workbench. Its verifier rejects substituted embedded media, +misstated component facts and stale source ledgers. + Use the existing CLI and native-candidate workflow as the integration boundary. Document one complete agent-assisted task: read requirements and source evidence, prepare a scoped candidate, inspect the check results and rendered diff --git a/docs/demos/example-explorer/index.html b/docs/demos/example-explorer/index.html new file mode 100644 index 0000000..e1b8f19 --- /dev/null +++ b/docs/demos/example-explorer/index.html @@ -0,0 +1,47 @@ + + + +PCB Copilot / Follow a signal +
+
PCB Copilot / Example workbench

Follow a signal.

+

Real KiCad boards. Pick a component, trace its saved nets, inspect the native views, and open its manufacturer evidence.

+

Unbuilt prototypes. Native checks and byte verification have a limited scope. Physical fit, circuit behavior, assembly and human release decisions remain open.

+ +
+

USB-C power entry

Independent CC resistors / fused 5 V bench power

+
+
+
+

Check the engineering boundary

    Download native vector schematic
    Read the complete recorded review
    +

    Bound to saved sources

    Native PCB SHA-256

    Inspect the complete input ledger
    +

    +
    \ No newline at end of file diff --git a/docs/demos/example-explorer/manifest.json b/docs/demos/example-explorer/manifest.json new file mode 100644 index 0000000..6246636 --- /dev/null +++ b/docs/demos/example-explorer/manifest.json @@ -0,0 +1,251 @@ +{ + "schema_version": 1, + "generated_utc": "2026-10-29T03:16:19.016060+00:00", + "source_cad_unchanged": true, + "source_projects": { + "usb-c-power": { + "DESIGN_BASIS.md": "709244824ef6c042f717dab863e3feb48c9ef4caa635414b0ee3143abbad6017", + "DEVIATIONS.md": "b1d4d35c82e7aa276876cefde9f932cbcc55650bcbac73db7e61875b006c33ad", + "evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_07970b0ad324.brd": "07970b0ad3243684bdf59c0ced537b8b9a8e8b67f7e9032b9464600da21b04e0", + "evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_ec14aee06c7a.sch": "ec14aee06c7a24546fcc6f6b1687ae85a13cadff955a721f458b125b70954330", + "evidence/files/Adafruit-4090_license.txt_075dad5e5fc9.txt": "075dad5e5fc96c27014fabc269f4f5732909cffd178a486f546d982b6cf86b74", + "evidence/files/Adafruit-4090_LICENSE_6d594832648b.txt": "6d594832648bfe9a8b0aa69ee21ce2c72f696170fcd3c21b82c3284174cd2c19", + "evidence/files/Adafruit-4090_README.md_6c97cdad4847.txt": "6c97cdad48475dcc3e5f9afc503fc9f8f0c39b69408462fcb088ef3159336193", + "evidence/files/MF-MSMF075-2_mf-msmf_50d802285818.pdf": "50d80228581842471d563e28ba0f1b67ab095ee95dfac4079f4a49f7f7bbf3c8", + "evidence/files/MFR-25FBF52-5K1_YAGEO-MFR_DATASHEET_b460acdb4764.pdf": "b460acdb476469774e0785a8ef85aec79e2d95fe41beaa79c5a414e4e95e3fe0", + "evidence/files/SMAJ6.0A_doc_b8617e715805.pdf": "b8617e715805bb3293892c4636279eac57c1ef18e8c87a481cec1b802731b72d", + "evidence/files/TSW-102-07-G-S_tsw_th_3a5770b11668.pdf": "3a5770b11668f4e5a11ba9ceeb4817a23f467b8507e3592f55fb6bd8f96e71bc", + "evidence/files/USB-TYPE-C-R2.0_USB_Type-C_Spec_R2.0_-_August_2019_87d15160bf8b.pdf": "87d15160bf8bd25129b27e0b7c5e261ed0b1806b3b0d3a7b5d8b1eb783dc9981", + "evidence/files/USB4105-GF-A_usb4105_fb331fbabee8.pdf": "fb331fbabee8392ed2937ed757c1610cb0f174b84625147c0b580a18eea8c0e5", + "evidence/files/USB4125-GF-A_usb4125-spec_adeaf1f264b8.pdf": "adeaf1f264b8999c4b40bfd7fd202543201a60246297be6906a83e08a59259a2", + "evidence/files/USB4125-GF-A_usb4125_ea33e0b40545.pdf": "ea33e0b40545e545bf698cbac3bb1c0f5a3fc7ca6b5b7fda83a63134d4affaa7", + "evidence/files/WP710A10ID_WP710A10ID_42d464fbfd8d.pdf": "42d464fbfd8d3ddef65fa6f9226d298547cdb25d5369aff0c47e5f896595c4bd", + "evidence/index.yaml": "dba12b5af45b4a4cc18821299f0b5e14f60d1bf0314671f71939194eb52aaa05", + "fp-lib-table": "0b5e3b96ab837b2cb0dee92b3db61d730754821e2cf68de09e00417e95a60868", + "jlcpcb-assembly.yaml": null, + "layout-intent.yaml": null, + "libs/BournsDerived.pretty/MF-MSMF075_1812_Style1.kicad_mod": "35fed6e5564b59b01de515711bb82fabb9bdb28b855e1717ae993c54026e8463", + "libs/footprint-provenance.yaml": "e284bd4a48de67abafd5fd584de4ec59799aa9204aa3358c829ac92841936d01", + "libs/LICENSE-kicad-footprints.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-packages3D.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-symbols.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE_PROVENANCE.json": "8fb14cbd87bbb53c2e381fa614336026b1ef1a6b69d252e40b5de8dafa7f9c66", + "libs/models/D_SMA.step": "1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db", + "libs/models/LED_D3.0mm.step": "e83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371", + "libs/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step": "85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe", + "libs/models/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.step": "090b9119a6ff678f028cbd5aa52c28373fae6a76823c5b8bf7fcd1a8db2f99d5", + "libs/PROVENANCE.json": "919fe15cd363cee1fc7d4cada17cf6e6e93604d33ef86cb59952d145ae162eff", + "libs/README.md": "196f740df9eeb9dee5e7aab79828851ee315a1d0e5aed0a90d78bd9ffbae7df1", + "libs/upstream/D_SMA.kicad_mod": "e2d049a54ef961e231eb8e7e769078a3c44feb8475a7bdafba01c6646a5144f3", + "libs/upstream/LED_D3.0mm.kicad_mod": "d45c606dbf639522eaeae8c6bd2569747ee454daff87ab2db66bdad3200676d0", + "libs/upstream/models/D_SMA.step": "1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db", + "libs/upstream/models/LED_D3.0mm.step": "e83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371", + "libs/upstream/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/upstream/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step": "85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe", + "libs/upstream/models/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.step": "090b9119a6ff678f028cbd5aa52c28373fae6a76823c5b8bf7fcd1a8db2f99d5", + "libs/upstream/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/upstream/PinHeader_1x02_P2.54mm_Vertical.kicad_mod": "e5c0d699660a4479fa2414cc5be1835c6f52a38630dd85a2d18aab4dcd3ff8e5", + "libs/upstream/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_mod": "1ba096b69c79e588cc54946fb6648699e5b301f67f8df0e0e0be43dcab326436", + "libs/upstream/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.kicad_mod": "5f11b280b9c01298165a9682d54837ba8062c0b6ac8872a3b7276734c2cf0eef", + "libs/USBC.kicad_sym": "2ece02129902825ee5ce643fcd8b5a3e142c5b19b95b9b52963dc9916dc41e2d", + "libs/USBC.pretty/D_SMA.kicad_mod": "bc5361e7a259264ed4ad5b0da3ade2134d250c081f0e8ce53d6fcee0fac9b5c1", + "libs/USBC.pretty/LED_D3.0mm.kicad_mod": "9928bcc8ef35ea406d56af1480e43c606d8d646ba247b3d453d80386cd0f5b10", + "libs/USBC.pretty/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/USBC.pretty/PinHeader_1x02_P2.54mm_Vertical.kicad_mod": "237cf8088cdcca6025a9cfc493511c000fa3cdb04c4382a0115b3f90dccb26b9", + "libs/USBC.pretty/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_mod": "bf616ce7d49ae02d5c87d01dd19957ebf3aa66007809680c450de8561f4681a1", + "libs/USBC.pretty/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.kicad_mod": "301333008dbdb106a09e28f86ad5c9d637b8201a6c275f1ff06eb19b53e733ba", + "netmap.json": "9cf452fe7054949e8b1a75fb705df228bbea60c664988e4806b5922a5036fb8c", + "project.yaml": "2efd5dbe91af637030e3dded07a367f7e4d142a40c995edb9eaead9e5d4ad0cc", + "REFERENCE_REVIEW.md": "c7d6e78f0cf5a0217f2e7465646e7c09018795cfa2a99b52eda812bda464e811", + "REQUIREMENTS.md": "1f58078ae480b4cf95abf1354003324b1a7d45e8d76fc1fa6c6581b04171aab4", + "review-profile.yaml": "830d0b62c775aaad9b35d5a3b3a0e1f2d1bede2831f4137177db092cff55476b", + "review-signoff.yaml": null, + "schematic-intent.yaml": null, + "sym-lib-table": "74d3dc37a2f3d607d33f69b362ed7fb0cde7adb393ad09e96c28da14e583c168", + "usb-c-power.kicad_dru": "fd6ec6cfd46f091c61ee7fa09ab3e1c5e29cb9b187e5045bcf055666f0239643", + "usb-c-power.kicad_pcb": "1413eddd499e8ea862f11bcb7aba1e57d0d0a8afd60b20927eb8ab7c30750042", + "usb-c-power.kicad_pro": "0b8ea2009c63a097259838c9eec11d04970f1a6cdb8e2370b8de118c4113e5fd", + "usb-c-power.kicad_sch": "5fdd93eb0e2a4b63cecae367a2a9ead2ddc4c76833e77760aa0564d349fe76b3" + }, + "i2c-sensor": { + "DESIGN_BASIS.md": "3d72746933ffb91877ac6d75a00df2ea71629a32a3e24d2a5b0c9a1f248eb68a", + "DEVIATIONS.md": "1747b6d9e69271fca2bad172c9da034189f7100db8b13e28668e7a1d7ff77045", + "evidence/files/c100n-c52d31e37c30.pdf": "c52d31e37c30868b2fb69e091d30a2d668848aa41a1bf99777fc1e036804c8d6", + "evidence/files/header2-a054dde42f94.pdf": "a054dde42f94b42e1f34117df97a37071aa9e57febcb8375058a3fb7dbae6dbe", + "evidence/files/header4-ce759fb8caee.pdf": "ce759fb8caee2fd0c3167f6925010f6703aa4f939ded51aae7ead334c38c0d7d", + "evidence/files/mcp9808-e7b6502f744c.pdf": "e7b6502f744c3e605a424d7b784a23baa471a41f8bc6d51f6321027b0c43972f", + "evidence/files/r10k-ba822223e72d.pdf": "ba822223e72ddc4b9f7466f4abbf031df91028e60975b18f0f6b2c7f4bb61981", + "evidence/files/r4k7-67601f653ef3.pdf": "67601f653ef38f5ef3df0c9108c811fdda84df41575c928da51c467ad94f9d56", + "evidence/files/reference-2504a86440fa.pdf": "2504a86440fa3a71036ca2ad3d84306f4fba5d255acba7c2c68f72e976418be9", + "evidence/index.yaml": "133f71490075231ce220656fde2e9f7da58b838c4a9bec1e4a91932da4a2f82a", + "fp-lib-table": "837d63cb825b70abc0b1c8e1380a9daa09ccdc2a6d9d74b66b82829b7e0b145d", + "i2c-sensor.kicad_dru": "fd6ec6cfd46f091c61ee7fa09ab3e1c5e29cb9b187e5045bcf055666f0239643", + "i2c-sensor.kicad_pcb": "fbed39097a557e25b114a9c3879b5c3ef3939cbfbb1339062074e7dbecbcc567", + "i2c-sensor.kicad_pro": "3cff9742f95c0a188c4d9a526356432d4f86e44d0b7067198551b93f86814b00", + "i2c-sensor.kicad_sch": "f9aee65fbd7d97c9a47abe5e21fdb97910441530096a44a5d31d96984620b3db", + "jlcpcb-assembly.yaml": null, + "layout-intent.yaml": null, + "libs/LICENSE-kicad-footprints.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-packages3D.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-symbols.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE_PROVENANCE.json": "8fb14cbd87bbb53c2e381fa614336026b1ef1a6b69d252e40b5de8dafa7f9c66", + "libs/models/C_0805_2012Metric.step": "9a669c1a2f1ea25b88b401acef6efeaa80a067bd7da9db6993de719a7fbe155c", + "libs/models/MSOP-8_3x3mm_P0.65mm.step": "847c4c5023fe1603fbd36900a5dcc4bd3901ba473f71d42c9a469f0236eaadf3", + "libs/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/models/PinHeader_1x04_P2.54mm_Vertical.step": "a74079b8d06bda78847623b39ee1855ffd1d9a8c1e896b349e4f1dc2056d44d9", + "libs/models/R_0805_2012Metric.step": "ded342cdb394fb45395227beaaa75cc390613cf2581b29cd6d22c12abd6103b2", + "libs/PROVENANCE.json": "c37540b07afdc25530747c1f7bc6181e3eabb57ef0d21aa03251a835804f6c86", + "libs/Sensor.kicad_sym": "7fe457448354c1ec611190c3f9983e76af1863aa5cf241e9a56b47d86f39ea0a", + "libs/Sensor.pretty/C0805_100N.kicad_mod": "8a25bb3b8a5a3bfbcc8516026f52a0d81a738e99ec4fbc8fab13d411aa268d23", + "libs/Sensor.pretty/Header2_61300211121.kicad_mod": "237cf8088cdcca6025a9cfc493511c000fa3cdb04c4382a0115b3f90dccb26b9", + "libs/Sensor.pretty/Header4_61300411121.kicad_mod": "6ad921854896ca97d3881eea8f5c2513ffe4f8916fb80ee474de940f85ff079c", + "libs/Sensor.pretty/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/Sensor.pretty/MSOP8_MCP9808.kicad_mod": "f30d62613dc360bc82051ba098d3de4cfa674cb4407c5a555825e8c613be168e", + "libs/Sensor.pretty/R0805_10K.kicad_mod": "ec8e0afc145afbb836137c146b5bd65c99c1b4d9183e1e6295841c640746fe18", + "libs/Sensor.pretty/R0805_4K7.kicad_mod": "ec8e0afc145afbb836137c146b5bd65c99c1b4d9183e1e6295841c640746fe18", + "libs/SYMBOL_PROVENANCE.json": "139cf61a89036017616ab5a9cdaf1226c1259d1069e5ea651152c0eed9713bd8", + "libs/upstream/C_0805_2012Metric.kicad_mod": "e890bdf55fa18fc6df6878eb1b5251a991e1b93985509175eb269d3d002880b4", + "libs/upstream/Connector.kicad_sym": "1596718c70ff14cc217a9297dcb48bad23bdffcca0881600e9e66be16953bf59", + "libs/upstream/Device.kicad_sym": "e03831d421787531315439a4af4229e5d5d88ee51c7f36ba3f658ddf2978cda9", + "libs/upstream/Mechanical.kicad_sym": "7046e0cfb6bfc84cf614760762ff72547d6b2d9e2d0d94bb3f16b8f6bc18aade", + "libs/upstream/models/C_0805_2012Metric.step": "9a669c1a2f1ea25b88b401acef6efeaa80a067bd7da9db6993de719a7fbe155c", + "libs/upstream/models/MSOP-8_3x3mm_P0.65mm.step": "847c4c5023fe1603fbd36900a5dcc4bd3901ba473f71d42c9a469f0236eaadf3", + "libs/upstream/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/upstream/models/PinHeader_1x04_P2.54mm_Vertical.step": "a74079b8d06bda78847623b39ee1855ffd1d9a8c1e896b349e4f1dc2056d44d9", + "libs/upstream/models/R_0805_2012Metric.step": "ded342cdb394fb45395227beaaa75cc390613cf2581b29cd6d22c12abd6103b2", + "libs/upstream/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/upstream/MSOP-8_3x3mm_P0.65mm.kicad_mod": "528a13b478896636a0e8f3a1b7e48371377728d226cd180ec3ddc20d81e66d41", + "libs/upstream/PinHeader_1x02_P2.54mm_Vertical.kicad_mod": "e5c0d699660a4479fa2414cc5be1835c6f52a38630dd85a2d18aab4dcd3ff8e5", + "libs/upstream/PinHeader_1x04_P2.54mm_Vertical.kicad_mod": "8952158347d7b7cc13924c62dccb0c48911af892bb009a0de27cb4d3c25cc1bb", + "libs/upstream/R_0805_2012Metric.kicad_mod": "949bbbe025b509557866ddd9fcb0403244571f3ceb4f954c9766ee622d18421c", + "libs/upstream/Sensor_Temperature.kicad_sym": "46f1cbd260f4494f0022664b68ba748bd33cd63f8ae2badc5849091214012d99", + "netmap.json": "cacf58e9bb450816bd5437744d748149602bd2aaee7d82fbbf36d5f67fa89966", + "project.yaml": "8dfde8597a8b71fb9e4e6bf0a7f1adbfcb06ad26dda3d10cc0278128829c41c6", + "REFERENCE_REVIEW.md": "7f89d71bb22392a1e19cc80d2c851263bf7b85e94dc04eb3c284a672cd79118f", + "REQUIREMENTS.md": "b34c075790bbef0dc96f8403d7e9b5cb9c00759d229fb4962746c29f3bde28c9", + "review-profile.yaml": "dd235c08990cb454a77d9609b0b89659fad21cb2682938aadebe829903cbae5d", + "review-signoff.yaml": null, + "schematic-intent.yaml": null, + "sym-lib-table": "2e04eff4c485d546ee36c8683dcf9dc66d31219b68eae543c86b171277803157" + }, + "rs485-interface": { + "DESIGN_BASIS.md": "6d762bdfe883d9201a9beaccbe10a914b2684a17a62033d1e66682dfa627c112", + "DEVIATIONS.md": "de83ce0240c141c9f874b138c047f308cd314142cba4003341be4d49a840d0a7", + "evidence/files/CC0805KKX7R7BB105_CC0805KKX7R7BB105_41dec9fe44ff.pdf": "41dec9fe44ff5b7d4445fced2a851f40debd1e232fb9f1e07bf2ec3dfaf7e77a", + "evidence/files/CC0805KRX7R9BB104_CC0805KRX7R9BB104_91302bfe493a.pdf": "91302bfe493ab4f89071266b6fc1d01974391345b4047fe16655c39f9f39ae37", + "evidence/files/CRCW080510K0FKEA_dcrcwe3_3e595b731fa5.pdf": "3e595b731fa5916bcdce5b28cd76b5eb0b0b3cdd7da474c677173264748cdf5f", + "evidence/files/SNT-100-BK-G_snt_74433addf30d.pdf": "74433addf30d918ec852f41236aaa23a8de0fa647a638237e51dd64236590595", + "evidence/files/THVD1450DR_SLLU173_2081c71247a9.pdf": "2081c71247a960a0f4b8225459bc6b234cab979d0bac480bb6e884202d9f5488", + "evidence/files/THVD1450DR_thvd1450_58ecc4cc07dd.pdf": "58ecc4cc07dd1d3206c2e67ffa734ad21a6d3a9e3c8c307068e6385bd79ee897", + "evidence/files/TSW-106-07-G-S_tsw_th_3a5770b11668.pdf": "3a5770b11668f4e5a11ba9ceeb4817a23f467b8507e3592f55fb6bd8f96e71bc", + "evidence/index.yaml": "00a6ba98f025dd75da62c5c9e1017af049adff92b82caa24d6769c312216d706", + "fp-lib-table": "0188b35deac5698ca2c871e4a7a2d242c9c716d5de9fd69b456d2515c0e9bb1a", + "jlcpcb-assembly.yaml": null, + "layout-intent.yaml": null, + "libs/LICENSE-kicad-footprints.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-packages3D.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE-kicad-symbols.md": "285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef", + "libs/LICENSE_PROVENANCE.json": "8fb14cbd87bbb53c2e381fa614336026b1ef1a6b69d252e40b5de8dafa7f9c66", + "libs/models/C_0805_2012Metric.step": "9a669c1a2f1ea25b88b401acef6efeaa80a067bd7da9db6993de719a7fbe155c", + "libs/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/models/PinHeader_1x03_P2.54mm_Vertical.step": "b91b4ac5acf1a0d28a676703db972d17b8f11ef26a85b58d60786a69246b921b", + "libs/models/PinHeader_1x06_P2.54mm_Vertical.step": "d6113af109a14a67c50dcefd1cfc7b43b59b59afa85d808b2319e2452da91318", + "libs/models/R_0805_2012Metric.step": "ded342cdb394fb45395227beaaa75cc390613cf2581b29cd6d22c12abd6103b2", + "libs/models/R_1206_3216Metric.step": "f5d1ea5c47935091292bd1c6c698e0df88d3d4bbf92bf66b4c97e49df5be9ebc", + "libs/models/SOIC-8_3.9x4.9mm_P1.27mm.step": "07f46cff378d30e6c27dfd5a03092c795323f86d91c71fc7e743f4f418dc553a", + "libs/PROVENANCE.json": "dd632e879d8415b7975b3c97a818c4731f1a7c24c665e26c2d0d501e85e43b8d", + "libs/README.md": "ddbd026bca630240dacbe5aef9d3d5fed0638658528e05cb3ff187e52776b701", + "libs/RS485.kicad_sym": "0d2faff987cb313f3dab786219f84b56313a69cc4e021afc3bcac524437973b2", + "libs/RS485.pretty/BUS_HTSW103.kicad_mod": "23b30471426dcaf8052b827ec7fd42ace5ea230f2d2a1b910bc3ff922e2f0dfd", + "libs/RS485.pretty/C0805_100nF.kicad_mod": "8a25bb3b8a5a3bfbcc8516026f52a0d81a738e99ec4fbc8fab13d411aa268d23", + "libs/RS485.pretty/C0805_1uF.kicad_mod": "8a25bb3b8a5a3bfbcc8516026f52a0d81a738e99ec4fbc8fab13d411aa268d23", + "libs/RS485.pretty/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/RS485.pretty/R0805_10k.kicad_mod": "ec8e0afc145afbb836137c146b5bd65c99c1b4d9183e1e6295841c640746fe18", + "libs/RS485.pretty/R1206_120R.kicad_mod": "7a89b33d587d4003b993ebfa847f7f7a39dd0d27d384a21c925042bf40ebf129", + "libs/RS485.pretty/SOIC8_THVD1450DR.kicad_mod": "7e1a63659a9cbe0b088ad490611c5a8276d5f9626d6e5cb7d62e5642e51d017c", + "libs/RS485.pretty/TERM_HTSW102.kicad_mod": "237cf8088cdcca6025a9cfc493511c000fa3cdb04c4382a0115b3f90dccb26b9", + "libs/RS485.pretty/UART_HTSW106.kicad_mod": "89499e28bb17204bf22048112d5cc086753b07197389c7266bbb61f14afd4f27", + "libs/upstream/C_0805_2012Metric.kicad_mod": "e890bdf55fa18fc6df6878eb1b5251a991e1b93985509175eb269d3d002880b4", + "libs/upstream/models/C_0805_2012Metric.step": "9a669c1a2f1ea25b88b401acef6efeaa80a067bd7da9db6993de719a7fbe155c", + "libs/upstream/models/PinHeader_1x02_P2.54mm_Vertical.step": "ea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41", + "libs/upstream/models/PinHeader_1x03_P2.54mm_Vertical.step": "b91b4ac5acf1a0d28a676703db972d17b8f11ef26a85b58d60786a69246b921b", + "libs/upstream/models/PinHeader_1x06_P2.54mm_Vertical.step": "d6113af109a14a67c50dcefd1cfc7b43b59b59afa85d808b2319e2452da91318", + "libs/upstream/models/R_0805_2012Metric.step": "ded342cdb394fb45395227beaaa75cc390613cf2581b29cd6d22c12abd6103b2", + "libs/upstream/models/R_1206_3216Metric.step": "f5d1ea5c47935091292bd1c6c698e0df88d3d4bbf92bf66b4c97e49df5be9ebc", + "libs/upstream/models/SOIC-8_3.9x4.9mm_P1.27mm.step": "07f46cff378d30e6c27dfd5a03092c795323f86d91c71fc7e743f4f418dc553a", + "libs/upstream/MountingHole_3.2mm_M3.kicad_mod": "3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b", + "libs/upstream/PinHeader_1x02_P2.54mm_Vertical.kicad_mod": "e5c0d699660a4479fa2414cc5be1835c6f52a38630dd85a2d18aab4dcd3ff8e5", + "libs/upstream/PinHeader_1x03_P2.54mm_Vertical.kicad_mod": "6a7dba97d6e733fd9d5f12d2d57f2cde29e8393e15b08d8b3e41bf2b430d83ed", + "libs/upstream/PinHeader_1x06_P2.54mm_Vertical.kicad_mod": "e3c3501f520fc1fc39eeb5d72137e680e509c0df2348ca77fef1b9db6ab974f0", + "libs/upstream/R_0805_2012Metric.kicad_mod": "949bbbe025b509557866ddd9fcb0403244571f3ceb4f954c9766ee622d18421c", + "libs/upstream/R_1206_3216Metric.kicad_mod": "f45a0f7c60b15463e1126a75a9ff484349ecd1861de62f1cbff41574e03b7643", + "libs/upstream/SOIC-8_3.9x4.9mm_P1.27mm.kicad_mod": "3c9b63198dd4dbf5e6c28c84702c29fad46a35103b821a19306c4ac888ad8e76", + "libs/upstream/symbols/Connector.kicad_sym": "1596718c70ff14cc217a9297dcb48bad23bdffcca0881600e9e66be16953bf59", + "libs/upstream/symbols/Connector_Generic.kicad_sym": "1ae3b346fe1c4e874fecb72abc7df4e94a253780db183439dbfefc4e2ff3a0be", + "libs/upstream/symbols/Device.kicad_sym": "e03831d421787531315439a4af4229e5d5d88ee51c7f36ba3f658ddf2978cda9", + "libs/upstream/symbols/Interface_UART.kicad_sym": "fb576f5f5f2592ed0fb3a8a7828a86273226a7a33d656fddbf62a494480ed57b", + "libs/upstream/symbols/Jumper.kicad_sym": "11e54f09b36f0cad5556b280a8b6cfd356fe01ca959d2cb64f017c06a16a5090", + "libs/upstream/symbols/Mechanical.kicad_sym": "7046e0cfb6bfc84cf614760762ff72547d6b2d9e2d0d94bb3f16b8f6bc18aade", + "netmap.json": "4690d5598b20b8ba2f2a7f263ea28c3a91148c0f0db2d759d617e3d0aa1d45ec", + "project.yaml": "2b07edbf83a39730fab46e9e7c6ee6f884a86b4b38b2e432d73d128ec9d1e56b", + "REFERENCE_REVIEW.md": "69fb8d2bf9946eeb231a44e6faac23b4e4aa2fc4ae4f6d788c2436806ec59dee", + "REQUIREMENTS.md": "989d177d55110ad8ee051de2e267e786b170c0adb5954327c737fcf354c8a7e8", + "review-profile.yaml": "91ff5ea422b00e352e3c0a332c3ef5b9407324e558a3a3b7d98eccb55e9e0305", + "review-signoff.yaml": null, + "rs485-interface.kicad_dru": "fd6ec6cfd46f091c61ee7fa09ab3e1c5e29cb9b187e5045bcf055666f0239643", + "rs485-interface.kicad_pcb": "b3acbb4d10d75123af839ffc7425bd275bf98dfadd77b154a3957ccbe8545e9a", + "rs485-interface.kicad_pro": "bf3396c14d810072fe2751e6c36b20fe90b93d688452a99cf61c6e0eff021b15", + "rs485-interface.kicad_sch": "636691f6c4392eda59336ff4a4376f41239df3e57dc97f3a0ca86818c679e569", + "schematic-intent.yaml": null, + "sym-lib-table": "116178969ef63db6b574689c35e92144375ad58fb5caf6444af620ccfab85ef0" + } + }, + "source_artifacts": { + "examples/usb-c-power/output/board-3d.png": "5482fef3b9a3bf4b82f069d52698190849c80deb7284a99e0cc9ce5459b10a0c", + "docs/demos/usb-c-review/schematic-001.png": "1e5a12d01b9a540fd10bf4317c3e3b662b8ac09b794f5a5b72b2f76abb7dc090", + "docs/demos/usb-c-review/top-copper.png": "83acc7b8020bec604b938c941c3d046a333322c65602c55a39d8d5b4e9f53376", + "docs/demos/usb-c-review/bottom-copper.png": "026c80cdd71b318afddc2bc652017428595fe1de92e05287a9e4cfb12b35674c", + "docs/demos/usb-c-review/schematic.pdf": "d635b8bfc8682fadd230e460ca622d1786b493b774abad5d8ea24f9e2f5b87af", + "docs/demos/usb-c-review/manifest.json": "dae8b17c49523e2d465a02d59b1691b4b17f3a5c0c56979ab3c9e8ae3563f041", + "docs/demos/usb-c-review/source.json": "42500258b3837c4cc21d674bedde3d44785e17981a0e6750d4656c3b1884fc8e", + "docs/demos/usb-c-review/review.json": "dc5ca5b749f2345c07031357dde7ca29468f39e28127b69bb2b374bb02dc1691", + "examples/usb-c-power/output/SOURCE.json": "1016ad00a39f14ae64d8f00701500d3ce099fb8c7edef8f0e21cf28834daf381", + "examples/usb-c-power/output/erc.json": "1e8d3a614cb6fef1d9c9af18bc6013f1115bf76e4b942996ae87a8532cfff321", + "examples/usb-c-power/output/drc.json": "dcff277cdae7b2220522972fabc0b42a686e483b2f6a44031f57ca674186c5ca", + "examples/i2c-sensor/output/board-3d.png": "b8e2c9fcad2639286ddb55d4231a01fa2808fb6307d698c9a252afab0fee7e3e", + "docs/demos/i2c-review/schematic-001.png": "c8d5e88046cf63f3882104ab5f029fdd708d3db5b1b58155825d6ca0c3a14b18", + "docs/demos/i2c-review/top-copper.png": "84ec7e8ca8e64ff9f40aa0d0151eddd91aa7f31e48903df294dbc8e27539cfc4", + "docs/demos/i2c-review/bottom-copper.png": "db95a0e13e1c932840fec04457328e0c94e5f9940f40e46f9161ad35ecf44b3e", + "docs/demos/i2c-review/schematic.pdf": "c649525f93b96585189e6dd07f6325e56cba40b706b5d97301dcc2cf724dba2d", + "docs/demos/i2c-review/manifest.json": "15244393e1cb7df54f420caef3e3464fcbf20b36a4d7154c463fb11298bca2bf", + "docs/demos/i2c-review/source.json": "69412bdb0d7e834a70b53f2b270c875c0941c1e0de035f855d1d80bd0f66df96", + "docs/demos/i2c-review/review.json": "087a5cf6b8d3b337df7fc80bf46b0b4c104b007c646b4f0b6e4e93fe17fea7b3", + "examples/i2c-sensor/output/SOURCE.json": "32c3326fffcb6a430f6a2d2251a8ed93fac9e69cfffe175077b90bb03797e0a9", + "examples/i2c-sensor/output/erc.json": "4d2647e10c38e2ebfb610311b9147cfeca19f6f458740ffd9f58389b7eecf84e", + "examples/i2c-sensor/output/drc.json": "598091a63c02a9fad711b99e4667ac6730c862dd64856416148bcec29b14decd", + "examples/rs485-interface/output/board-3d.png": "93c705c99f5c4c915aaea8c7d68922525ca156160a8a8de4f187837bd13b4f44", + "docs/demos/rs485-review/schematic-001.png": "9db9b964a8e699d6a55c4010869556af50550bd9b5dea5282779fa777d424806", + "docs/demos/rs485-review/top-copper.png": "4c18028cff9e657242d240b0d7f9dac52d4524418abacf5b1924ca23d085dd32", + "docs/demos/rs485-review/bottom-copper.png": "94024e0ca0dbdd61ffec9cc775373da3b7a765a5c69e584f0df46455ac0e0a93", + "docs/demos/rs485-review/schematic.pdf": "275f7eda29bdd9dd04a3291171a51b6dd6b426a514c4618ee5674718dee8ff64", + "docs/demos/rs485-review/manifest.json": "5968de1b988f4f311978e145bc2be82bb99c4f71326815dfbf1615544a002731", + "docs/demos/rs485-review/source.json": "100f7893d8705d6cdea7ccfca4a161767675d6bbc79b0ec6f7c1146897c808e3", + "docs/demos/rs485-review/review.json": "1ff2aad9fddd5570ea5677e19ac4db294beec859e578063c9d940ce3c87d2abd", + "examples/rs485-interface/output/SOURCE.json": "132bce579a4a0538ef9ce48dc487336df48d976010777074fa4e6e7ef5390dfb", + "examples/rs485-interface/output/erc.json": "ec155980ebf05e493520f7b9d16aa2c579fb252211660001ea3ccc2e690e7d8a", + "examples/rs485-interface/output/drc.json": "c4a11af1139b76efb2d71455b733b98212033b311fc827051399a9fade38f44c" + }, + "generators": { + "build_example_explorer.py": "4c5c56b6e85e07c7e8e1636f64b10de628efd6590130715e5ff5b4c40f58f134", + "explorer_native.py": "b43c535723fab801f756f6cad4fb52b067ff0d095c982119567277b5fdd60143", + "example_explorer_html.py": "863b173add231ec05fb32a14dd3793af00e13f6c00e3bebbb4e82147aef33d70" + }, + "outputs": { + "index.html": { + "sha256": "359ffd0bf10b78d03703094943bac26ed718a7b6f8acf6ad9d563330a74f6b71", + "bytes": 5030930 + } + }, + "scope": "Offline recorded native views and connectivity map; no hardware communication or fabrication approval." +} diff --git a/docs/demos/usb-c-review/assembly.png b/docs/demos/usb-c-review/assembly.png index 85d642d..311ecee 100644 Binary files a/docs/demos/usb-c-review/assembly.png and b/docs/demos/usb-c-review/assembly.png differ diff --git a/docs/demos/usb-c-review/bottom-copper.png b/docs/demos/usb-c-review/bottom-copper.png index bc1be98..1bfbded 100644 Binary files a/docs/demos/usb-c-review/bottom-copper.png and b/docs/demos/usb-c-review/bottom-copper.png differ diff --git a/docs/demos/usb-c-review/index.html b/docs/demos/usb-c-review/index.html index 944913e..25b19ff 100644 --- a/docs/demos/usb-c-review/index.html +++ b/docs/demos/usb-c-review/index.html @@ -138,15 +138,15 @@

    PCB Copilot / Review handover

    usb-c-power

    -

    Captured 2026-10-29T00:22:54.424189+00:00
    KiCad 10.0.6. Source inputs preserved during export.

    -
    Blocked

    10 passed, 4 failed; 4 blocking findings.

    +

    Captured 2026-10-29T03:11:06.611529+00:00
    KiCad 10.0.6. Source inputs preserved during export.

    +
    Blocked

    12 passed, 2 failed; 2 blocking findings.

    This is an offline snapshot. Machine findings and human decisions remain separate. This report records no approval.

    -

    Inspect the saved design

    Every included sheet and board view is shown. Select a view to jump to it; enlarge for circuit detail. Download vector schematic PDF

    +

    Inspect the saved design

    Every included sheet and board view is shown. Select a view to jump to it; enlarge for circuit detail. Download vector schematic PDF

    -
    Schematic / page 1 of 1
    Schematic / page 1 of 1Native KiCad PDF page
    Assembly
    AssemblyViewed from top
    Top copper
    Top copperViewed from top
    Bottom copper
    Bottom copperUnderside; mirrored relative to top
    -
    -

    research

    Passed

    Machine check | 38 ms

    requirements, cited basis and archived evidence verified

    Check scope and limits
    Establishes

    requirements, cited basis and source integrity

    Does not establish

    engineering validity of those choices

    No external tool required. Deterministic check.

    datasheets

    Passed

    Machine check | 55 ms

    required datasheet bytes verified; 10 physical schematic parts inspected (shared passive exemptions apply)

    Check scope and limits
    Establishes

    required datasheets are archived and verified

    Does not establish

    interpretation of electrical limits

    No external tool required. Deterministic check.

    erc

    Passed

    Machine check | 2874 ms

    0 violation(s), 0 unspecified-pin warnings waived

    Check scope and limits
    Establishes

    fresh KiCad electrical-rule findings

    Does not establish

    circuit fitness or safe operation

    External tool required. Deterministic check.

    schematic_ownership

    Passed

    Machine check | 705 ms

    netmap matches the current schematic

    Check scope and limits
    Establishes

    netmap matches the current schematic

    Does not establish

    circuit correctness

    External tool required. Deterministic check.

    netlist_parity

    Passed

    Machine check | 992 ms

    exact schematic/PCB pin-net parity and schematic links

    Check scope and limits
    Establishes

    exact schematic/PCB pin-net agreement and forward-annotation links

    Does not establish

    which circuit is correct

    External tool required. Deterministic check.

    placement

    Passed

    Machine check | 27 ms

    implemented placement checks pass

    Check scope and limits
    Establishes

    implemented placement geometry checks

    Does not establish

    assembly or enclosure fit

    No external tool required. Deterministic check.

    design_rules

    Passed

    Machine check | 642 ms

    === docs/DESIGN_RULES.md geometric checks: C:\Users\tae06\AppData\Local\Temp\pcb-copilot-review-8bxoggv2\usb-c-power\usb-c-power.kicad_pcb === +

    research

    Passed

    Machine check | 29 ms

    requirements, cited basis and archived evidence verified

    Check scope and limits
    Establishes

    requirements, cited basis and source integrity

    Does not establish

    engineering validity of those choices

    No external tool required. Deterministic check.

    datasheets

    Passed

    Machine check | 46 ms

    required datasheet bytes verified; 10 physical schematic parts inspected (shared passive exemptions apply)

    Check scope and limits
    Establishes

    required datasheets are archived and verified

    Does not establish

    interpretation of electrical limits

    No external tool required. Deterministic check.

    erc

    Passed

    Machine check | 1975 ms

    0 violation(s), 0 unspecified-pin warnings waived

    Check scope and limits
    Establishes

    fresh KiCad electrical-rule findings

    Does not establish

    circuit fitness or safe operation

    External tool required. Deterministic check.

    schematic_ownership

    Passed

    Machine check | 765 ms

    netmap matches the current schematic

    Check scope and limits
    Establishes

    netmap matches the current schematic

    Does not establish

    circuit correctness

    External tool required. Deterministic check.

    netlist_parity

    Passed

    Machine check | 1059 ms

    exact schematic/PCB pin-net parity and schematic links

    Check scope and limits
    Establishes

    exact schematic/PCB pin-net agreement and forward-annotation links

    Does not establish

    which circuit is correct

    External tool required. Deterministic check.

    placement

    Passed

    Machine check | 43 ms

    implemented placement checks pass

    Check scope and limits
    Establishes

    implemented placement geometry checks

    Does not establish

    assembly or enclosure fit

    No external tool required. Deterministic check.

    design_rules

    Passed

    Machine check | 720 ms

    === docs/DESIGN_RULES.md geometric checks: C:\Users\tae06\AppData\Local\Temp\pcb-copilot-review-32qvjnp8\usb-c-power\usb-c-power.kicad_pcb === RESULT: 0 violation(s), 0 check(s) passed -SCOPE: geometric rules 1.2, 2.2, 5.1, 6.1 only (4 of 42 numbered subsections in docs/DESIGN_RULES.md). The remainder are not machine-checkable from the board file and are covered by the Phase 5 human review.

    Check scope and limits
    Establishes

    geometric rules 1.2, 2.2, 5.1 and 6.1

    Does not establish

    all house rules or source applicability

    External tool required. Deterministic check.

    drc

    Failed

    Machine check | 8707 ms

    8 error(s), 0 warning(s), 0 unconnected; two refilled runs

    Check scope and limits
    Establishes

    two fresh zone-refilled DRC runs and routing completeness

    Does not establish

    RF, thermal or functional behavior

    External tool required. Result may vary between native runs.

    jlcpcb_dfm

    Failed

    Machine check | 3721 ms

    jlcpcb-2layer-1oz-green-2026-10-05: 8 error(s), 0 unconnected. Annular width (rule 'JLCPCB recommended component annular ring' min annular width 0.2500 mm; actual 0.2000 mm); Annular width (rule 'JLCPCB recommended component annular ring' min annular width 0.2500 mm; actual 0.2000 mm); Annular width (rule 'JLCPCB recommended component annular ring' min annular width 0.2500 mm; actual 0.2000 mm); Annular width (rule 'JLCPCB recommended component annular ring' min annular width 0.2500 mm; actual 0.2000 mm); Hole clearance violation (board setup constraints hole clearance 0.2500 mm; actual 0.1944 mm); Hole clearance violation (board setup constraints hole clearance 0.2500 mm; actual 0.1944 mm); Hole clearance violation (board setup constraints hole clearance 0.2500 mm; actual 0.1944 mm); Hole clearance violation (board setup constraints hole clearance 0.2500 mm; actual 0.1944 mm)

    Check scope and limits
    Establishes

    independent dated JLCPCB geometry and declared stackup checks

    Does not establish

    assembly eligibility, current capacity or supplier order acceptance

    External tool required. Deterministic check.

    assembly_contracts

    Failed

    Machine check | 35 ms

    D1: missing exact-part rotation rule +SCOPE: geometric rules 1.2, 2.2, 5.1, 6.1 only (4 of 42 numbered subsections in docs/DESIGN_RULES.md). The remainder are not machine-checkable from the board file and are covered by the Phase 5 human review.

    Check scope and limits
    Establishes

    geometric rules 1.2, 2.2, 5.1 and 6.1

    Does not establish

    all house rules or source applicability

    External tool required. Deterministic check.

    drc

    Passed

    Machine check | 3905 ms

    0 error(s), 0 warning(s), 0 unconnected; two refilled runs

    Check scope and limits
    Establishes

    two fresh zone-refilled DRC runs and routing completeness

    Does not establish

    RF, thermal or functional behavior

    External tool required. Result may vary between native runs.

    jlcpcb_dfm

    Passed

    Machine check | 1999 ms

    jlcpcb-2layer-1oz-green-2026-10-05: 0 error(s), 0 unconnected.

    Check scope and limits
    Establishes

    independent dated JLCPCB geometry and declared stackup checks

    Does not establish

    assembly eligibility, current capacity or supplier order acceptance

    External tool required. Deterministic check.

    assembly_contracts

    Failed

    Machine check | 37 ms

    D1: missing exact-part rotation rule D2: missing exact-part rotation rule F1: missing exact-part rotation rule J1: missing exact-part rotation rule @@ -171,17 +171,17 @@ R1: missing exact-part rotation rule R2: missing exact-part rotation rule R3: missing exact-part rotation rule -F1: missing enabled local 3D model

    Check scope and limits
    Establishes

    exact-part rotation rules, local model files and wire-pad label/net association

    Does not establish

    supplier preview approval, mechanical fit or model shape correctness

    No external tool required. Deterministic check.

    routing_settings

    Passed

    Machine check | 13 ms

    Native routing: 23 segments, 0 arcs, 7 vias; 0 locked item(s). Default width: 0.25 mm; 7 positive width preset(s).

    Check scope and limits
    Establishes

    stored native routing widths/locks and project routing-setting coverage

    Does not establish

    ampacity, thermal margin, branch currents, effective custom rules or router UI selection

    No external tool required. Deterministic check.

    routing_topology

    Passed

    Machine check | 632 ms

    Inspected 23 straight tracks: no findings. Excluded 0 arcs and 0 custom/offset pads. Native DRC remains the connectivity gate; copper was not changed.

    Check scope and limits
    Establishes

    covered straight tracks, short segments and off-centre native pad contacts

    Does not establish

    electrical connectivity, ampacity, via/zone/arc topology or whether an off-centre entry is intentional

    External tool required. Deterministic check.

    schematic_quality

    Passed

    Machine check | 12 ms

    1 sheet(s) checked

    Check scope and limits
    Establishes

    all referenced sheets have title/revision and acceptable density

    Does not establish

    visual readability, electrical correctness, or page-flow quality

    No external tool required. Deterministic check.

    signoff

    Failed

    Human decision | 65 ms

    0/6 current decisions: usb-source-budget unsigned; connector-manufacturing unsigned; protection-coordination unsigned; physical-assembly unsigned; shared.schematic-readability unsigned; shared.layout-handover unsigned

    Check scope and limits
    Establishes

    named, dated, project-specific decisions match the exact current design and review profile

    Does not establish

    the reviewer inspected correctly, measured hardware, or made a safe decision

    No external tool required. Deterministic check.

    -
    Source hashes and evidence paths (61 declared inputs) +F1: missing enabled local 3D model

    Check scope and limits
    Establishes

    exact-part rotation rules, local model files and wire-pad label/net association

    Does not establish

    supplier preview approval, mechanical fit or model shape correctness

    No external tool required. Deterministic check.

    routing_settings

    Passed

    Machine check | 12 ms

    Native routing: 28 segments, 0 arcs, 7 vias; 0 locked item(s). Default width: 0.25 mm; 7 positive width preset(s).

    Check scope and limits
    Establishes

    stored native routing widths/locks and project routing-setting coverage

    Does not establish

    ampacity, thermal margin, branch currents, effective custom rules or router UI selection

    No external tool required. Deterministic check.

    routing_topology

    Passed

    Machine check | 604 ms

    Inspected 28 straight tracks: no findings. Excluded 0 arcs and 0 custom/offset pads. Native DRC remains the connectivity gate; copper was not changed.

    Check scope and limits
    Establishes

    covered straight tracks, short segments and off-centre native pad contacts

    Does not establish

    electrical connectivity, ampacity, via/zone/arc topology or whether an off-centre entry is intentional

    External tool required. Deterministic check.

    schematic_quality

    Passed

    Machine check | 11 ms

    1 sheet(s) checked

    Check scope and limits
    Establishes

    all referenced sheets have title/revision and acceptable density

    Does not establish

    visual readability, electrical correctness, or page-flow quality

    No external tool required. Deterministic check.

    signoff

    Failed

    Human decision | 68 ms

    0/6 current decisions: usb-source-budget unsigned; connector-manufacturing unsigned; protection-coordination unsigned; physical-assembly unsigned; shared.schematic-readability unsigned; shared.layout-handover unsigned

    Check scope and limits
    Establishes

    named, dated, project-specific decisions match the exact current design and review profile

    Does not establish

    the reviewer inspected correctly, measured hardware, or made a safe decision

    No external tool required. Deterministic check.

    +
    Source hashes and evidence paths (63 declared inputs)

    These hashes identify the captured files. They do not prove engineering suitability or that the live project still matches this snapshot.

    -

    Schematic hierarchy SHA-256ecb3cd1617043afc3d72c18c67a44ea6a47e700e9d6c2d071a095747494680bb

    PCB SHA-25671d6b1659f79148681ebec554cf21e4928dc3ae8abc23684e8cbfdac6b490317

    -
    Declared source pathSHA-256 / absence
    DESIGN_BASIS.md7c4f818335714cf49dd8668aba9c24dd2c7cb9b91303ab9588b20885cd3b7da1
    DEVIATIONS.mde0999af7527fecb67ed262406c20201ccb3ad60342f418fe71bc743835b760af
    REFERENCE_REVIEW.md80cb4796481c0b998329229fec6dbdc54a344bbdebbf20699c04a08fff905156
    REQUIREMENTS.md92e6700ff16390d8ee17bfa6e45f81b9dd6d62f18c60b28c8306f29d887ba202
    evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_07970b0ad324.brd07970b0ad3243684bdf59c0ced537b8b9a8e8b67f7e9032b9464600da21b04e0
    evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_ec14aee06c7a.schec14aee06c7a24546fcc6f6b1687ae85a13cadff955a721f458b125b70954330
    evidence/files/Adafruit-4090_LICENSE_6d594832648b.txt6d594832648bfe9a8b0aa69ee21ce2c72f696170fcd3c21b82c3284174cd2c19
    evidence/files/Adafruit-4090_README.md_6c97cdad4847.txt6c97cdad48475dcc3e5f9afc503fc9f8f0c39b69408462fcb088ef3159336193
    evidence/files/Adafruit-4090_license.txt_075dad5e5fc9.txt075dad5e5fc96c27014fabc269f4f5732909cffd178a486f546d982b6cf86b74
    evidence/files/MF-MSMF075-2_mf-msmf_50d802285818.pdf50d80228581842471d563e28ba0f1b67ab095ee95dfac4079f4a49f7f7bbf3c8
    evidence/files/MFR-25FBF52-5K1_YAGEO-MFR_DATASHEET_b460acdb4764.pdfb460acdb476469774e0785a8ef85aec79e2d95fe41beaa79c5a414e4e95e3fe0
    evidence/files/SMAJ6.0A_doc_b8617e715805.pdfb8617e715805bb3293892c4636279eac57c1ef18e8c87a481cec1b802731b72d
    evidence/files/TSW-102-07-G-S_tsw_th_3a5770b11668.pdf3a5770b11668f4e5a11ba9ceeb4817a23f467b8507e3592f55fb6bd8f96e71bc
    evidence/files/USB-TYPE-C-R2.0_USB_Type-C_Spec_R2.0_-_August_2019_87d15160bf8b.pdf87d15160bf8bd25129b27e0b7c5e261ed0b1806b3b0d3a7b5d8b1eb783dc9981
    evidence/files/USB4105-GF-A_usb4105_fb331fbabee8.pdffb331fbabee8392ed2937ed757c1610cb0f174b84625147c0b580a18eea8c0e5
    evidence/files/WP710A10ID_WP710A10ID_42d464fbfd8d.pdf42d464fbfd8d3ddef65fa6f9226d298547cdb25d5369aff0c47e5f896595c4bd
    evidence/index.yaml7eef57780de9e59eb889b994d6d70db8b2f9c40c22eba06944e25b79408e6e07
    fp-lib-table0b5e3b96ab837b2cb0dee92b3db61d730754821e2cf68de09e00417e95a60868
    jlcpcb-assembly.yamlNot present in this snapshot
    layout-intent.yamlNot present in this snapshot
    libs/BournsDerived.pretty/MF-MSMF075_1812_Style1.kicad_mod35fed6e5564b59b01de515711bb82fabb9bdb28b855e1717ae993c54026e8463
    libs/LICENSE-kicad-footprints.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE-kicad-packages3D.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE-kicad-symbols.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE_PROVENANCE.json8fb14cbd87bbb53c2e381fa614336026b1ef1a6b69d252e40b5de8dafa7f9c66
    libs/PROVENANCE.json90b90b0bfeb34b8307e95d918df95646778dff418c7d3a635c7e54404d79a557
    libs/README.md0de5749f5b5a234357a9a15eb2f8bcfa30016191738e361ca766b315fde7fd48
    libs/USBC.kicad_syme18dbe8d08c163f0fad0bdbbe2f3abab542c895df8cf86492b4a6ac952f3b110
    libs/USBC.pretty/D_SMA.kicad_modbc5361e7a259264ed4ad5b0da3ade2134d250c081f0e8ce53d6fcee0fac9b5c1
    libs/USBC.pretty/LED_D3.0mm.kicad_mod9928bcc8ef35ea406d56af1480e43c606d8d646ba247b3d453d80386cd0f5b10
    libs/USBC.pretty/MountingHole_3.2mm_M3.kicad_mod3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b
    libs/USBC.pretty/PinHeader_1x02_P2.54mm_Vertical.kicad_mod237cf8088cdcca6025a9cfc493511c000fa3cdb04c4382a0115b3f90dccb26b9
    libs/USBC.pretty/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_modbf616ce7d49ae02d5c87d01dd19957ebf3aa66007809680c450de8561f4681a1
    libs/USBC.pretty/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal.kicad_mod02174dd38faa55a40ae193e4f556e21c5c064be926cc33cb4df8704e2eae2e77
    libs/footprint-provenance.yamle284bd4a48de67abafd5fd584de4ec59799aa9204aa3358c829ac92841936d01
    libs/models/D_SMA.step1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db
    libs/models/LED_D3.0mm.stepe83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371
    libs/models/PinHeader_1x02_P2.54mm_Vertical.stepea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41
    libs/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe
    libs/models/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal.step6338ce740fa231c2d3dcc6384e0576994a47240a312a21413cb85d76990a69a0
    libs/upstream/D_SMA.kicad_mode2d049a54ef961e231eb8e7e769078a3c44feb8475a7bdafba01c6646a5144f3
    libs/upstream/LED_D3.0mm.kicad_modd45c606dbf639522eaeae8c6bd2569747ee454daff87ab2db66bdad3200676d0
    libs/upstream/MountingHole_3.2mm_M3.kicad_mod3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b
    libs/upstream/PinHeader_1x02_P2.54mm_Vertical.kicad_mode5c0d699660a4479fa2414cc5be1835c6f52a38630dd85a2d18aab4dcd3ff8e5
    libs/upstream/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_mod1ba096b69c79e588cc54946fb6648699e5b301f67f8df0e0e0be43dcab326436
    libs/upstream/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal.kicad_mod012da5bac71f8e9d4f59d0f7041c3cd8e1e5af3a3d297354b974f61ab24e8691
    libs/upstream/models/D_SMA.step1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db
    libs/upstream/models/LED_D3.0mm.stepe83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371
    libs/upstream/models/PinHeader_1x02_P2.54mm_Vertical.stepea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41
    libs/upstream/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe
    libs/upstream/models/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal.step6338ce740fa231c2d3dcc6384e0576994a47240a312a21413cb85d76990a69a0
    netmap.jsonbdfe4835d48b1a05df9f43e6544f065838c9fafbe0b0ea2037546dd29432018a
    project.yaml2efd5dbe91af637030e3dded07a367f7e4d142a40c995edb9eaead9e5d4ad0cc
    review-profile.yamld38fc628778af1beea8b830ec346ccbe9fd362704e40bd9f5f241b0e53680118
    review-signoff.yamlNot present in this snapshot
    schematic-intent.yamlNot present in this snapshot
    sym-lib-table74d3dc37a2f3d607d33f69b362ed7fb0cde7adb393ad09e96c28da14e583c168
    usb-c-power.kicad_drufd6ec6cfd46f091c61ee7fa09ab3e1c5e29cb9b187e5045bcf055666f0239643
    usb-c-power.kicad_pcb71d6b1659f79148681ebec554cf21e4928dc3ae8abc23684e8cbfdac6b490317
    usb-c-power.kicad_pro0b8ea2009c63a097259838c9eec11d04970f1a6cdb8e2370b8de118c4113e5fd
    usb-c-power.kicad_sch589782a38c9a64c8abc4991247b8f9589eaf7c2677428addd5f4e8ea88ce1221
    +

    Schematic hierarchy SHA-2560a9b293a92f4e4488caf1693a0d867dc96afd385352affc1c651cf8209a6db70

    PCB SHA-2561413eddd499e8ea862f11bcb7aba1e57d0d0a8afd60b20927eb8ab7c30750042

    +
    Declared source pathSHA-256 / absence
    DESIGN_BASIS.md709244824ef6c042f717dab863e3feb48c9ef4caa635414b0ee3143abbad6017
    DEVIATIONS.mdb1d4d35c82e7aa276876cefde9f932cbcc55650bcbac73db7e61875b006c33ad
    REFERENCE_REVIEW.mdc7d6e78f0cf5a0217f2e7465646e7c09018795cfa2a99b52eda812bda464e811
    REQUIREMENTS.md1f58078ae480b4cf95abf1354003324b1a7d45e8d76fc1fa6c6581b04171aab4
    evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_07970b0ad324.brd07970b0ad3243684bdf59c0ced537b8b9a8e8b67f7e9032b9464600da21b04e0
    evidence/files/Adafruit-4090_Adafruit_USB_Type_C_Downstream_Breakout_rev_B_ec14aee06c7a.schec14aee06c7a24546fcc6f6b1687ae85a13cadff955a721f458b125b70954330
    evidence/files/Adafruit-4090_LICENSE_6d594832648b.txt6d594832648bfe9a8b0aa69ee21ce2c72f696170fcd3c21b82c3284174cd2c19
    evidence/files/Adafruit-4090_README.md_6c97cdad4847.txt6c97cdad48475dcc3e5f9afc503fc9f8f0c39b69408462fcb088ef3159336193
    evidence/files/Adafruit-4090_license.txt_075dad5e5fc9.txt075dad5e5fc96c27014fabc269f4f5732909cffd178a486f546d982b6cf86b74
    evidence/files/MF-MSMF075-2_mf-msmf_50d802285818.pdf50d80228581842471d563e28ba0f1b67ab095ee95dfac4079f4a49f7f7bbf3c8
    evidence/files/MFR-25FBF52-5K1_YAGEO-MFR_DATASHEET_b460acdb4764.pdfb460acdb476469774e0785a8ef85aec79e2d95fe41beaa79c5a414e4e95e3fe0
    evidence/files/SMAJ6.0A_doc_b8617e715805.pdfb8617e715805bb3293892c4636279eac57c1ef18e8c87a481cec1b802731b72d
    evidence/files/TSW-102-07-G-S_tsw_th_3a5770b11668.pdf3a5770b11668f4e5a11ba9ceeb4817a23f467b8507e3592f55fb6bd8f96e71bc
    evidence/files/USB-TYPE-C-R2.0_USB_Type-C_Spec_R2.0_-_August_2019_87d15160bf8b.pdf87d15160bf8bd25129b27e0b7c5e261ed0b1806b3b0d3a7b5d8b1eb783dc9981
    evidence/files/USB4105-GF-A_usb4105_fb331fbabee8.pdffb331fbabee8392ed2937ed757c1610cb0f174b84625147c0b580a18eea8c0e5
    evidence/files/USB4125-GF-A_usb4125-spec_adeaf1f264b8.pdfadeaf1f264b8999c4b40bfd7fd202543201a60246297be6906a83e08a59259a2
    evidence/files/USB4125-GF-A_usb4125_ea33e0b40545.pdfea33e0b40545e545bf698cbac3bb1c0f5a3fc7ca6b5b7fda83a63134d4affaa7
    evidence/files/WP710A10ID_WP710A10ID_42d464fbfd8d.pdf42d464fbfd8d3ddef65fa6f9226d298547cdb25d5369aff0c47e5f896595c4bd
    evidence/index.yamldba12b5af45b4a4cc18821299f0b5e14f60d1bf0314671f71939194eb52aaa05
    fp-lib-table0b5e3b96ab837b2cb0dee92b3db61d730754821e2cf68de09e00417e95a60868
    jlcpcb-assembly.yamlNot present in this snapshot
    layout-intent.yamlNot present in this snapshot
    libs/BournsDerived.pretty/MF-MSMF075_1812_Style1.kicad_mod35fed6e5564b59b01de515711bb82fabb9bdb28b855e1717ae993c54026e8463
    libs/LICENSE-kicad-footprints.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE-kicad-packages3D.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE-kicad-symbols.md285b027a721577d0bc0198f36e948c6c282ddaa4b58fef8ed826749576eb0aef
    libs/LICENSE_PROVENANCE.json8fb14cbd87bbb53c2e381fa614336026b1ef1a6b69d252e40b5de8dafa7f9c66
    libs/PROVENANCE.json919fe15cd363cee1fc7d4cada17cf6e6e93604d33ef86cb59952d145ae162eff
    libs/README.md196f740df9eeb9dee5e7aab79828851ee315a1d0e5aed0a90d78bd9ffbae7df1
    libs/USBC.kicad_sym2ece02129902825ee5ce643fcd8b5a3e142c5b19b95b9b52963dc9916dc41e2d
    libs/USBC.pretty/D_SMA.kicad_modbc5361e7a259264ed4ad5b0da3ade2134d250c081f0e8ce53d6fcee0fac9b5c1
    libs/USBC.pretty/LED_D3.0mm.kicad_mod9928bcc8ef35ea406d56af1480e43c606d8d646ba247b3d453d80386cd0f5b10
    libs/USBC.pretty/MountingHole_3.2mm_M3.kicad_mod3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b
    libs/USBC.pretty/PinHeader_1x02_P2.54mm_Vertical.kicad_mod237cf8088cdcca6025a9cfc493511c000fa3cdb04c4382a0115b3f90dccb26b9
    libs/USBC.pretty/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_modbf616ce7d49ae02d5c87d01dd19957ebf3aa66007809680c450de8561f4681a1
    libs/USBC.pretty/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.kicad_mod301333008dbdb106a09e28f86ad5c9d637b8201a6c275f1ff06eb19b53e733ba
    libs/footprint-provenance.yamle284bd4a48de67abafd5fd584de4ec59799aa9204aa3358c829ac92841936d01
    libs/models/D_SMA.step1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db
    libs/models/LED_D3.0mm.stepe83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371
    libs/models/PinHeader_1x02_P2.54mm_Vertical.stepea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41
    libs/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe
    libs/models/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.step090b9119a6ff678f028cbd5aa52c28373fae6a76823c5b8bf7fcd1a8db2f99d5
    libs/upstream/D_SMA.kicad_mode2d049a54ef961e231eb8e7e769078a3c44feb8475a7bdafba01c6646a5144f3
    libs/upstream/LED_D3.0mm.kicad_modd45c606dbf639522eaeae8c6bd2569747ee454daff87ab2db66bdad3200676d0
    libs/upstream/MountingHole_3.2mm_M3.kicad_mod3853c52bba27d3e3e3e18db44a20dfb296eb9e6cd16ebf26fe4a96a2ee8add3b
    libs/upstream/PinHeader_1x02_P2.54mm_Vertical.kicad_mode5c0d699660a4479fa2414cc5be1835c6f52a38630dd85a2d18aab4dcd3ff8e5
    libs/upstream/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.kicad_mod1ba096b69c79e588cc54946fb6648699e5b301f67f8df0e0e0be43dcab326436
    libs/upstream/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.kicad_mod5f11b280b9c01298165a9682d54837ba8062c0b6ac8872a3b7276734c2cf0eef
    libs/upstream/models/D_SMA.step1cfddd4e3b1bf22b8fc6ee3258c2aade882ed7b85b528e23b9db42437775a1db
    libs/upstream/models/LED_D3.0mm.stepe83c2186ad887c36d869f44e28c7b80646ea10cb388697b4380f5a2777268371
    libs/upstream/models/PinHeader_1x02_P2.54mm_Vertical.stepea4d0799007ebdd3945072bf255d673d2fe87eb05fda85fd8d7993ad9397da41
    libs/upstream/models/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.step85bdadc9190739c38429da06b1d9c76ccf33aef9a0794a2e7a9dd5b58d9d05fe
    libs/upstream/models/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal.step090b9119a6ff678f028cbd5aa52c28373fae6a76823c5b8bf7fcd1a8db2f99d5
    netmap.json9cf452fe7054949e8b1a75fb705df228bbea60c664988e4806b5922a5036fb8c
    project.yaml2efd5dbe91af637030e3dded07a367f7e4d142a40c995edb9eaead9e5d4ad0cc
    review-profile.yaml830d0b62c775aaad9b35d5a3b3a0e1f2d1bede2831f4137177db092cff55476b
    review-signoff.yamlNot present in this snapshot
    schematic-intent.yamlNot present in this snapshot
    sym-lib-table74d3dc37a2f3d607d33f69b362ed7fb0cde7adb393ad09e96c28da14e583c168
    usb-c-power.kicad_drufd6ec6cfd46f091c61ee7fa09ab3e1c5e29cb9b187e5045bcf055666f0239643
    usb-c-power.kicad_pcb1413eddd499e8ea862f11bcb7aba1e57d0d0a8afd60b20927eb8ab7c30750042
    usb-c-power.kicad_pro0b8ea2009c63a097259838c9eec11d04970f1a6cdb8e2370b8de118c4113e5fd
    usb-c-power.kicad_sch5fdd93eb0e2a4b63cecae367a2a9ead2ddc4c76833e77760aa0564d349fe76b3

    Native image

    100%
    -', + 'file:///C:/private/owner.txt', 'https://example.invalid/invented-datasheet', +]) +def test_rehashed_unsafe_or_unrelated_evidence_url_cannot_pass(packet, embedded_only, url): + purchased_component(packet)['sources'][0]['url'] = url + write_packet(packet) + with pytest.raises(ValueError, match='component identity or evidence'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('field', ['title', 'manufacturer', 'revision', 'retrieved_on', 'sha256']) +def test_rehashed_invented_evidence_metadata_cannot_pass(packet, embedded_only, field): + purchased_component(packet)['sources'][0][field] = 'invented archived evidence' + write_packet(packet) + with pytest.raises(ValueError, match='component identity or evidence'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('field', ['erc', 'drc', 'unconnected']) +def test_rehashed_finding_counts_must_match_native_reports(packet, embedded_only, field): + sensor(packet)[field] += 1 + write_packet(packet) + with pytest.raises(ValueError, match='finding counts differ from native reports'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('fault', ['duplicate', 'missing', 'extra']) +def test_rehashed_physical_component_inventory_cannot_gain_or_lose_parts(packet, embedded_only, fault): + parts = sensor(packet)['geometry']['components'] + if fault == 'missing': + parts.pop() + else: + part = copy.deepcopy(parts[0]) + if fault == 'extra': + part['reference'] = 'U999' + parts.append(part) + write_packet(packet) + with pytest.raises(ValueError, match='physical component inventory'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('fault', ['extra', 'missing', 'net', 'conflicting-duplicate']) +def test_rehashed_numbered_pad_inventory_and_nets_are_exact(packet, embedded_only, fault): + pads = purchased_component(packet)['pads'] + if fault == 'missing': + pads.pop() + elif fault == 'net': + pads[0]['net'] = 'INVENTED' + else: + extra = copy.deepcopy(pads[0]) + if fault == 'extra': + extra['number'] = '999' + extra['net'] = 'INVENTED' + pads.append(extra) + write_packet(packet) + with pytest.raises(ValueError, match='numbered-pad inventory|conflicting native pad net'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('fault', ['title', 'subtitle', 'boundaries', 'caption', 'pcb-sha', 'review-url']) +def test_rehashed_description_scope_and_fingerprint_cannot_be_replaced(packet, embedded_only, fault): + board = sensor(packet) + if fault == 'boundaries': + board['boundaries'] = ['Qualified for production'] + elif fault == 'caption': + board['images']['bottom']['caption'] = 'Unmirrored and manufacturing approved' + elif fault == 'pcb-sha': + board['pcb_sha256'] = '0' * 64 + elif fault == 'review-url': + board['review_url'] = 'javascript:alert(1)' + else: + board[fault] = 'Invented circuit description' + write_packet(packet) + with pytest.raises(ValueError, match='description differs|view scope differs|fingerprint differs|review URL differs'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('fault', ['missing', 'extra', 'empty']) +def test_source_artifact_inventory_is_mandatory_before_source_checks(packet, fault): + artifacts = packet.manifest['source_artifacts'] + if fault == 'missing': + artifacts.pop(next(iter(artifacts))) + elif fault == 'extra': + artifacts['examples/i2c-sensor/owner-unlisted.png'] = '0' * 64 + else: + artifacts.clear() + write_packet(packet) + # This calls the real _check_sources; no native or source checks are mocked. + with pytest.raises(ValueError, match='source artifact inventory is incomplete or unexpected'): + explorer.verify(ROOT, packet.output) + + +def test_rehashed_embedded_ledger_cannot_disagree_with_manifest(packet, embedded_only): + board = sensor(packet) + key = next(name for name, value in board['source_inputs'].items() if value is not None) + board['source_inputs'][key] = '0' * 64 + write_packet(packet) + with pytest.raises(ValueError, match='embedded source ledger differs'): + explorer.verify(ROOT, packet.output) + + +def test_matching_embedded_and_manifest_ledgers_cannot_mask_stale_current_source(packet): + board = sensor(packet) + key = next(name for name, value in board['source_inputs'].items() if value is not None) + board['source_inputs'][key] = '0' * 64 + packet.manifest['source_projects'][board['id']][key] = '0' * 64 + write_packet(packet) + with pytest.raises(ValueError, match='explorer inputs are stale'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('assertion', [False, 1]) +def test_source_preservation_requires_exact_true(packet, assertion): + packet.manifest['source_cad_unchanged'] = assertion + write_packet(packet) + with pytest.raises(ValueError, match='no source-preservation assertion'): + explorer.verify(ROOT, packet.output) + + +def test_duplicate_board_id_cannot_hide_in_manifest_dictionary(packet, embedded_only): + packet.data['boards'].append(copy.deepcopy(sensor(packet))) + write_packet(packet) + with pytest.raises(ValueError, match='embedded source ledger differs'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('target', ['manifest.json', 'index.html']) +@pytest.mark.parametrize('fault', ['mutation', 'identical-replacement', 'hardlink']) +def test_packet_changed_during_final_source_check_is_rejected(packet, monkeypatch, target, fault): + calls = 0 + + def final_source_check(*_): + nonlocal calls + calls += 1 + if calls != 2: + return + path = packet.output / target + if fault == 'mutation': + path.write_bytes(path.read_bytes() + b'\nchanged after initial verification\n') + elif fault == 'identical-replacement': + replacement = packet.output / 'new-publisher-file' + replacement.write_bytes(path.read_bytes()) + replacement.replace(path) + else: + os.link(path, packet.output / 'another-name-for-packet-file') + + monkeypatch.setattr(explorer, '_check_sources', final_source_check) + with pytest.raises((ValueError, RuntimeError), match='changed during verification|aliased'): + explorer.verify(ROOT, packet.output) + assert calls == 2 + + +@pytest.mark.parametrize('target', ['manifest.json', 'index.html']) +def test_initial_packet_hardlink_alias_is_rejected(packet, monkeypatch, target): + os.link(packet.output / target, packet.output / 'other-name') + monkeypatch.setattr(explorer, '_check_sources', lambda *_: pytest.fail('aliased packet reached source verification')) + with pytest.raises(ValueError, match='aliased'): + explorer.verify(ROOT, packet.output) + + +def test_packet_root_reparse_alias_is_rejected_before_source_loading(packet, monkeypatch): + original = Path.lstat + + def lstat(path): + if path == packet.output: + return SimpleNamespace(st_mode=original(path).st_mode, st_file_attributes=0x400) + return original(path) + + monkeypatch.setattr(Path, 'lstat', lstat) + monkeypatch.setattr(explorer, '_check_sources', lambda *_: pytest.fail('redirected packet reached sources')) + with pytest.raises(ValueError, match='aliased'): + explorer.verify(ROOT, packet.output) + + +def test_changed_html_without_outer_manifest_update_is_rejected(packet, monkeypatch): + path = packet.output / 'index.html' + path.write_bytes(path.read_bytes() + b'\nchanged html\n') + monkeypatch.setattr(explorer, '_check_sources', lambda *_: pytest.fail('bad output hash reached source checks')) + with pytest.raises(ValueError, match='output bytes do not match'): + explorer.verify(ROOT, packet.output) + + +@pytest.mark.parametrize('url', [None, '', 'javascript:alert(1)', 'data:text/html,unsafe', + 'file:///private.txt', '//example.invalid/path', + 'https://user:secret@example.invalid/source']) +def test_evidence_url_filter_drops_active_local_or_credentialed_links(url): + assert explorer._safe_url(url) is None + + +def test_evidence_url_filter_preserves_primary_https_link(): + url = 'https://www.ti.com/lit/ds/symlink/thvd1450.pdf' + assert explorer._safe_url(url) == url diff --git a/tools/build_example_explorer.py b/tools/build_example_explorer.py new file mode 100644 index 0000000..4e7b6d1 --- /dev/null +++ b/tools/build_example_explorer.py @@ -0,0 +1,329 @@ +"""Build or verify the offline example workbench from real saved native sources. + +Build requires KiCad Python to read pad/track geometry. Verification needs only +the locked Python workspace and never reruns or approves native CAD checks. +""" + +from __future__ import annotations + +import argparse +import base64 +import hashlib +import json +import re +import subprocess +import sys +import tempfile +from datetime import UTC, datetime +from pathlib import Path +from urllib.parse import urlsplit + +from kicad_claude.adapters import sch_io + +from pcb_copilot.evidence.index import load_evidence_index +from pcb_copilot.project import load_project +from pcb_copilot.review.report import verify_report +from pcb_copilot.schematic.preview import schematic_files +from pcb_copilot.toolchain import discover_toolchain +from pcb_copilot.transaction import copy_inputs, input_hashes + +# Both direct script execution and pytest/module imports use the same helpers. +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from check_examples import _capture, _object, check_example +from example_explorer_html import render_explorer +from media_publication import publish_bundle + +ROOT = Path(__file__).resolve().parents[1] +DEFAULT_OUTPUT = ROOT / 'docs/demos/example-explorer' +BOARDS = { + 'usb-c-power': ('USB-C power entry', 'Independent CC resistors / fused 5 V bench power', 'usb-c-review', [ + 'Externally qualified 4.75–5.25 V source; at most 500 mA total board and load near 23 °C.', + 'No PD, current-advertisement detector, active current limiter or reverse-current protection.', + 'The PPTC is not a 500 mA current limiter. The TVS is not a 5 V overvoltage regulator.', + 'F1 has no 3D body model. Connector fit, protection coordination, assembly and human decisions remain open.', + ]), + 'i2c-sensor': ('I²C temperature sensor', 'MCP9808 / address shunts / open-drain ALERT', 'i2c-review', [ + 'Common-ground, same-rail 3.3 V host. No level shifting, back-power protection or interface ESD qualification.', + 'Default address 0x18; A0/A1/A2 shunts select through 0x1F. Power off before changing shunts.', + 'Fixed 4.7 kΩ bus pullups need review with the actual host and cable. ALERT is disabled until firmware enables it.', + 'Temperature behavior, physical fit, supplier assembly and human release decisions remain open.', + ]), + 'rs485-interface': ('RS-485 interface', 'THVD1450 / explicit control defaults / removable termination', 'rs485-review', [ + 'Short common-ground bench link at 3.3 V. No isolation, surge/EMC or cable-system qualification.', + 'DE and active-low receiver-enable have pull-down defaults: driver off, receiver on.', + 'Fit termination only at the two physical bus ends. Evaluate actual differential loading and resistor power.', + 'UART drain and transceiver enable timing need host-specific implementation. Hardware, assembly and human decisions remain open.', + ]), +} +CAPTIONS = { + 'model': 'Recorded native KiCad 3D render of an unbuilt prototype. Missing models remain absent; fit is unqualified.', + 'schematic': 'Native vector PDF rendered to a page image. Download the PDF below for readable circuit-scale inspection.', + 'top': 'Native top copper and silkscreen. Inspect clearances, pad connections and physical markings in the saved CAD.', + 'bottom': 'Native bottom copper and silkscreen, mirrored as viewed from the underside.', +} + + +def digest(path: Path) -> str: + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def uri(path: Path, kind: str) -> str: + return f'data:{kind};base64,' + base64.b64encode(path.read_bytes()).decode() + + +def asset_paths(repository: Path, name: str) -> dict: + root = repository / 'examples' / name + packet = repository / 'docs/demos' / BOARDS[name][2] + return {'model': root / 'output/board-3d.png', 'schematic': packet / 'schematic-001.png', + 'top': packet / 'top-copper.png', 'bottom': packet / 'bottom-copper.png', + 'pdf': packet / 'schematic.pdf', 'packet_manifest': packet / 'manifest.json', + 'packet_source': packet / 'source.json', 'review': packet / 'review.json', + 'capture': root / 'output/SOURCE.json', 'erc': root / 'output/erc.json', 'drc': root / 'output/drc.json'} + + +def _safe_url(value: str | None) -> str | None: + if not value: + return None + parsed = urlsplit(value) + if parsed.scheme not in {'https', 'http'} or not parsed.netloc or parsed.username or parsed.password: + return None + return value + + +def _fields(project) -> dict: + fields = {} + for file in schematic_files(project.schematic_path): + for symbol in sch_io.find_children(sch_io.parse_file(file), 'symbol'): + values = {str(p[1]): str(p[2]) for p in sch_io.find_children(symbol, 'property')} + if values.get('Reference') and not values['Reference'].startswith('#'): + fields[values['Reference']] = values + return fields + + +def component_metadata(project) -> dict: + fields, evidence = _fields(project), load_evidence_index(project.evidence_index_path) + result = {} + for ref, values in fields.items(): + if not values.get('Footprint'): + continue + mpn = values.get('MPN', '') + records = [record for record in evidence.records if ref in record.component_refs or mpn in record.part_numbers] + records.sort(key=lambda record: (record.trust_tier.value != 'manufacturer', record.title or record.path)) + result[ref] = {'value': values.get('Value', ''), 'mpn': mpn, + 'footprint': values['Footprint'].split(':')[-1], + 'sources': [{'title': record.title or record.path, 'url': _safe_url(record.source_url), + 'manufacturer': record.manufacturer, 'revision': record.revision, + 'retrieved_on': record.retrieved_on.isoformat(), 'sha256': record.sha256} + for record in records]} + return result + + +def reconcile_geometry(geometry: dict, netmap: dict) -> None: + """Fail closed when the displayed native pins disagree with declared intent.""" + actual = {} + for component in geometry['components']: + ref = component['reference'] + if ref in actual: + raise ValueError(f'duplicate native reference: {ref}') + actual[ref] = {} + for pad in component['pads']: + if pad['number']: + previous = actual[ref].setdefault(pad['number'], pad['net']) + if previous != pad['net']: + raise ValueError(f'conflicting native pad net: {ref}.{pad["number"]}') + numbered = {ref: pins for ref, pins in actual.items() if pins} + expected = {ref: {str(number): net.lstrip('/') for number, net in pins.items()} + for ref, pins in netmap['nets'].items() if pins} + if numbered != expected: + raise ValueError('explorer exact numbered-pad inventory or native pin nets differ from netmap') + + +def capture(repository: Path, name: str, temporary: Path) -> tuple[dict, dict]: + check_example(repository, name) + project = load_project(repository / 'examples' / name) + before = input_hashes(project) + title, subtitle, packet_name, boundaries = BOARDS[name] + packet = repository / 'docs/demos' / packet_name + if verify_report(packet, project=project)['exit_code']: + raise ValueError('recorded review packet is stale or inconsistent') + copied_root = temporary / name + copy_inputs(project, copied_root, before) + copied = load_project(copied_root) + if input_hashes(copied) != before: + raise RuntimeError('source changed during explorer snapshot creation') + tools = discover_toolchain(repository) + if tools.kipython is None: + raise RuntimeError('KiCad Python is required to extract native board geometry') + result = subprocess.run([str(tools.kipython), '-I', str(Path(__file__).with_name('explorer_native.py')), + str(copied.pcb_path)], capture_output=True, encoding='utf-8', + errors='replace', timeout=90, check=False) + if result.returncode: + raise RuntimeError('native explorer extraction failed: ' + result.stderr) + geometry = json.loads(result.stdout, object_pairs_hook=_object) + reconcile_geometry(geometry, json.loads(copied.netmap_path.read_bytes(), object_pairs_hook=_object)) + metadata = component_metadata(copied) + for component in geometry['components']: + expected = metadata[component['reference']] + if any(component[key] != expected[key] for key in ('value', 'footprint')): + raise ValueError('native component value or footprint differs from saved schematic') + component.update(expected) + erc_path, drc_path = project.root / 'output/erc.json', project.root / 'output/drc.json' + erc, drc = json.loads(erc_path.read_bytes()), json.loads(drc_path.read_bytes()) + image_files = {'model': project.root / 'output/board-3d.png', + 'schematic': packet / 'schematic-001.png', 'top': packet / 'top-copper.png', + 'bottom': packet / 'bottom-copper.png'} + artifacts = [*image_files.values(), packet / 'schematic.pdf', packet / 'manifest.json', + packet / 'source.json', packet / 'review.json', project.root / 'output/SOURCE.json', erc_path, drc_path] + source_artifacts = {p.relative_to(repository).as_posix(): digest(p) for p in artifacts} + if input_hashes(project) != before or input_hashes(copied) != before: + raise RuntimeError('source changed during explorer extraction') + return {'id': name, 'title': title, 'subtitle': subtitle, 'boundaries': boundaries, + 'erc': sum(len(sheet['violations']) for sheet in erc['sheets']), + 'drc': len(drc['violations']), 'unconnected': len(drc['unconnected_items']), + 'source_inputs': before, 'pcb_sha256': before[project.pcb_path.relative_to(project.root).as_posix()], + 'geometry': geometry, 'images': {key: {'uri': uri(path, 'image/png'), 'caption': CAPTIONS[key]} + for key, path in image_files.items()}, + 'pdf': uri(packet / 'schematic.pdf', 'application/pdf'), + 'review_url': f'https://github.com/devkyber/PCB/blob/main/docs/demos/{packet_name}/review.json'}, source_artifacts + + +def _data(payload: bytes) -> dict: + match = re.search(rb'', payload, re.DOTALL) + if not match: + raise ValueError('explorer lacks its embedded source data') + return json.loads(match[1], object_pairs_hook=_object) + + +def _check_sources(repository: Path, manifest: dict) -> None: + if manifest.get('source_cad_unchanged') is not True: + raise ValueError('explorer has no source-preservation assertion') + if not manifest.get('source_projects') or not set(manifest['source_projects']) <= set(BOARDS): + raise ValueError('explorer source projects must be documented examples') + required_artifacts = {p.relative_to(repository).as_posix() + for name in manifest['source_projects'] for p in asset_paths(repository, name).values()} + if set(manifest.get('source_artifacts', {})) != required_artifacts: + raise ValueError('explorer source artifact inventory is incomplete or unexpected') + for name, expected in manifest['source_projects'].items(): + check_example(repository, name) + project = load_project(repository / 'examples' / name) + if input_hashes(project) != expected: + raise ValueError('explorer inputs are stale: ' + name) + if verify_report(repository / 'docs/demos' / BOARDS[name][2], project=project)['exit_code']: + raise ValueError('explorer review source is stale: ' + name) + for name, expected in manifest['source_artifacts'].items(): + _, payload, _ = _capture(repository, name) + if hashlib.sha256(payload).hexdigest() != expected: + raise ValueError('explorer source artifact is stale: ' + name) + + +def validate_embedded_board(repository: Path, board: dict) -> None: + name = board['id'] + paths = asset_paths(repository, name) + project = load_project(repository / 'examples' / name) + title, subtitle, _packet, boundaries = BOARDS[name] + if (board['title'], board['subtitle'], board['boundaries']) != (title, subtitle, boundaries): + raise ValueError('explorer circuit description differs from the supported example') + if set(board.get('images', {})) != {'model', 'schematic', 'top', 'bottom'}: + raise ValueError('explorer omits required native images') + for key in ('model', 'schematic', 'top', 'bottom', 'pdf'): + value = board['pdf'] if key == 'pdf' else board['images'][key]['uri'] + mime = 'application/pdf' if key == 'pdf' else 'image/png' + if value != uri(paths[key], mime): + raise ValueError('explorer embedded artifact differs from native source: ' + key) + if key != 'pdf' and board['images'][key]['caption'] != CAPTIONS[key]: + raise ValueError('explorer native view scope differs from the captured example') + if board['review_url'] != f'https://github.com/devkyber/PCB/blob/main/docs/demos/{BOARDS[name][2]}/review.json': + raise ValueError('explorer review URL differs from the captured example') + erc, drc = json.loads(paths['erc'].read_bytes()), json.loads(paths['drc'].read_bytes()) + counts = (sum(len(sheet['violations']) for sheet in erc['sheets']), len(drc['violations']), len(drc['unconnected_items'])) + if (any(type(board[key]) is not int for key in ('erc', 'drc', 'unconnected')) + or (board['erc'], board['drc'], board['unconnected']) != counts): + raise ValueError('explorer finding counts differ from native reports') + expected = component_metadata(project) + components = board['geometry']['components'] + if len(components) != len(expected) or {p['reference'] for p in components} != set(expected): + raise ValueError('explorer physical component inventory differs from saved schematic') + for component in components: + if any(component.get(key) != value for key, value in expected[component['reference']].items()): + raise ValueError('explorer component identity or evidence differs from saved sources') + if board['pcb_sha256'] != board['source_inputs'][project.pcb_path.relative_to(project.root).as_posix()]: + raise ValueError('explorer PCB fingerprint differs from its input ledger') + reconcile_geometry(board['geometry'], json.loads(project.netmap_path.read_bytes(), object_pairs_hook=_object)) + + +def verify(repository: Path, output: Path) -> dict: + _, manifest_bytes, manifest_version = _capture(output, 'manifest.json') + manifest = json.loads(manifest_bytes, object_pairs_hook=_object) + if (type(manifest.get('schema_version')) is not int or manifest['schema_version'] != 1 + or set(manifest.get('outputs', {})) != {'index.html'}): + raise ValueError('invalid explorer manifest inventory') + _, payload, payload_version = _capture(output, 'index.html') + if {p.name for p in output.iterdir()} != {'index.html', 'manifest.json'}: + raise ValueError('unexpected files in explorer packet inventory') + record = manifest['outputs']['index.html'] + if hashlib.sha256(payload).hexdigest() != record['sha256'] or len(payload) != record['bytes']: + raise ValueError('explorer output bytes do not match the manifest') + data = _data(payload) + if (len(data['boards']) != len(manifest['source_projects']) + or {board['id']: board['source_inputs'] for board in data['boards']} != manifest['source_projects']): + raise ValueError('explorer embedded source ledger differs from manifest') + if render_explorer(data) != payload: + raise ValueError('explorer HTML differs from the supported renderer') + _check_sources(repository, manifest) + for board in data['boards']: + validate_embedded_board(repository, board) + _check_sources(repository, manifest) + for name, expected_payload, expected_version in (('manifest.json', manifest_bytes, manifest_version), + ('index.html', payload, payload_version)): + _, current, version = _capture(output, name) + if current != expected_payload or version != expected_version: + raise RuntimeError('explorer changed during verification') + return {'integrity_valid': True, 'current_source_matches': True, 'boards': len(data['boards']), + 'scope': 'Recorded source/output byte identities and native pin-net agreement; no native rerun or engineering approval.'} + + +def build(repository: Path, output: Path, names: list[str]) -> dict: + if not names or len(names) != len(set(names)) or not set(names) <= set(BOARDS): + raise ValueError('select each documented example at most once') + with tempfile.TemporaryDirectory(prefix='pcb-example-explorer-') as directory: + work = Path(directory) + boards, artifacts = [], {} + for name in names: + board, source = capture(repository, name, work) + boards.append(board) + artifacts.update(source) + payload = render_explorer({'schema_version': 1, 'boards': boards}) + stage = work / 'publish' + stage.mkdir() + (stage / 'index.html').write_bytes(payload) + manifest = {'schema_version': 1, 'generated_utc': datetime.now(UTC).isoformat(), + 'source_cad_unchanged': True, + 'source_projects': {board['id']: board['source_inputs'] for board in boards}, + 'source_artifacts': artifacts, + 'generators': {p.name: digest(p) for p in (Path(__file__), Path(__file__).with_name('explorer_native.py'), + Path(__file__).with_name('example_explorer_html.py'))}, + 'outputs': {'index.html': {'sha256': hashlib.sha256(payload).hexdigest(), 'bytes': len(payload)}}, + 'scope': 'Offline recorded native views and connectivity map; no hardware communication or fabrication approval.'} + (stage / 'manifest.json').write_bytes((json.dumps(manifest, indent=2) + '\n').encode()) + verify(repository, stage) + publish_bundle(stage, output, 'manifest.json', source_check=lambda: _check_sources(repository, manifest)) + return verify(repository, output) + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--output', type=Path, default=DEFAULT_OUTPUT) + parser.add_argument('--example', choices=tuple(BOARDS), action='append') + parser.add_argument('--verify', action='store_true', help='verify the retained explorer without KiCad') + args = parser.parse_args(argv) + try: + result = verify(ROOT, args.output) if args.verify else build(ROOT, args.output, args.example or list(BOARDS)) + except (OSError, ValueError, RuntimeError, KeyError, TypeError, subprocess.TimeoutExpired) as exc: + print(f'Example explorer failed: {exc}', file=sys.stderr) + return 1 + print(json.dumps(result, indent=2)) + return 0 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/tools/check_examples.py b/tools/check_examples.py index 29b7aa0..c7853b5 100644 --- a/tools/check_examples.py +++ b/tools/check_examples.py @@ -10,6 +10,7 @@ import argparse import hashlib import json +import os import re import stat from pathlib import Path, PurePosixPath @@ -38,13 +39,15 @@ def _object(pairs): def _path(root: Path, relative: str) -> Path: if (not isinstance(relative, str) or not relative or ':' in relative or '\\' in relative or PurePosixPath(relative).is_absolute() or '..' in PurePosixPath(relative).parts - or PurePosixPath(relative).as_posix() != relative): + or PurePosixPath(relative).as_posix() != relative or relative == '.' + or any(ord(char) < 32 for char in relative)): raise ValueError('artifact path must be canonical and contained') - path = root - for part in PurePosixPath(relative).parts: - path /= part + path = root.absolute() / relative + # Include the root and its ancestors: load_project resolves paths, which + # otherwise hides a redirected examples/BOARD directory before validation. + for component in (*reversed(path.parents), path): try: - info = path.lstat() + info = component.lstat() except FileNotFoundError: continue if stat.S_ISLNK(info.st_mode) or getattr(info, 'st_file_attributes', 0) & 0x400: @@ -54,6 +57,31 @@ def _path(root: Path, relative: str) -> Path: return path +def _version(info) -> tuple: + # Windows path stat and descriptor fstat disagree about st_ctime's legacy + # creation/change-time meaning. Identity, length and modification time are + # comparable on both paths; the payload hash is checked independently. + return info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns + + +def _capture(root: Path, relative: str) -> tuple[Path, bytes, tuple]: + """Read one plain file without accepting a concurrent replacement or alias.""" + path = _path(root, relative) + initial = path.stat() + if not stat.S_ISREG(initial.st_mode) or initial.st_nlink != 1: + raise ValueError(f'captured output missing or aliased: {relative}') + with path.open('rb') as stream: + opened = os.fstat(stream.fileno()) + payload = stream.read() + read = os.fstat(stream.fileno()) + current = _path(root, relative).stat() + if (opened.st_nlink != 1 or read.st_nlink != 1 or current.st_nlink != 1 + or not _version(initial) == _version(opened) == _version(read) == _version(current) + or len(payload) != current.st_size): + raise RuntimeError(f'example capture changed during verification: {relative}') + return path, payload, _version(current) + + def _footprints(project) -> int: references = {} for path in schematic_files(project.schematic_path): @@ -81,19 +109,19 @@ def _footprints(project) -> int: def check_example(repository: Path, name: str) -> dict: if name not in EXAMPLES: raise ValueError('select a documented active example') - project = load_project(repository / 'examples' / name) + project = load_project(_path(repository, 'examples/' + name)) before = input_hashes(project) for result in (verify_evidence(project), verify_schematic_evidence(project)): if result.exit_code: raise ValueError('; '.join((*result.machine_failures, *result.conflicts))) count = _footprints(project) - manifest_path = _path(project.root, 'output/SOURCE.json') - manifest = json.loads(manifest_path.read_bytes(), object_pairs_hook=_object) + manifest_path, manifest_bytes, manifest_version = _capture(project.root, 'output/SOURCE.json') + manifest = json.loads(manifest_bytes, object_pairs_hook=_object) if not isinstance(manifest, dict): raise ValueError('example capture manifest must be an object') # noqa: TRY004 -- Invalid artifact schema, not an API argument type. legacy = name == 'gpio-indicator' captured = manifest.get('inputs') if legacy else manifest.get('source_inputs') - if (manifest.get('schema_version') != 1 or captured != before + if (type(manifest.get('schema_version')) is not int or manifest['schema_version'] != 1 or captured != before or (not legacy and manifest.get('source_cad_unchanged') is not True)): raise ValueError('published artifact capture is stale or has no preserved source identity') if not legacy and manifest.get('source_project') != 'examples/' + name: @@ -101,29 +129,46 @@ def check_example(repository: Path, name: str) -> dict: outputs = manifest.get('outputs') if not isinstance(outputs, dict) or not outputs: raise ValueError('example capture has no output inventory') - verified = set() + verified, observed, names = set(), {}, set() for relative, record in outputs.items(): - path = _path(project.root if legacy else manifest_path.parent, relative) - if not path.is_file() or path == manifest_path or path.stat().st_nlink != 1: + if not isinstance(relative, str) or relative.casefold() in names: + raise ValueError('capture output names must not alias the same portable path') + names.add(relative.casefold()) + path, payload, version = _capture(project.root if legacy else manifest_path.parent, relative) + if path == manifest_path: raise ValueError(f'captured output missing or aliased: {relative}') digest = record if legacy else record.get('sha256') if isinstance(record, dict) else None if not isinstance(digest, str) or not re.fullmatch(r'[0-9a-f]{64}', digest): raise ValueError(f'invalid output digest: {relative}') - payload = path.read_bytes() if hashlib.sha256(payload).hexdigest() != digest: raise ValueError(f'captured output hash mismatch: {relative}') if not legacy and (type(record.get('bytes')) is not int or record['bytes'] != len(payload)): raise ValueError(f'captured output byte count mismatch: {relative}') verified.add(path.relative_to(manifest_path.parent).as_posix()) + observed[path.relative_to(project.root).as_posix()] = (digest, len(payload), version) required = {'schematic.pdf', 'schematic.png', 'assembly.png'} if (not required <= verified or not {'top-copper.png', 'board-front.png', 'front.png'}.intersection(verified) or not {'bottom-copper.png', 'board-back.png', 'back.png'}.intersection(verified)): raise ValueError('example capture omits required native review views') if input_hashes(project) != before: raise RuntimeError('example source inputs changed during verification') + # The final source check may overlap a renderer publishing new files. Do + # not report cached hashes as the identity of a now-mixed capture. Recheck + # the manifest last so its exact original bytes still describe this read. + observed['output/SOURCE.json'] = (hashlib.sha256(manifest_bytes).hexdigest(), + len(manifest_bytes), manifest_version) + for relative, (expected_hash, expected_bytes, expected_version) in observed.items(): + try: + _path_now, payload, version = _capture(project.root, relative) + except (OSError, ValueError, RuntimeError) as exc: + raise RuntimeError(f'example capture changed during verification: {relative}') from exc + if (version != expected_version or len(payload) != expected_bytes + or hashlib.sha256(payload).hexdigest() != expected_hash): + raise RuntimeError(f'example capture changed during verification: {relative}') return {'example': name, 'archive_and_selected_part_coverage': True, 'physical_footprints_verified': count, 'source_input_entries': len(before), - 'captured_artifacts_verified': len(verified), 'native_review_rerun': False, + 'captured_artifacts_verified': len(verified), 'capture_unchanged_during_verification': True, + 'native_review_rerun': False, 'scope': 'Offline source/artifact and footprint lineage checks; recorded native findings remain unresolved.'} diff --git a/tools/check_readme.py b/tools/check_readme.py index c485e22..88592a6 100644 --- a/tools/check_readme.py +++ b/tools/check_readme.py @@ -13,8 +13,8 @@ ROOT = Path(__file__).resolve().parents[1] DOCUMENTS = ["README.md", "docs/QUICKSTART.md", "docs/ROADMAP.md", "docs/EVALUATION.md", "docs/media/README.md", - "docs/evaluation/2026-10-29/report.md", "docs/HANDOVER.md", - "examples/README.md", "examples/usb-c-power/README.md", "examples/i2c-sensor/README.md", "examples/rs485-interface/README.md"] + "docs/evaluation/2026-10-29/report.md", "docs/HANDOVER.md", "docs/EXPLORER.md", + "examples/i2c-sensor/BRINGUP.md", "examples/rs485-interface/BRINGUP.md", "examples/README.md", "examples/usb-c-power/README.md", "examples/i2c-sensor/README.md", "examples/rs485-interface/README.md"] EXAMPLES_MANIFEST = 'examples-manifest.json' MEDIA_MANIFESTS = ('manifest.json', 'example-manifest.json', 'proof-manifest.json', EXAMPLES_MANIFEST) CAD_MANIFESTS = frozenset(MEDIA_MANIFESTS[:2]) diff --git a/tools/example_explorer_html.py b/tools/example_explorer_html.py new file mode 100644 index 0000000..4457e3c --- /dev/null +++ b/tools/example_explorer_html.py @@ -0,0 +1,70 @@ +"""A self-contained, source-bound circuit explorer with no network dependency.""" + +from __future__ import annotations + +import base64 +import hashlib +import html +import json + +CSS = r''' +:root{color-scheme:light;--ink:#193446;--muted:#536a79;--paper:#fff;--desk:#e8eff3;--line:#bfd0da;--blue:#13667d;--copper:#ad572e;--green:#25664c;--amber:#925009} +*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--desk);font:15px/1.5 "Segoe UI",Arial,sans-serif}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(30px,4.5vw,58px);letter-spacing:-.035em;line-height:1.08;margin-bottom:10px}h2{font-size:24px;margin-bottom:6px}h3{font-size:16px;margin-bottom:8px}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button,a,input,select,summary{outline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #147a9c}a{color:var(--blue)}button,input,select{border:1px solid #a8bcc9;border-radius:5px;background:white;padding:8px 12px}button:hover{background:#edf5f8}button[aria-pressed=true]{background:var(--blue);border-color:var(--blue);color:white}button:disabled{cursor:default;opacity:.5}.shell{max-width:1800px;margin:auto;padding:28px clamp(14px,3vw,44px) 42px}.mast{display:flex;justify-content:space-between;gap:30px;align-items:end}.brand{color:var(--blue);font-weight:700;margin-bottom:12px}.lead{max-width:67ch;color:var(--muted);font-size:17px;margin-bottom:22px}.notice{max-width:42ch;font-size:13px;color:var(--muted);padding-left:14px;border-left:3px solid var(--copper)}nav{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 24px}nav button{padding:11px 17px;font-weight:600}.board-head{display:flex;justify-content:space-between;gap:20px;align-items:baseline;margin-bottom:14px}.board-head p{color:var(--muted);margin-bottom:0}.result{white-space:nowrap;color:var(--green);font-size:13px}.workspace{display:grid;grid-template-columns:260px minmax(0,1fr) 290px;min-height:620px;border:1px solid var(--line);border-radius:8px;background:var(--paper);overflow:hidden}.inventory{border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0}.tools{padding:18px 16px;border-bottom:1px solid var(--line)}.tools label{display:block;color:var(--muted);font-size:13px;margin-bottom:5px}.tools input{width:100%;min-width:0}.parts{max-height:570px;overflow:auto;padding:6px}.part{display:block;text-align:left;width:100%;border:0;border-radius:4px;padding:9px 11px;background:transparent}.part strong{display:inline-block;width:40px}.part span{font-size:13px}.part small{display:block;color:var(--muted);font-size:11px;margin-left:40px;overflow-wrap:anywhere}.part[aria-pressed=true] small{color:#d7f3fa}.count{font-size:12px;color:var(--muted);margin:8px 0 0}.viewer{min-width:0;display:flex;flex-direction:column;background:#f3f7f9}.viewbar{display:flex;gap:6px;flex-wrap:wrap;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line);background:white}.viewbar button{font-size:13px;padding:6px 9px}.viewbar select{margin-left:auto;max-width:210px;font-size:13px}.stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:440px;flex:1;overflow:auto;background:linear-gradient(0deg,#eff5f8 1px,transparent 1px),linear-gradient(90deg,#eff5f8 1px,transparent 1px),#e1eaf0;background-size:24px 24px;padding:18px}.stage>img{display:block;max-width:100%;max-height:560px;object-fit:contain}.stage>img.model{filter:drop-shadow(0 16px 12px #22384b27)}.stage svg{width:100%;max-height:560px;min-height:360px;display:block;touch-action:manipulation}.stage svg .route{opacity:.55}.stage svg .dim{opacity:.09}.stage svg .hit{stroke:#f2b537!important;opacity:1!important}.stage svg .pad{cursor:pointer;stroke:#e6d7a2;stroke-width:.08}.stage svg .pad:hover{stroke:#f2b537;stroke-width:.35}.stage svg .mechanical{fill:#d4dee5;stroke:#607b8c;stroke-width:.1}.stage svg .marker{fill:none;stroke:#1673a0;stroke-width:.22;stroke-dasharray:.55 .35;pointer-events:none}.stage svg text{font-family:"Segoe UI",Arial,sans-serif;fill:#173346;paint-order:stroke;stroke:#f4f8fb;stroke-width:.4px;stroke-linejoin:round;font-size:1.2px;pointer-events:none}.caption{min-height:65px;border-top:1px solid var(--line);padding:12px 16px;color:var(--muted);font-size:12px;background:white}.detail{padding:18px 18px 22px;border-left:1px solid var(--line);min-width:0}.detail .mpn{font-size:17px;font-weight:650;overflow-wrap:anywhere;margin-bottom:8px}.detail .field{font-size:12px;color:var(--muted);overflow-wrap:anywhere;margin-bottom:16px}.detail table{width:100%;border-collapse:collapse;font-size:13px}.detail th{text-align:left;color:var(--muted);font-size:12px;font-weight:500}.detail td,.detail th{padding:6px 3px;border-bottom:1px solid #e1e9ee}.detail td button{font-size:12px;padding:3px 6px;border-color:transparent;background:#edf3f6;overflow-wrap:anywhere;text-align:left}.detail td button.selected{background:var(--blue);color:white}.detail .sources{padding-left:18px;font-size:12px}.detail li{margin-bottom:9px}.detail li small{display:block;color:var(--muted)}.bottom{display:grid;grid-template-columns:1.3fr 1fr;gap:22px;margin-top:22px}.boundaries,.ledger{background:white;border:1px solid var(--line);border-radius:7px;padding:20px 22px}.boundaries p,.ledger p{font-size:13px;color:var(--muted);max-width:85ch}.boundary-list{padding-left:20px;font-size:13px}.boundary-list li{margin-bottom:8px}code{font-family:Consolas,monospace;font-size:.85em;overflow-wrap:anywhere}.fingerprint{display:block;margin-top:6px;color:var(--ink)}details summary{cursor:pointer;font-weight:600}.ledger dl{font-size:12px}.ledger dt{margin-top:12px;color:var(--muted)}.ledger dd{margin:4px 0 0}.download{display:inline-block;font-size:13px;padding:8px 0}.empty{padding:15px;color:var(--muted);font-size:13px}[hidden]{display:none!important}.footer{color:var(--muted);font-size:12px;margin-top:22px}.skip{position:absolute;left:-9999px}.skip:focus{left:15px;top:12px;background:white;padding:10px;z-index:4}.js-only{display:none}.enhanced .js-only{display:flex}noscript{display:block;padding:20px;border:1px solid var(--line);background:white}noscript img{max-width:100%} +@media(max-width:1250px){.workspace{grid-template-columns:220px minmax(0,1fr)}.detail{grid-column:1/-1;border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:22px}.detail h3{grid-column:1/-1}.stage{min-height:420px}.parts{max-height:500px}} +@media(max-width:750px){.shell{padding-top:20px}.mast{display:block}.notice{max-width:none;margin-bottom:20px}.workspace{grid-template-columns:1fr}.inventory{border-right:0;border-bottom:1px solid var(--line)}.parts{max-height:165px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.tools{padding:12px}.part{padding:8px}.part strong{width:33px}.part small{margin-left:33px}.detail{display:block}.detail table{margin-bottom:20px}.stage{min-height:310px;padding:10px}.stage svg{min-height:290px}.stage>img{max-height:450px}.viewbar select{margin-left:0;width:100%;max-width:none}.board-head{display:block}.result{display:block;margin-top:8px}.bottom{grid-template-columns:1fr}.boundaries,.ledger{padding:17px}nav{gap:6px}nav button{padding:9px 12px;font-size:13px}} +@media(prefers-reduced-motion:no-preference){button{transition:background .13s ease}} +''' + +JS = r''' +const data=JSON.parse(document.getElementById('explorer-data').textContent); +const $=id=>document.getElementById(id), ns='http://www.w3.org/2000/svg'; +let board=data.boards[0], selected=board.geometry.components.find(p=>p.reference==='U1')||board.geometry.components[0], view='model', net=''; +const titles={model:'Native 3D render',map:'Connectivity map',schematic:'Native schematic',top:'Native top copper',bottom:'Native bottom copper'}; +function el(tag,text,parent,attrs={}){const e=document.createElement(tag);if(text!==null)e.textContent=text;for(const[k,v]of Object.entries(attrs))e.setAttribute(k,v);if(parent)parent.append(e);return e;} +function svg(tag,attrs,parent){const e=document.createElementNS(ns,tag);for(const[k,v]of Object.entries(attrs))e.setAttribute(k,v);parent.append(e);return e;} +function match(p,q){return [p.reference,p.value,p.mpn,p.footprint,...p.pads.flatMap(x=>[x.number,x.net])].join(' ').toLowerCase().includes(q);} +function parts(){const q=$('search').value.toLowerCase().trim(), list=$('parts');list.replaceChildren();let n=0;for(const p of board.geometry.components){if(!match(p,q))continue;n++;const b=el('button',null,list,{'class':'part','aria-pressed':String(p===selected)});el('strong',p.reference,b);el('span',p.value,b);el('small',p.mpn||'Fabricated mechanical feature',b);b.addEventListener('click',()=>{selected=p;parts();detail();stage();});}if(!n)el('p','No components match. Try a reference, MPN, pin or net.',list,{'class':'empty'});$('part-count').textContent=`${n} of ${board.geometry.components.length} physical footprints`;} +function chooseNet(value){net=value;$('net').value=value;if(value)view='map';buttons();detail();stage();} +function detail(){const host=$('detail');host.replaceChildren();el('h3',`${selected.reference} / ${selected.value}`,host);const identity=el('div',null,host);el('p',selected.mpn||'Fabricated mechanical feature',identity,{'class':'mpn'});el('p',selected.footprint,identity,{'class':'field'});const position=selected.position.map(n=>n.toFixed(3)).join(', ');el('p',`Native footprint origin: ${position} mm. Positions are inspection aids, not a mechanical drawing.`,identity,{'class':'field'}); + const pinbox=el('div',null,host),t=el('table',null,pinbox),head=el('tr',null,el('thead',null,t));el('th','Pin / pad',head);el('th','Saved net',head);const body=el('tbody',null,t), seen=new Set();for(const pad of selected.pads){const key=pad.number+'\0'+pad.net;if(seen.has(key))continue;seen.add(key);const row=el('tr',null,body);el('td',pad.number||'Hole',row);const cell=el('td',null,row);if(pad.net){const b=el('button',pad.net,cell,{'class':pad.net===net?'selected':''});b.addEventListener('click',()=>chooseNet(pad.net));}else el('span','No net',cell);} + const sources=el('div',null,host);el('h3','Archived source evidence',sources);const list=el('ul',null,sources,{'class':'sources'});for(const source of selected.sources){const li=el('li',null,list);if(source.url){el('a',source.title,li,{href:source.url,target:'_blank',rel:'noopener noreferrer'});}else el('span',source.title,li);el('small',[source.manufacturer,source.revision].filter(Boolean).join(' / '),li);el('small',`Archived ${source.retrieved_on}`,li);}if(!selected.sources.length)el('li','No purchased-part source is assigned to this mechanical feature.',list);} +function buttons(){for(const button of document.querySelectorAll('[data-view]'))button.setAttribute('aria-pressed',String(button.dataset.view===view));} +function map(){const host=$('stage'),[x,y,w,h]=board.geometry.bounds,root=svg('svg',{viewBox:`${x-3} ${y-3} ${w+6} ${h+6}`,role:'group','aria-label':`Native PCB connectivity map${net?' highlighting '+net:''}`},host);svg('rect',{x,y,width:w,height:h,rx:'.25',fill:'#f7fafb',stroke:'#6d899b','stroke-width':'.16'},root); + const color=n=>n==='GND'?'#516f89':n===net?'#b86c08':'#a2603b';for(const track of board.geometry.tracks){const hit=net&&track.net===net;svg('line',{x1:track.start[0],y1:track.start[1],x2:track.end[0],y2:track.end[1],stroke:track.side==='bottom'?'#5684aa':color(track.net),'stroke-width':track.width,'stroke-linecap':'round','stroke-dasharray':track.side==='bottom'?'.8 .5':'none','class':'route'+(net?(hit?' hit':' dim'):'')},root);} + for(const via of board.geometry.vias){svg('circle',{cx:via.position[0],cy:via.position[1],r:via.width/2,fill:color(via.net),stroke:'#f7fafb','stroke-width':'.12','class':net?(via.net===net?'hit':'dim'):''},root);} + for(const p of board.geometry.components){for(const pad of p.pads){const[xp,yp]=pad.position,[pw,ph]=pad.size;const marker=svg('ellipse',{cx:xp,cy:yp,rx:pw/2,ry:ph/2,transform:`rotate(${-pad.angle} ${xp} ${yp})`,fill:pad.net?color(pad.net):'#9cacb6',tabindex:'0',role:'button','aria-label':`${p.reference} pad ${pad.number||'hole'} ${pad.net||'no net'}`,'class':'pad'+(net?(pad.net===net?' hit':' dim'):'')},root);svg('title',{},marker).textContent=`${p.reference}.${pad.number||'hole'} ${pad.net||'no net'}`;const activate=()=>{selected=p;parts();chooseNet(pad.net);};marker.addEventListener('click',activate);marker.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();activate();}});if(pad.drill[0])svg('ellipse',{cx:xp,cy:yp,rx:pad.drill[0]/2,ry:pad.drill[1]/2,fill:'#f7fafb','pointer-events':'none',transform:`rotate(${-pad.angle} ${xp} ${yp})`},root);} + if(p===selected&&p.pads.length){const xs=p.pads.flatMap(q=>[q.position[0]-q.size[0]/2,q.position[0]+q.size[0]/2]),ys=p.pads.flatMap(q=>[q.position[1]-q.size[1]/2,q.position[1]+q.size[1]/2]);svg('rect',{x:Math.min(...xs)-.6,y:Math.min(...ys)-.6,width:Math.max(...xs)-Math.min(...xs)+1.2,height:Math.max(...ys)-Math.min(...ys)+1.2,rx:'.3','class':'marker'},root);svg('text',{x:Math.min(...xs)-.4,y:Math.min(...ys)-1},root).textContent=p.reference;}} +} +function stage(){const host=$('stage');host.replaceChildren();if(view==='map')map();else el('img',null,host,{src:board.images[view].uri,alt:`${board.title}: ${titles[view]}`,'class':view==='model'?'model':''});const contacts=net?board.geometry.components.flatMap(p=>p.pads.filter(q=>q.net===net).map(q=>`${p.reference}.${q.number}`)):[];$('caption').textContent=view==='map'?`${net?net+' connects '+contacts.join(', ')+'. ':''}Native pad centers and straight tracks; dashed lines are bottom-layer routes. Filled zones, arcs and exact pad outlines are omitted. Use the native copper views for complete geometry.`:board.images[view].caption;$('live').textContent=`${board.title}. ${titles[view]}.${net?' Selected net '+net+'.':''}`;} +function selectBoard(value){board=data.boards.find(b=>b.id===value);selected=board.geometry.components.find(p=>p.reference==='U1')||board.geometry.components.find(p=>p.reference==='J1')||board.geometry.components[0];net='';$('search').value='';$('title').textContent=board.title;$('subtitle').textContent=board.subtitle;$('result').textContent=`Recorded ERC ${board.erc} / DRC ${board.drc} / unconnected ${board.unconnected}`;for(const b of document.querySelectorAll('[data-board]'))b.setAttribute('aria-pressed',String(b.dataset.board===value));const select=$('net');select.replaceChildren();el('option','Highlight a net',select,{value:''});for(const n of [...new Set(board.geometry.components.flatMap(p=>p.pads.map(q=>q.net).filter(Boolean)))].sort())el('option',n,select,{value:n});$('boundaries').replaceChildren();for(const item of board.boundaries)el('li',item,$('boundaries'));$('pcb-sha').textContent=board.pcb_sha256;$('source-count').textContent=`${Object.keys(board.source_inputs).length} declared source identities. ${board.geometry.components.length} native footprints. KiCad ${board.geometry.kicad_version}.`;$('schematic-pdf').href=board.pdf;$('schematic-pdf').download=board.id+'-schematic.pdf';$('review-link').href=board.review_url;$('source-ledger').replaceChildren();for(const[name,hash]of Object.entries(board.source_inputs)){el('dt',name,$('source-ledger'));el('dd',hash||'Absent input', $('source-ledger'));}buttons();parts();detail();stage();} +for(const b of data.boards){const button=el('button',b.title,$('boards'),{'data-board':b.id,'aria-pressed':'false'});button.addEventListener('click',()=>selectBoard(b.id));}for(const b of document.querySelectorAll('[data-view]'))b.addEventListener('click',()=>{view=b.dataset.view;buttons();stage();});$('search').addEventListener('input',parts);$('net').addEventListener('change',e=>chooseNet(e.target.value));$('clear').addEventListener('click',()=>chooseNet(''));document.documentElement.classList.add('enhanced');selectBoard(board.id); +''' + + +def render_explorer(data: dict) -> bytes: + encoded = json.dumps(data, ensure_ascii=False, separators=(',', ':')).replace('<', '\\u003c') + encoded = encoded.replace('\u2028', '\\u2028').replace('\u2029', '\\u2029') + script_hash = base64.b64encode(hashlib.sha256(JS.encode()).digest()).decode() + first = data['boards'][0] + fallback = ''.join(f'
    {html.escape(b["title"])}' + f'

    {html.escape(b["subtitle"])}

    Native schematic
    ' for b in data['boards']) + source = f''' + + +PCB Copilot / Follow a signal +
    +
    PCB Copilot / Example workbench

    Follow a signal.

    +

    Real KiCad boards. Pick a component, trace its saved nets, inspect the native views, and open its manufacturer evidence.

    +

    Unbuilt prototypes. Native checks and byte verification have a limited scope. Physical fit, circuit behavior, assembly and human release decisions remain open.

    + +
    +

    {html.escape(first['title'])}

    {html.escape(first['subtitle'])}

    +
    +
    +
    +

    Check the engineering boundary

      Download native vector schematic
      Read the complete recorded review
      +

      Bound to saved sources

      Native PCB SHA-256

      Inspect the complete input ledger
      +

      +
      ''' + return source.encode() diff --git a/tools/explorer_native.py b/tools/explorer_native.py new file mode 100644 index 0000000..ff98e18 --- /dev/null +++ b/tools/explorer_native.py @@ -0,0 +1,60 @@ +"""Read-only KiCad-Python extraction for the example explorer. + +The connectivity map deliberately omits filled zones, arcs and custom pads. +Native copper images remain the complete geometric inspection surface. +""" + +from __future__ import annotations + +import json +import sys + +import pcbnew + + +def mm(value): + return round(pcbnew.ToMM(value), 6) + + +def point(value): + return [mm(value.x), mm(value.y)] + + +def extract(path): + board = pcbnew.LoadBoard(path) + box = board.GetBoardEdgesBoundingBox() + parts = [] + for footprint in board.GetFootprints(): + pads = [] + for pad in footprint.Pads(): + drill = pad.GetDrillSize() + pads.append({'number': str(pad.GetNumber()), 'net': str(pad.GetNetname()).lstrip('/'), + 'position': point(pad.GetPosition()), 'size': point(pad.GetSize()), + 'drill': point(drill), 'angle': pad.GetOrientationDegrees(), + 'shape': str(pad.GetShape()), + 'layers': [name for layer, name in ((pcbnew.F_Cu, 'top'), (pcbnew.B_Cu, 'bottom')) + if pad.IsOnLayer(layer)]}) + parts.append({'reference': footprint.GetReference(), 'value': footprint.GetValue(), + 'footprint': str(footprint.GetFPID().GetLibItemName()), + 'position': point(footprint.GetPosition()), 'pads': pads}) + tracks, vias, omitted_arcs = [], [], 0 + for track in board.GetTracks(): + if isinstance(track, pcbnew.PCB_VIA): + vias.append({'position': point(track.GetPosition()), 'width': mm(track.GetWidth(pcbnew.F_Cu)), + 'drill': mm(track.GetDrillValue()), 'net': str(track.GetNetname()).lstrip('/')}) + elif isinstance(track, pcbnew.PCB_ARC): + omitted_arcs += 1 + else: + tracks.append({'start': point(track.GetStart()), 'end': point(track.GetEnd()), + 'width': mm(track.GetWidth()), 'net': str(track.GetNetname()).lstrip('/'), + 'side': 'top' if track.GetLayer() == pcbnew.F_Cu else 'bottom'}) + return {'kicad_version': pcbnew.GetBuildVersion(), + 'bounds': [mm(box.GetX()), mm(box.GetY()), mm(box.GetWidth()), mm(box.GetHeight())], + 'components': sorted(parts, key=lambda item: item['reference']), + 'tracks': tracks, 'vias': vias, 'omitted_arcs': omitted_arcs, + 'scope': 'Native pad centers and straight tracks; zones, arcs and exact custom-pad shapes omitted. ' + 'Not a clearance, current-capacity or mechanical inspection.'} + + +if __name__ == '__main__': + print(json.dumps(extract(sys.argv[1])))