lockwire 0.5.1__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lockwire-0.5.4/PKG-INFO +202 -0
- lockwire-0.5.4/README.md +161 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/pyproject.toml +17 -19
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/__init__.py +11 -6
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/__main__.py +1 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/advice.py +6 -6
- lockwire-0.5.4/src/lockwire/agent_setup.py +363 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/api.py +224 -89
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/api_payload.py +220 -59
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/bench.py +10 -10
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/blame.py +53 -6
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/catalog.py +81 -15
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/catalog_robots.yaml +59 -59
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/catalog_seed.yaml +117 -56
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/check_sim.py +84 -12
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/checks.py +1357 -286
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/cli.py +993 -361
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/cli_line.py +10 -5
- lockwire-0.5.4/src/lockwire/confine.py +72 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/controls.py +1 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/copy.py +157 -18
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/describe.py +93 -68
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/edit.py +793 -133
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/emit_ts.py +13 -14
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/NOTICE +4 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/contract.yaml +29 -3
- lockwire-0.5.4/src/lockwire/examples/arm/so101_new_calib.urdf +453 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm-power/contract.yaml +7 -5
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/drone/contract.yaml +13 -13
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/humanoid/NOTICE +11 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/humanoid/contract.yaml +2 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/quadruped/NOTICE +7 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/quadruped/contract.yaml +30 -3
- lockwire-0.5.4/src/lockwire/examples/quadruped/leg.xacro +392 -0
- lockwire-0.5.4/src/lockwire/examples/quadruped/solo12.urdf.xacro +101 -0
- lockwire-0.5.4/src/lockwire/examples/rover/LICENSE +203 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover/NOTICE +5 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover/contract.yaml +13 -3
- lockwire-0.5.4/src/lockwire/examples/rover/turtlebot3_burger.urdf +199 -0
- lockwire-0.5.4/src/lockwire/explain.py +111 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/export_mhs.py +5 -5
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/export_model.py +39 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/factdiff.py +12 -7
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/fieldpath.py +2 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/findings_export.py +6 -6
- lockwire-0.5.4/src/lockwire/fixes.py +708 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/forces.py +56 -20
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/gitref.py +14 -4
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/hook_check.py +10 -3
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/hw.py +9 -9
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/material_compare.py +4 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/mcp_server.py +156 -99
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/mechanism.py +11 -11
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/mesh_dae.py +2 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/mesh_simple.py +3 -3
- lockwire-0.5.4/src/lockwire/missing.py +394 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/mjcf.py +30 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/motor_card.py +3 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/page.py +252 -118
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/parts_list.py +33 -4
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/esp32-devkitc-wroom-32.yaml +7 -7
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/plan.py +47 -34
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/plan_payload.py +17 -5
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/presets.py +1 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/report.py +399 -128
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/report_html.py +357 -72
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/report_json.py +23 -10
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/review_draft.py +1 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/scan.py +2 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/scene.py +17 -6
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/scene_import.py +11 -10
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/scene_urdf.py +123 -22
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/scene_view.py +16 -14
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/schema.py +314 -80
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/sdf.py +112 -15
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/serve.py +405 -53
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/servo_bus.py +11 -1
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/slicer.py +1 -1
- lockwire-0.5.4/src/lockwire/standing.py +653 -0
- lockwire-0.5.4/src/lockwire/start_operation.py +998 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/statics.py +204 -37
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/swap.py +202 -38
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/thrust.py +2 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/thrust_tables.yaml +41 -4
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/units.py +2 -2
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/urdf.py +108 -17
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/variants.py +2 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/vcs.py +108 -48
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/whatif.py +3 -2
- lockwire-0.5.4/src/lockwire/whatif_table.py +173 -0
- lockwire-0.5.1/PKG-INFO +0 -179
- lockwire-0.5.1/README.md +0 -139
- lockwire-0.5.1/src/lockwire/agent_setup.py +0 -133
- lockwire-0.5.1/src/lockwire/confine.py +0 -31
- lockwire-0.5.1/src/lockwire/start_operation.py +0 -503
- {lockwire-0.5.1 → lockwire-0.5.4}/LICENSE +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/NOTICE +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/_filelock.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/battery.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/constraints.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/drift.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/LICENSE +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/scene.glb +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm-power/README.md +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm-power/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/arm-power/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/drone/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/drone/scene.glb +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/drone/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/hexapod-param/contract.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/hexapod-param/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/humanoid/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/humanoid/scene.glb +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/humanoid/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/quadruped/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/quadruped/scene.glb +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/quadruped/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover/plan.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover/scene.glb +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover-param/contract.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/rover-param/starter.json +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/examples/servo-bench.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/harness.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/kicad.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/meshread.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/arduino-nano.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/arduino-uno-r3.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/basicmicro-roboclaw-2x15a.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/holybro-pixhawk-6c.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/nvidia-jetson-orin-nano-devkit.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/pololu-tb6612fng-carrier.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/raspberry-pi-4b.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/raspberry-pi-5.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-opencr-1-0.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-u2d2-power-hub.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-u2d2.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pinouts/waveshare-bus-servo-adapter-a.yaml +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/pins.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/plugins.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/power_budget.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/relevance.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/sensitivity.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/servo_bus_dxl.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/stress.py +0 -0
- {lockwire-0.5.1 → lockwire-0.5.4}/src/lockwire/webots.py +0 -0
lockwire-0.5.4/PKG-INFO
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lockwire
|
|
3
|
+
Version: 0.5.4
|
|
4
|
+
Summary: The physical-assumption contract for robots: checks that a robot's declared parts (power, weight, bus, torque) add up
|
|
5
|
+
Keywords: robotics,urdf,ros,preflight,lockfile,ci,hardware,drone
|
|
6
|
+
Author: Shivansh
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Manufacturing
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Requires-Dist: numpy>=2.4.6
|
|
19
|
+
Requires-Dist: pydantic>=2.13.4,<3
|
|
20
|
+
Requires-Dist: rich>=15.0.0
|
|
21
|
+
Requires-Dist: ruamel-yaml>=0.19.1,<0.20
|
|
22
|
+
Requires-Dist: typer>=0.26.8,<0.29
|
|
23
|
+
Requires-Dist: xacro>=2.1.1
|
|
24
|
+
Requires-Dist: pyserial>=3.5 ; extra == 'bus'
|
|
25
|
+
Requires-Dist: mcp>=2.2.0,<3 ; extra == 'mcp'
|
|
26
|
+
Requires-Dist: pyjwt>=2.15 ; extra == 'mcp'
|
|
27
|
+
Requires-Dist: robot-descriptions>=3.3.0,<4 ; extra == 'robots'
|
|
28
|
+
Requires-Dist: xacrodoc>=2.0.1 ; extra == 'robots'
|
|
29
|
+
Requires-Dist: fastapi>=0.141.1 ; extra == 'serve'
|
|
30
|
+
Requires-Dist: uvicorn>=0.52.4 ; extra == 'serve'
|
|
31
|
+
Requires-Python: >=3.12
|
|
32
|
+
Project-URL: Homepage, https://github.com/Shivansh2703/lockwire
|
|
33
|
+
Project-URL: Repository, https://github.com/Shivansh2703/lockwire
|
|
34
|
+
Project-URL: Issues, https://github.com/Shivansh2703/lockwire/issues
|
|
35
|
+
Project-URL: Changelog, https://github.com/Shivansh2703/lockwire/blob/main/CHANGELOG.md
|
|
36
|
+
Provides-Extra: bus
|
|
37
|
+
Provides-Extra: mcp
|
|
38
|
+
Provides-Extra: robots
|
|
39
|
+
Provides-Extra: serve
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<picture>
|
|
44
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/logo-dark.svg">
|
|
45
|
+
<img src="https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/logo-light.svg" alt="lockwire" height="64">
|
|
46
|
+
</picture>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
**I checked the published robot models of nearly 400 companies. 1 in 3 disagreed with the maker's own specs.** Every one of them still loads, and everyone assumes it is accurate. Lockwire catches the error in your robot model before the real robot does.
|
|
50
|
+
|
|
51
|
+
https://github.com/user-attachments/assets/f14dd218-d5a4-4e9e-b3cc-fa2e6537e0de
|
|
52
|
+
|
|
53
|
+
Free and open source. [Read the launch post](https://github.com/Shivansh2703/lockwire/discussions/1).
|
|
54
|
+
|
|
55
|
+
## Check your robot
|
|
56
|
+
|
|
57
|
+
Needs Python 3.12 or newer and [uv](https://docs.astral.sh/uv/). Point it at your own URDF, xacro or
|
|
58
|
+
SDF (nothing is written):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uvx lockwire check robot.urdf
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
No robot file yet? This writes a small example arm, with its power and wiring, into the current folder
|
|
65
|
+
(two files, `lockwire.yaml` and `lockwire.plan.yaml`) and checks it:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uvx lockwire start --example arm-power
|
|
69
|
+
uvx lockwire check
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```console
|
|
73
|
+
VIOLATION topology/rails/rail.5v/brownout: observed rail.5v sags to 4.65 V with every servo stalled (2.73 A), expected >=
|
|
74
|
+
4.75 V, the declared minimum input of dev.jetson
|
|
75
|
+
action: shorten or thicken the wire, cut the pack resistance, or move the
|
|
76
|
+
servos to their own rail
|
|
77
|
+
VIOLATION topology/wires/w.pack/fuse: observed 9.00 A fuse on 22 AWG wire w.pack, expected fuse <= 7.00 A, the
|
|
78
|
+
safe current for this wire
|
|
79
|
+
...
|
|
80
|
+
action: fit a fuse at or below 7.00 A or upsize wire 'w.pack'
|
|
81
|
+
scored 12: 10 add up, 0 do not, 1 warn, 1 model check (links and joints unchanged
|
|
82
|
+
since the lock) · 1 not scored · 2 other violation(s) · 1 other warning(s)
|
|
83
|
+
|
|
84
|
+
NO-GO: 2 violation(s), 2 warning(s)
|
|
85
|
+
...
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Command line: macOS, Linux and Windows. Desktop app: macOS (Apple silicon) and Linux.
|
|
89
|
+
|
|
90
|
+
`check` exits 1 on a NO-GO. Two real errors in a robot you have not built yet: with both servos stalled
|
|
91
|
+
the 5 V rail sags below the Jetson's minimum input and resets it, and a 9 A fuse sits on wire rated
|
|
92
|
+
for 7 A. Each finding names the part and where its limit came from, and says what to change
|
|
93
|
+
(`uvx lockwire check --all` also shows the two warnings: a servo data wire on a boot pin, and a 28 AWG
|
|
94
|
+
servo feed drawing about 5 A). The scored line counts the comparisons that add up and names
|
|
95
|
+
the findings outside them. Lockwire found these without being told. Errors like this are in public
|
|
96
|
+
robot models today, and maintainers at Seeed and DFKI (MiR100) have merged the fixes:
|
|
97
|
+
[the fixes sent upstream](https://github.com/Shivansh2703/lockwire/blob/main/docs/ledger.md).
|
|
98
|
+
|
|
99
|
+
## Lock it
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
uvx lockwire start robot.urdf
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
This writes `lockwire.yaml`, the robot's physics lockfile: every link's mass, centre of mass and
|
|
106
|
+
inertia, every joint limit, and a hash of the model's structure. Commit it next to your model.
|
|
107
|
+
From now on `uvx lockwire check` checks the lockfile, and a mass or joint limit edited in the
|
|
108
|
+
model without re-locking is a NO-GO that names the value. Keep the model file beside the lockfile:
|
|
109
|
+
without it `check` gives no verdict. To re-lock after a change you meant to make, run
|
|
110
|
+
`uvx lockwire start robot.urdf --force`; it keeps what you declared, and `--force --fresh` starts over.
|
|
111
|
+
|
|
112
|
+
## Run it in CI
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uvx lockwire agent-setup --ci
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
That writes `.github/workflows/lockwire.yml`. The step it writes, plus two optional inputs:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
- uses: actions/checkout@v4
|
|
122
|
+
- uses: Shivansh2703/lockwire@v0
|
|
123
|
+
with:
|
|
124
|
+
contract: lockwire.yaml # the lockfile
|
|
125
|
+
# model: robot.urdf # or check a model directly, with no lockfile
|
|
126
|
+
# adopt: "true" # annotate and report, but never fail the job
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
A NO-GO fails the build, with annotations on the pull request and an HTML report.
|
|
130
|
+
Every input, pre-commit and other CI systems: [docs/guides/ci.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/ci.md).
|
|
131
|
+
|
|
132
|
+
## Let your AI agent check it
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
claude mcp add lockwire -- uvx --from "lockwire[mcp]" lockwire mcp
|
|
136
|
+
uvx lockwire agent-setup
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The first line gives Claude Code the checks over MCP. `agent-setup` writes the agent rules into
|
|
140
|
+
AGENTS.md and the Claude Code one, plus a pre-commit config and the CI workflow. In a git repository, run `pre-commit install` once so
|
|
141
|
+
the hook runs on every commit.
|
|
142
|
+
Cursor and other agents: [docs/guides/agents.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/agents.md).
|
|
143
|
+
|
|
144
|
+
## No robot file? Try an example
|
|
145
|
+
|
|
146
|
+
servo-bench is built to fail: a 5 V rail overloaded and a wrist servo too weak, on purpose, so you can see what a catch looks like.
|
|
147
|
+
|
|
148
|
+
```console
|
|
149
|
+
$ uvx lockwire start --example servo-bench
|
|
150
|
+
wrote lockwire.yaml: example servo-bench (built to fail: a 5 V rail overloaded and a wrist servo too weak, on purpose, so you can see what a catch looks like). Next: uvx lockwire check lockwire.yaml. Parts: uvx lockwire catalog parts
|
|
151
|
+
$ uvx lockwire check
|
|
152
|
+
VIOLATION model/joints/wrist/limits/effort: observed 0.40 N*m joint effort limit, expected <= 0.226 N*m, the feetech.scs0009
|
|
153
|
+
stall torque (1.8 times that)
|
|
154
|
+
...
|
|
155
|
+
action: ... or find a stronger servo: uvx lockwire swap lockwire.yaml wrist
|
|
156
|
+
VIOLATION budgets/bud.power.servo-5v: observed 32.10 W, expected <= 15.00 W (off by +17.10 W, +114%)
|
|
157
|
+
...
|
|
158
|
+
scored 9: 7 add up, 2 do not · 2 not scored
|
|
159
|
+
|
|
160
|
+
NO-GO: 2 violation(s), 0 warning(s)
|
|
161
|
+
...
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The examples that pass the check (`lockwire start --example drone`, `rover`, `arm`, `quadruped`, `humanoid`,
|
|
165
|
+
`hexapod-param`, `rover-param`) are good starting points; `arm-power` and `servo-bench` show a catch, and so will your own robot.
|
|
166
|
+
|
|
167
|
+
## Features
|
|
168
|
+
|
|
169
|
+
- **Check:** every mass, inertia, joint limit, torque and power number against the maker's datasheet and physics, in seconds, with the page it compared against and a fix for each finding.
|
|
170
|
+
- **Budgets:** power, torque and bus budgets, brown-out on every rail, and a standing-load check for legged robots.
|
|
171
|
+
- **What-if and part swap:** see the verdict before you change a part, or find a stronger servo in the parts catalog.
|
|
172
|
+
- **Lockfile and CI:** `lockwire.yaml` pins every checked number; CI fails the build on drift, naming the number that moved, with pull-request annotations and an HTML report.
|
|
173
|
+
- **Sim drift:** `check-sim` catches a sim file that has drifted from the lock.
|
|
174
|
+
- **Reports:** a PDF or HTML report to share, with no machine paths in it.
|
|
175
|
+
- **AI:** the app's assistant explains each finding and suggests a fix the checker proves on a copy first; coding agents run the same check over MCP.
|
|
176
|
+
|
|
177
|
+
<img src="https://github.com/user-attachments/assets/5fc9697c-02ee-4fc8-a19b-791e1d2c0379" alt="Sixteen robots checked by Lockwire: the nine built-in examples and seven open-source research models">
|
|
178
|
+
|
|
179
|
+
More in [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
|
|
180
|
+
preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
|
|
181
|
+
|
|
182
|
+
## Download the app
|
|
183
|
+
|
|
184
|
+
The free desktop app does the same visually: [latest release](https://github.com/Shivansh2703/lockwire/releases/latest).
|
|
185
|
+
|
|
186
|
+

|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+
The nine example robots that come with the app, each on its Check screen. Two are built to fail on purpose so you can see a catch: the desk arm and the servo bench, both NO-GO. The quadruped and the rover pass with notes, and the other five pass clean. Open any of them from the start screen, no robot file needed.
|
|
191
|
+
|
|
192
|
+
- **macOS (Apple silicon):** unzip, open Lockwire. The app is not notarized, so the first open warns: open System Settings, Privacy & Security, and click "Open Anyway".
|
|
193
|
+
- **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
|
|
194
|
+
- **Windows:** coming soon.
|
|
195
|
+
|
|
196
|
+
Want it installed instead of run through uvx? `pip install lockwire`, then drop the `uvx`.
|
|
197
|
+
|
|
198
|
+
## Development and licence
|
|
199
|
+
|
|
200
|
+
See [CONTRIBUTING.md](https://github.com/Shivansh2703/lockwire/blob/main/CONTRIBUTING.md). Apache-2.0, all of it: see [LICENSE](https://github.com/Shivansh2703/lockwire/blob/main/LICENSE).
|
|
201
|
+
|
|
202
|
+
<!-- mcp-name: io.github.lockwirerobotics/lockwire -->
|
lockwire-0.5.4/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/logo-dark.svg">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/logo-light.svg" alt="lockwire" height="64">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
**I checked the published robot models of nearly 400 companies. 1 in 3 disagreed with the maker's own specs.** Every one of them still loads, and everyone assumes it is accurate. Lockwire catches the error in your robot model before the real robot does.
|
|
9
|
+
|
|
10
|
+
https://github.com/user-attachments/assets/f14dd218-d5a4-4e9e-b3cc-fa2e6537e0de
|
|
11
|
+
|
|
12
|
+
Free and open source. [Read the launch post](https://github.com/Shivansh2703/lockwire/discussions/1).
|
|
13
|
+
|
|
14
|
+
## Check your robot
|
|
15
|
+
|
|
16
|
+
Needs Python 3.12 or newer and [uv](https://docs.astral.sh/uv/). Point it at your own URDF, xacro or
|
|
17
|
+
SDF (nothing is written):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uvx lockwire check robot.urdf
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
No robot file yet? This writes a small example arm, with its power and wiring, into the current folder
|
|
24
|
+
(two files, `lockwire.yaml` and `lockwire.plan.yaml`) and checks it:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uvx lockwire start --example arm-power
|
|
28
|
+
uvx lockwire check
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```console
|
|
32
|
+
VIOLATION topology/rails/rail.5v/brownout: observed rail.5v sags to 4.65 V with every servo stalled (2.73 A), expected >=
|
|
33
|
+
4.75 V, the declared minimum input of dev.jetson
|
|
34
|
+
action: shorten or thicken the wire, cut the pack resistance, or move the
|
|
35
|
+
servos to their own rail
|
|
36
|
+
VIOLATION topology/wires/w.pack/fuse: observed 9.00 A fuse on 22 AWG wire w.pack, expected fuse <= 7.00 A, the
|
|
37
|
+
safe current for this wire
|
|
38
|
+
...
|
|
39
|
+
action: fit a fuse at or below 7.00 A or upsize wire 'w.pack'
|
|
40
|
+
scored 12: 10 add up, 0 do not, 1 warn, 1 model check (links and joints unchanged
|
|
41
|
+
since the lock) · 1 not scored · 2 other violation(s) · 1 other warning(s)
|
|
42
|
+
|
|
43
|
+
NO-GO: 2 violation(s), 2 warning(s)
|
|
44
|
+
...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Command line: macOS, Linux and Windows. Desktop app: macOS (Apple silicon) and Linux.
|
|
48
|
+
|
|
49
|
+
`check` exits 1 on a NO-GO. Two real errors in a robot you have not built yet: with both servos stalled
|
|
50
|
+
the 5 V rail sags below the Jetson's minimum input and resets it, and a 9 A fuse sits on wire rated
|
|
51
|
+
for 7 A. Each finding names the part and where its limit came from, and says what to change
|
|
52
|
+
(`uvx lockwire check --all` also shows the two warnings: a servo data wire on a boot pin, and a 28 AWG
|
|
53
|
+
servo feed drawing about 5 A). The scored line counts the comparisons that add up and names
|
|
54
|
+
the findings outside them. Lockwire found these without being told. Errors like this are in public
|
|
55
|
+
robot models today, and maintainers at Seeed and DFKI (MiR100) have merged the fixes:
|
|
56
|
+
[the fixes sent upstream](https://github.com/Shivansh2703/lockwire/blob/main/docs/ledger.md).
|
|
57
|
+
|
|
58
|
+
## Lock it
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uvx lockwire start robot.urdf
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This writes `lockwire.yaml`, the robot's physics lockfile: every link's mass, centre of mass and
|
|
65
|
+
inertia, every joint limit, and a hash of the model's structure. Commit it next to your model.
|
|
66
|
+
From now on `uvx lockwire check` checks the lockfile, and a mass or joint limit edited in the
|
|
67
|
+
model without re-locking is a NO-GO that names the value. Keep the model file beside the lockfile:
|
|
68
|
+
without it `check` gives no verdict. To re-lock after a change you meant to make, run
|
|
69
|
+
`uvx lockwire start robot.urdf --force`; it keeps what you declared, and `--force --fresh` starts over.
|
|
70
|
+
|
|
71
|
+
## Run it in CI
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uvx lockwire agent-setup --ci
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
That writes `.github/workflows/lockwire.yml`. The step it writes, plus two optional inputs:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
- uses: actions/checkout@v4
|
|
81
|
+
- uses: Shivansh2703/lockwire@v0
|
|
82
|
+
with:
|
|
83
|
+
contract: lockwire.yaml # the lockfile
|
|
84
|
+
# model: robot.urdf # or check a model directly, with no lockfile
|
|
85
|
+
# adopt: "true" # annotate and report, but never fail the job
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
A NO-GO fails the build, with annotations on the pull request and an HTML report.
|
|
89
|
+
Every input, pre-commit and other CI systems: [docs/guides/ci.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/ci.md).
|
|
90
|
+
|
|
91
|
+
## Let your AI agent check it
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
claude mcp add lockwire -- uvx --from "lockwire[mcp]" lockwire mcp
|
|
95
|
+
uvx lockwire agent-setup
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The first line gives Claude Code the checks over MCP. `agent-setup` writes the agent rules into
|
|
99
|
+
AGENTS.md and the Claude Code one, plus a pre-commit config and the CI workflow. In a git repository, run `pre-commit install` once so
|
|
100
|
+
the hook runs on every commit.
|
|
101
|
+
Cursor and other agents: [docs/guides/agents.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/agents.md).
|
|
102
|
+
|
|
103
|
+
## No robot file? Try an example
|
|
104
|
+
|
|
105
|
+
servo-bench is built to fail: a 5 V rail overloaded and a wrist servo too weak, on purpose, so you can see what a catch looks like.
|
|
106
|
+
|
|
107
|
+
```console
|
|
108
|
+
$ uvx lockwire start --example servo-bench
|
|
109
|
+
wrote lockwire.yaml: example servo-bench (built to fail: a 5 V rail overloaded and a wrist servo too weak, on purpose, so you can see what a catch looks like). Next: uvx lockwire check lockwire.yaml. Parts: uvx lockwire catalog parts
|
|
110
|
+
$ uvx lockwire check
|
|
111
|
+
VIOLATION model/joints/wrist/limits/effort: observed 0.40 N*m joint effort limit, expected <= 0.226 N*m, the feetech.scs0009
|
|
112
|
+
stall torque (1.8 times that)
|
|
113
|
+
...
|
|
114
|
+
action: ... or find a stronger servo: uvx lockwire swap lockwire.yaml wrist
|
|
115
|
+
VIOLATION budgets/bud.power.servo-5v: observed 32.10 W, expected <= 15.00 W (off by +17.10 W, +114%)
|
|
116
|
+
...
|
|
117
|
+
scored 9: 7 add up, 2 do not · 2 not scored
|
|
118
|
+
|
|
119
|
+
NO-GO: 2 violation(s), 0 warning(s)
|
|
120
|
+
...
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The examples that pass the check (`lockwire start --example drone`, `rover`, `arm`, `quadruped`, `humanoid`,
|
|
124
|
+
`hexapod-param`, `rover-param`) are good starting points; `arm-power` and `servo-bench` show a catch, and so will your own robot.
|
|
125
|
+
|
|
126
|
+
## Features
|
|
127
|
+
|
|
128
|
+
- **Check:** every mass, inertia, joint limit, torque and power number against the maker's datasheet and physics, in seconds, with the page it compared against and a fix for each finding.
|
|
129
|
+
- **Budgets:** power, torque and bus budgets, brown-out on every rail, and a standing-load check for legged robots.
|
|
130
|
+
- **What-if and part swap:** see the verdict before you change a part, or find a stronger servo in the parts catalog.
|
|
131
|
+
- **Lockfile and CI:** `lockwire.yaml` pins every checked number; CI fails the build on drift, naming the number that moved, with pull-request annotations and an HTML report.
|
|
132
|
+
- **Sim drift:** `check-sim` catches a sim file that has drifted from the lock.
|
|
133
|
+
- **Reports:** a PDF or HTML report to share, with no machine paths in it.
|
|
134
|
+
- **AI:** the app's assistant explains each finding and suggests a fix the checker proves on a copy first; coding agents run the same check over MCP.
|
|
135
|
+
|
|
136
|
+
<img src="https://github.com/user-attachments/assets/5fc9697c-02ee-4fc8-a19b-791e1d2c0379" alt="Sixteen robots checked by Lockwire: the nine built-in examples and seven open-source research models">
|
|
137
|
+
|
|
138
|
+
More in [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
|
|
139
|
+
preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
|
|
140
|
+
|
|
141
|
+
## Download the app
|
|
142
|
+
|
|
143
|
+
The free desktop app does the same visually: [latest release](https://github.com/Shivansh2703/lockwire/releases/latest).
|
|
144
|
+
|
|
145
|
+

|
|
146
|
+
|
|
147
|
+

|
|
148
|
+
|
|
149
|
+
The nine example robots that come with the app, each on its Check screen. Two are built to fail on purpose so you can see a catch: the desk arm and the servo bench, both NO-GO. The quadruped and the rover pass with notes, and the other five pass clean. Open any of them from the start screen, no robot file needed.
|
|
150
|
+
|
|
151
|
+
- **macOS (Apple silicon):** unzip, open Lockwire. The app is not notarized, so the first open warns: open System Settings, Privacy & Security, and click "Open Anyway".
|
|
152
|
+
- **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
|
|
153
|
+
- **Windows:** coming soon.
|
|
154
|
+
|
|
155
|
+
Want it installed instead of run through uvx? `pip install lockwire`, then drop the `uvx`.
|
|
156
|
+
|
|
157
|
+
## Development and licence
|
|
158
|
+
|
|
159
|
+
See [CONTRIBUTING.md](https://github.com/Shivansh2703/lockwire/blob/main/CONTRIBUTING.md). Apache-2.0, all of it: see [LICENSE](https://github.com/Shivansh2703/lockwire/blob/main/LICENSE).
|
|
160
|
+
|
|
161
|
+
<!-- mcp-name: io.github.lockwirerobotics/lockwire -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lockwire"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.4"
|
|
4
4
|
description = "The physical-assumption contract for robots: checks that a robot's declared parts (power, weight, bus, torque) add up"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
"Topic :: Software Development :: Testing",
|
|
23
23
|
]
|
|
24
24
|
dependencies = [
|
|
25
|
-
"numpy>=2.
|
|
25
|
+
"numpy>=2.4.6",
|
|
26
26
|
"pydantic>=2.13.4,<3",
|
|
27
27
|
"rich>=15.0.0",
|
|
28
28
|
"ruamel-yaml>=0.19.1,<0.20", # 0.x: a minor bump may break the round-trip API
|
|
@@ -36,15 +36,16 @@ dependencies = [
|
|
|
36
36
|
bus = [
|
|
37
37
|
"pyserial>=3.5",
|
|
38
38
|
]
|
|
39
|
-
# Serving lockwire over MCP to an agent. Optional:
|
|
39
|
+
# Serving lockwire over MCP to an agent. Optional:
|
|
40
|
+
# a plain install must stay lean, and the SDK is only needed by `lockwire mcp`.
|
|
40
41
|
mcp = [
|
|
41
42
|
"mcp>=2.2.0,<3",
|
|
42
43
|
"pyjwt>=2.15", # direct floor: a fresh lock must not resolve below the fixed release
|
|
43
44
|
]
|
|
44
45
|
# The Electron app's sidecar: `lockwire serve` over local HTTP. Optional for the
|
|
45
|
-
# same reason as `mcp
|
|
46
|
+
# same reason as `mcp`: a plain CLI install stays lean; only the
|
|
46
47
|
# packaged app build and anyone running the sidecar by hand need these. Versions are
|
|
47
|
-
# today's PyPI current stable (measured
|
|
48
|
+
# today's PyPI current stable (measured).
|
|
48
49
|
serve = [
|
|
49
50
|
"fastapi>=0.141.1",
|
|
50
51
|
"uvicorn>=0.52.4",
|
|
@@ -63,6 +64,7 @@ robots = [
|
|
|
63
64
|
Homepage = "https://github.com/Shivansh2703/lockwire"
|
|
64
65
|
Repository = "https://github.com/Shivansh2703/lockwire"
|
|
65
66
|
Issues = "https://github.com/Shivansh2703/lockwire/issues"
|
|
67
|
+
Changelog = "https://github.com/Shivansh2703/lockwire/blob/main/CHANGELOG.md"
|
|
66
68
|
|
|
67
69
|
[project.scripts]
|
|
68
70
|
lockwire = "lockwire:main"
|
|
@@ -71,7 +73,6 @@ lockwire = "lockwire:main"
|
|
|
71
73
|
requires = ["uv_build>=0.11.26,<0.12.0"]
|
|
72
74
|
build-backend = "uv_build"
|
|
73
75
|
|
|
74
|
-
# plugin with the recording commands (preflight, baseline, health...), loaded via its entry point.
|
|
75
76
|
[tool.uv.build-backend]
|
|
76
77
|
module-name = "lockwire"
|
|
77
78
|
|
|
@@ -88,9 +89,9 @@ dev = [
|
|
|
88
89
|
"fastapi>=0.141.1",
|
|
89
90
|
"uvicorn>=0.52.4",
|
|
90
91
|
"httpx>=0.28.1",
|
|
91
|
-
# Freezing the sidecar binary: `uv run pyinstaller packaging/lockwire.spec`. Dev-only
|
|
92
|
-
# it is a build tool, never imported at runtime
|
|
93
|
-
# anchor the uvicorn hidden-import test against uvicorn's real module list
|
|
92
|
+
# Freezing the sidecar binary: `uv run pyinstaller packaging/lockwire.spec`. Dev-only:
|
|
93
|
+
# it is a build tool, never imported at runtime, and `tests/test_cli.py` imports it to
|
|
94
|
+
# anchor the uvicorn hidden-import test against uvicorn's real module list.
|
|
94
95
|
"pyinstaller>=6.21.0",
|
|
95
96
|
# The `robots` extra, for the same reason: require_extras claims it, and
|
|
96
97
|
# tests/test_packaging_extras.py asserts every claimed module imports here.
|
|
@@ -106,22 +107,19 @@ dev = [
|
|
|
106
107
|
# This codebase is written to ~100 columns: schema.py and checks.py carry aligned
|
|
107
108
|
# trailing comments naming each field's consumer, and wrapping at ruff's default 88
|
|
108
109
|
# splits those annotations off the line they annotate. E501 is not in ruff's default
|
|
109
|
-
# rule set, so before this block the two documented commands disagreed
|
|
110
|
+
# rule set, so before this block the two documented commands disagreed: `ruff check`
|
|
110
111
|
# passed while `ruff format` wanted to rewrite 12 files. At 100 the sweep is a net
|
|
111
112
|
# reduction (83 insertions / 105 deletions); at 88 it was +219/-80.
|
|
112
113
|
line-length = 100
|
|
113
|
-
|
|
114
|
-
#
|
|
115
|
-
[
|
|
116
|
-
"scripts/measure_stacked_gate.py" = ["E402"]
|
|
114
|
+
# The launch kit under docs/community holds the GTM lead's one-off recording and render scripts
|
|
115
|
+
# (merged 2026-11-26). They are not product code and never ship; lint does not govern them.
|
|
116
|
+
extend-exclude = ["docs/community"]
|
|
117
117
|
|
|
118
118
|
[tool.pytest.ini_options]
|
|
119
119
|
pythonpath = ["."]
|
|
120
120
|
testpaths = ["tests"]
|
|
121
|
-
# chrome: drives real headless Chrome (subprocess spawn).
|
|
122
|
-
#
|
|
123
|
-
# runs never spawn Chrome processes; the cadence Check (--exclusive) still runs
|
|
124
|
-
# them. Registered here so --strict-markers, if ever turned on, does not bite.
|
|
121
|
+
# chrome: drives real headless Chrome (subprocess spawn). Registered here so
|
|
122
|
+
# --strict-markers, if ever turned on, does not bite. Deselect with `-m "not chrome"`.
|
|
125
123
|
markers = [
|
|
126
|
-
"chrome: drives real headless Chrome;
|
|
124
|
+
"chrome: drives real headless Chrome; deselect with -m 'not chrome'",
|
|
127
125
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"""Lockwire
|
|
1
|
+
"""Lockwire - the physical-assumption contract for robots, enforced in CI and at preflight."""
|
|
2
2
|
|
|
3
|
-
__version__ = "0.5.
|
|
3
|
+
__version__ = "0.5.4"
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def main() -> None:
|
|
@@ -13,8 +13,13 @@ def main() -> None:
|
|
|
13
13
|
for stream in (sys.stdout, sys.stderr): # a cp1252 Windows console cannot print Δ, →, ✓
|
|
14
14
|
if hasattr(stream, "reconfigure"):
|
|
15
15
|
stream.reconfigure(errors="replace")
|
|
16
|
+
from lockwire.checks import CheckCrashed, ModelFileRefusal
|
|
17
|
+
|
|
16
18
|
try:
|
|
17
|
-
|
|
19
|
+
try:
|
|
20
|
+
app()
|
|
21
|
+
except CheckCrashed as crashed: # the terminal gets the error's own words, as before
|
|
22
|
+
raise crashed.__cause__ from None
|
|
18
23
|
except PrivatePartsError as error: # one line, not a traceback
|
|
19
24
|
from rich.console import Console
|
|
20
25
|
from rich.markup import escape
|
|
@@ -23,7 +28,7 @@ def main() -> None:
|
|
|
23
28
|
f"[red]private parts file broken:[/] {escape(str(error))}"
|
|
24
29
|
)
|
|
25
30
|
sys.exit(2)
|
|
26
|
-
except ContractError as error: # the user's
|
|
31
|
+
except (ContractError, ModelFileRefusal) as error: # the user's files, not a bug: plain lines
|
|
27
32
|
from rich.console import Console
|
|
28
33
|
from rich.markup import escape
|
|
29
34
|
|
|
@@ -44,7 +49,7 @@ def main() -> None:
|
|
|
44
49
|
from rich.markup import escape
|
|
45
50
|
|
|
46
51
|
Console(stderr=True, emoji=False).print(
|
|
47
|
-
f"[red]lockwire stopped: {type(error).__name__}: {escape(str(error))}
|
|
48
|
-
"
|
|
52
|
+
f"[red]lockwire stopped: {type(error).__name__}: {escape(str(error))}"
|
|
53
|
+
"; this is a bug in lockwire, not a verdict[/]"
|
|
49
54
|
)
|
|
50
55
|
sys.exit(2)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""``python -m lockwire``
|
|
1
|
+
"""``python -m lockwire`` - the same CLI the ``lockwire`` script runs.
|
|
2
2
|
|
|
3
3
|
Exists so ``jobs.py`` can start a run as an argv list against ``sys.executable``
|
|
4
4
|
without depending on a console script being on PATH.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"""The alternatives half of the advice sentence.
|
|
2
2
|
|
|
3
3
|
``check_budgets`` (``checks.py``) already knows a rail_power budget is over its
|
|
4
|
-
limit; this module answers the second half of the sentence
|
|
5
|
-
carry it"
|
|
4
|
+
limit; this module answers the second half of the sentence - "what else could
|
|
5
|
+
carry it" - headroom on every OTHER rail_power budget, plus a projected
|
|
6
6
|
regulator suggestion. It computes nothing about rail membership itself:
|
|
7
7
|
Reuse means ``checks.power_rollup``'s own return values (rail totals, the
|
|
8
8
|
per-rail unknown-consumer sets) are passed in as plain data, never re-walked.
|
|
9
|
-
This module never imports ``checks``
|
|
9
|
+
This module never imports ``checks`` - the call only ever goes the other way,
|
|
10
10
|
so there is no cycle.
|
|
11
11
|
|
|
12
12
|
Every number carries its ``kind`` (a catalog or projected
|
|
13
13
|
figure is shown only with its own visual mark and word, never in the same
|
|
14
|
-
style as a measured one): headroom is ``derived-by-<check>``
|
|
14
|
+
style as a measured one): headroom is ``derived-by-<check>`` - the same
|
|
15
15
|
rollup ``check_budgets`` itself scores against; a suggested regulator rating
|
|
16
16
|
is ``projected``, a number this product is choosing, not measuring.
|
|
17
17
|
|
|
@@ -43,7 +43,7 @@ class Alternative(BaseModel):
|
|
|
43
43
|
unit: str
|
|
44
44
|
kind: str # "derived-by-<check>" | "projected" | "none"
|
|
45
45
|
#: The word for a ``projected`` figure. Required when ``kind ==
|
|
46
|
-
#: "projected"``
|
|
46
|
+
#: "projected"`` - a projected figure reaching a door carries its mark and
|
|
47
47
|
#: its word, not a corrected sentence saying it is unenforced.
|
|
48
48
|
mark: str | None = None
|
|
49
49
|
#: The rail this remedy points at (a move: the rail to move to; a regulator: the
|
|
@@ -72,7 +72,7 @@ def build_rail_alternatives(
|
|
|
72
72
|
"""Alternatives for a rail_power budget over its limit on ``over_rail_id``.
|
|
73
73
|
|
|
74
74
|
``rail_totals``/``rail_unknown`` must come from ``checks.power_rollup`` run
|
|
75
|
-
against the same contract and draw mode as the violation being explained
|
|
75
|
+
against the same contract and draw mode as the violation being explained -
|
|
76
76
|
the shared builder that every call site (and every mutation bite) goes
|
|
77
77
|
through, so a broken kind anywhere breaks every caller alike.
|
|
78
78
|
"""
|