lockwire 0.5.0__tar.gz → 0.5.3__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.
Files changed (140) hide show
  1. {lockwire-0.5.0 → lockwire-0.5.3}/PKG-INFO +43 -31
  2. lockwire-0.5.3/README.md +150 -0
  3. {lockwire-0.5.0 → lockwire-0.5.3}/pyproject.toml +14 -19
  4. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/__init__.py +11 -6
  5. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/__main__.py +1 -1
  6. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/advice.py +6 -6
  7. lockwire-0.5.3/src/lockwire/agent_setup.py +202 -0
  8. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/api.py +93 -53
  9. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/api_payload.py +186 -56
  10. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/bench.py +10 -10
  11. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/blame.py +53 -6
  12. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/catalog.py +66 -13
  13. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/catalog_robots.yaml +59 -59
  14. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/catalog_seed.yaml +46 -56
  15. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/check_sim.py +25 -8
  16. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/checks.py +967 -231
  17. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/cli.py +621 -306
  18. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/cli_line.py +10 -5
  19. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/controls.py +1 -1
  20. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/copy.py +65 -18
  21. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/describe.py +89 -67
  22. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/edit.py +271 -92
  23. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/emit_ts.py +13 -14
  24. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm-power/contract.yaml +7 -5
  25. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/drone/contract.yaml +13 -13
  26. lockwire-0.5.3/src/lockwire/explain.py +111 -0
  27. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/export_mhs.py +4 -4
  28. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/export_model.py +36 -2
  29. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/factdiff.py +12 -7
  30. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/fieldpath.py +1 -1
  31. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/findings_export.py +6 -6
  32. lockwire-0.5.3/src/lockwire/fixes.py +695 -0
  33. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/forces.py +29 -12
  34. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/gitref.py +4 -4
  35. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/hook_check.py +9 -2
  36. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/hw.py +7 -7
  37. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/mcp_server.py +71 -61
  38. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/mechanism.py +10 -10
  39. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/mesh_dae.py +2 -2
  40. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/mesh_simple.py +3 -3
  41. lockwire-0.5.3/src/lockwire/missing.py +394 -0
  42. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/mjcf.py +28 -0
  43. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/page.py +214 -106
  44. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/parts_list.py +32 -4
  45. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/plan.py +32 -21
  46. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/plan_payload.py +6 -5
  47. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/presets.py +1 -1
  48. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/report.py +298 -96
  49. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/report_html.py +338 -65
  50. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/report_json.py +7 -7
  51. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/scan.py +2 -2
  52. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/scene.py +9 -6
  53. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/scene_import.py +7 -6
  54. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/scene_urdf.py +95 -12
  55. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/scene_view.py +11 -11
  56. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/schema.py +94 -40
  57. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/sdf.py +110 -14
  58. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/serve.py +255 -28
  59. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/servo_bus.py +9 -1
  60. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/slicer.py +1 -1
  61. lockwire-0.5.3/src/lockwire/standing.py +583 -0
  62. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/start_operation.py +94 -29
  63. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/statics.py +181 -25
  64. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/swap.py +130 -31
  65. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/units.py +2 -2
  66. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/urdf.py +38 -16
  67. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/variants.py +2 -0
  68. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/vcs.py +28 -28
  69. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/whatif.py +2 -1
  70. lockwire-0.5.3/src/lockwire/whatif_table.py +173 -0
  71. lockwire-0.5.0/README.md +0 -139
  72. lockwire-0.5.0/src/lockwire/agent_setup.py +0 -133
  73. {lockwire-0.5.0 → lockwire-0.5.3}/LICENSE +0 -0
  74. {lockwire-0.5.0 → lockwire-0.5.3}/NOTICE +0 -0
  75. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/_filelock.py +0 -0
  76. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/battery.py +0 -0
  77. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/confine.py +0 -0
  78. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/constraints.py +0 -0
  79. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/drift.py +0 -0
  80. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/LICENSE +0 -0
  81. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/NOTICE +0 -0
  82. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/contract.yaml +0 -0
  83. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/plan.yaml +0 -0
  84. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/scene.glb +0 -0
  85. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm/starter.json +0 -0
  86. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm-power/README.md +0 -0
  87. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm-power/plan.yaml +0 -0
  88. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/arm-power/starter.json +0 -0
  89. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/drone/plan.yaml +0 -0
  90. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/drone/scene.glb +0 -0
  91. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/drone/starter.json +0 -0
  92. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/hexapod-param/contract.yaml +0 -0
  93. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/hexapod-param/starter.json +0 -0
  94. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/humanoid/NOTICE +0 -0
  95. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/humanoid/contract.yaml +0 -0
  96. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/humanoid/plan.yaml +0 -0
  97. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/humanoid/scene.glb +0 -0
  98. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/humanoid/starter.json +0 -0
  99. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/quadruped/NOTICE +0 -0
  100. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/quadruped/contract.yaml +0 -0
  101. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/quadruped/plan.yaml +0 -0
  102. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/quadruped/scene.glb +0 -0
  103. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/quadruped/starter.json +0 -0
  104. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover/NOTICE +0 -0
  105. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover/contract.yaml +0 -0
  106. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover/plan.yaml +0 -0
  107. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover/scene.glb +0 -0
  108. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover/starter.json +0 -0
  109. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover-param/contract.yaml +0 -0
  110. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/rover-param/starter.json +0 -0
  111. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/examples/servo-bench.yaml +0 -0
  112. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/harness.py +0 -0
  113. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/kicad.py +0 -0
  114. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/material_compare.py +0 -0
  115. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/meshread.py +0 -0
  116. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/motor_card.py +0 -0
  117. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/arduino-nano.yaml +0 -0
  118. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/arduino-uno-r3.yaml +0 -0
  119. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/basicmicro-roboclaw-2x15a.yaml +0 -0
  120. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/esp32-devkitc-wroom-32.yaml +0 -0
  121. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/holybro-pixhawk-6c.yaml +0 -0
  122. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/nvidia-jetson-orin-nano-devkit.yaml +0 -0
  123. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/pololu-tb6612fng-carrier.yaml +0 -0
  124. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/raspberry-pi-4b.yaml +0 -0
  125. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/raspberry-pi-5.yaml +0 -0
  126. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/robotis-opencr-1-0.yaml +0 -0
  127. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/robotis-u2d2-power-hub.yaml +0 -0
  128. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/robotis-u2d2.yaml +0 -0
  129. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pinouts/waveshare-bus-servo-adapter-a.yaml +0 -0
  130. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/pins.py +0 -0
  131. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/plugins.py +0 -0
  132. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/power_budget.py +0 -0
  133. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/relevance.py +0 -0
  134. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/review_draft.py +0 -0
  135. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/sensitivity.py +0 -0
  136. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/servo_bus_dxl.py +0 -0
  137. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/stress.py +0 -0
  138. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/thrust.py +0 -0
  139. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/thrust_tables.yaml +0 -0
  140. {lockwire-0.5.0 → lockwire-0.5.3}/src/lockwire/webots.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockwire
3
- Version: 0.5.0
3
+ Version: 0.5.3
4
4
  Summary: The physical-assumption contract for robots: checks that a robot's declared parts (power, weight, bus, torque) add up
5
5
  Keywords: robotics,urdf,ros,preflight,lockfile,ci,hardware,drone
6
6
  Author: Shivansh
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.13
15
15
  Classifier: Topic :: Scientific/Engineering
16
16
  Classifier: Topic :: Software Development :: Quality Assurance
17
17
  Classifier: Topic :: Software Development :: Testing
18
- Requires-Dist: numpy>=2.5.1
18
+ Requires-Dist: numpy>=2.4.6
19
19
  Requires-Dist: pydantic>=2.13.4,<3
20
20
  Requires-Dist: rich>=15.0.0
21
21
  Requires-Dist: ruamel-yaml>=0.19.1,<0.20
@@ -32,6 +32,7 @@ Requires-Python: >=3.12
32
32
  Project-URL: Homepage, https://github.com/Shivansh2703/lockwire
33
33
  Project-URL: Repository, https://github.com/Shivansh2703/lockwire
34
34
  Project-URL: Issues, https://github.com/Shivansh2703/lockwire/issues
35
+ Project-URL: Changelog, https://github.com/Shivansh2703/lockwire/blob/main/CHANGELOG.md
35
36
  Provides-Extra: bus
36
37
  Provides-Extra: mcp
37
38
  Provides-Extra: robots
@@ -40,8 +41,8 @@ Description-Content-Type: text/markdown
40
41
 
41
42
  <p align="center">
42
43
  <picture>
43
- <source media="(prefers-color-scheme: dark)" srcset="docs/img/logo-dark.svg">
44
- <img src="docs/img/logo-light.svg" alt="lockwire" height="64">
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">
45
46
  </picture>
46
47
  </p>
47
48
 
@@ -65,27 +66,31 @@ uvx lockwire check
65
66
  ```
66
67
 
67
68
  ```console
68
- VIOLATION topology/rails/rail.5v/brownout — observed rail.5v sags to 4.65 V with every servo stalled (2.73 A), expected >=
69
+ VIOLATION topology/rails/rail.5v/brownout: observed rail.5v sags to 4.65 V with every servo stalled (2.73 A), expected >=
69
70
  4.75 V, the declared minimum input of dev.jetson
70
71
  action: shorten or thicken the wire, cut the pack resistance, or move the
71
72
  servos to their own rail
72
- VIOLATION topology/wires/w.pack/fuse — observed 9.00 A fuse on 22 AWG wire w.pack, expected fuse <= 7.00 A wire
73
- ampacity
73
+ VIOLATION topology/wires/w.pack/fuse: observed 9.00 A fuse on 22 AWG wire w.pack, expected fuse <= 7.00 A, the
74
+ safe current for this wire
74
75
  ...
75
76
  action: fit a fuse at or below 7.00 A or upsize wire 'w.pack'
77
+ scored 12: 10 add up, 0 do not, 1 warn, 1 model check (links and joints unchanged
78
+ since the lock) · 1 not scored · 2 other violation(s) · 1 other warning(s)
79
+
80
+ NO-GO: 2 violation(s), 2 warning(s)
76
81
  ...
77
- NO-GO — 2 violation(s), 2 warning(s)
78
82
  ```
79
83
 
80
- Command line: macOS, Linux and Windows. Desktop app: macOS (Apple silicon) and Linux. Windows app coming soon.
84
+ Command line: macOS, Linux and Windows. Desktop app: macOS (Apple silicon) and Linux.
81
85
 
82
86
  `check` exits 1 on a NO-GO. Two real errors in a robot you have not built yet: with both servos stalled
83
- the 5 V rail sags below the Jetson's minimum input and resets it, and a 9 A fuse sits on wire that
84
- carries 7 A. Each line names the part and the page its limit came from, and says what to change
85
- (`lockwire check --all` also shows the two warnings: a servo data wire on a boot pin, and a 28 AWG
86
- servo feed drawing about 5 A). Lockwire found these without being told. Errors like this are in public
87
+ the 5 V rail sags below the Jetson's minimum input and resets it, and a 9 A fuse sits on wire rated
88
+ for 7 A. Each finding names the part and where its limit came from, and says what to change
89
+ (`uvx lockwire check --all` also shows the two warnings: a servo data wire on a boot pin, and a 28 AWG
90
+ servo feed drawing about 5 A). The scored line counts the comparisons that add up and names
91
+ the findings outside them. Lockwire found these without being told. Errors like this are in public
87
92
  robot models today, and maintainers at Seeed and DFKI (MiR100) have merged the fixes:
88
- [the fixes sent upstream](docs/ledger.md).
93
+ [the fixes sent upstream](https://github.com/Shivansh2703/lockwire/blob/main/docs/ledger.md).
89
94
 
90
95
  ## Lock it
91
96
 
@@ -104,7 +109,7 @@ model without re-locking is a NO-GO that names the value.
104
109
  uvx lockwire agent-setup --ci
105
110
  ```
106
111
 
107
- That writes `.github/workflows/lockwire.yml`. Its step, with the three inputs most repos need:
112
+ That writes `.github/workflows/lockwire.yml`. The step it writes, plus two optional inputs:
108
113
 
109
114
  ```yaml
110
115
  - uses: actions/checkout@v4
@@ -116,7 +121,7 @@ That writes `.github/workflows/lockwire.yml`. Its step, with the three inputs mo
116
121
  ```
117
122
 
118
123
  A NO-GO fails the build, with annotations on the pull request and an HTML report.
119
- Every input, pre-commit and other CI systems: [docs/guides/ci.md](docs/guides/ci.md).
124
+ Every input, pre-commit and other CI systems: [docs/guides/ci.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/ci.md).
120
125
 
121
126
  ## Let your AI agent check it
122
127
 
@@ -126,8 +131,8 @@ uvx lockwire agent-setup
126
131
  ```
127
132
 
128
133
  The first line gives Claude Code the checks over MCP. `agent-setup` writes the agent rules into
129
- AGENTS.md and the Claude Code one, plus a pre-commit hook and the CI workflow.
130
- Cursor, Claude Desktop and other agents: [docs/guides/agents.md](docs/guides/agents.md).
134
+ AGENTS.md and the Claude Code one, plus a pre-commit config and the CI workflow.
135
+ Cursor, Claude Desktop and other agents: [docs/guides/agents.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/agents.md).
131
136
 
132
137
  ## No robot file? Try an example
133
138
 
@@ -135,21 +140,24 @@ servo-bench is built to fail: a 5 V rail overloaded and a wrist servo too weak,
135
140
 
136
141
  ```console
137
142
  $ uvx lockwire start --example servo-bench
138
- 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
143
+ 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
139
144
  $ uvx lockwire check
140
- VIOLATION model/joints/wrist/limits/effort — observed 0.40 N*m joint effort limit, expected <= 0.226 N*m, the feetech.scs0009
141
- stall torque (Δ 1.8x the stall torque)
145
+ VIOLATION model/joints/wrist/limits/effort: observed 0.40 N*m joint effort limit, expected <= 0.226 N*m, the feetech.scs0009
146
+ stall torque (1.8 times that)
142
147
  ...
143
- action: ... or find a stronger servo: lockwire swap lockwire.yaml wrist
144
- VIOLATION budgets/bud.power.servo-5v — observed 32.10 W, expected <= 15.00 W (Δ +17.10 W (+114%))
148
+ action: ... or find a stronger servo: uvx lockwire swap lockwire.yaml wrist
149
+ VIOLATION budgets/bud.power.servo-5v: observed 32.10 W, expected <= 15.00 W (off by +17.10 W, +114%)
145
150
  ...
146
- NO-GO — 2 violation(s), 0 warning(s)
151
+ scored 9: 7 add up, 2 do not · 2 not scored
152
+
153
+ NO-GO: 2 violation(s), 0 warning(s)
154
+ ...
147
155
  ```
148
156
 
149
- The examples that pass the check (`--example drone`, `rover`, `arm`, `quadruped`, `humanoid`) are good
150
- starting points; `arm-power` and `servo-bench` show a catch, and so will your own robot.
157
+ The examples that pass the check (`lockwire start --example drone`, `rover`, `arm`, `quadruped`, `humanoid`,
158
+ `hexapod-param`, `rover-param`) are good starting points; `arm-power` and `servo-bench` show a catch, and so will your own robot.
151
159
 
152
- ### Features
160
+ ## Features
153
161
 
154
162
  - **Check:** see which physical numbers in your model do not add up, and the command that fixes each one.
155
163
  - **Lock:** keep those numbers in `lockwire.yaml`, so any drift is caught.
@@ -157,14 +165,18 @@ starting points; `arm-power` and `servo-bench` show a catch, and so will your ow
157
165
  - **Agents:** your AI coding agent runs the same check before it changes the robot.
158
166
 
159
167
  Everything else (datasheet comparisons, power, torque and bus budgets, part swap, the servo
160
- recorder, drift on a single robot, the Python library): [the guides](docs/guides/index.md). The powered-on
161
- preflight gate, ROS 2 bags and the drift ledger across units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
168
+ recorder, a sim file drifting from the lock): [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
169
+ preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
162
170
 
163
171
  ## Download the app
164
172
 
165
173
  The free desktop app does the same visually: [latest release](https://github.com/Shivansh2703/lockwire/releases/latest).
166
174
 
167
- ![Open the app, pick the Rover example, and the Check screen shows the TurtleBot3 in 3D with a GO with notes verdict: 0 problems, 4 checks not compared yet](docs/img/try-example.gif)
175
+ ![The free app: the start screen with the example list, then the Rover example open on the Check screen in 3D with a GO with notes verdict (1 warning, 1 advice, 3 not scored), its warning row and its tip margin advice open, then the not-scored list opened with its three rows](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/try-example.gif)
176
+
177
+ The nine examples that come with the app, each on its Check screen:
178
+
179
+ ![The nine bundled examples in the dark theme, two to a row, each robot in 3D beside its Check verdict: desk arm and servo bench NO-GO with 2 violations, quadruped and Rover GO with notes, the other five GO](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/every-example-dark.webp)
168
180
 
169
181
  - **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".
170
182
  - **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
@@ -174,6 +186,6 @@ Want it installed instead of run through uvx? `pip install lockwire`, then drop
174
186
 
175
187
  ## Development and licence
176
188
 
177
- See [CONTRIBUTING.md](CONTRIBUTING.md). Apache-2.0, all of it: see [LICENSE](LICENSE).
189
+ 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).
178
190
 
179
191
  <!-- mcp-name: io.github.lockwirerobotics/lockwire -->
@@ -0,0 +1,150 @@
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
+ **From idea to robot: catch the error in your robot model before the real robot does.**
9
+
10
+ ## Check your robot
11
+
12
+ Needs Python 3.12 or newer and [uv](https://docs.astral.sh/uv/). Point it at your own URDF, xacro or
13
+ SDF (nothing is written):
14
+
15
+ ```bash
16
+ uvx lockwire check robot.urdf
17
+ ```
18
+
19
+ No robot file yet? This writes a small example arm, with its power and wiring, into the current folder
20
+ and checks it:
21
+
22
+ ```bash
23
+ uvx lockwire start --example arm-power
24
+ uvx lockwire check
25
+ ```
26
+
27
+ ```console
28
+ VIOLATION topology/rails/rail.5v/brownout: observed rail.5v sags to 4.65 V with every servo stalled (2.73 A), expected >=
29
+ 4.75 V, the declared minimum input of dev.jetson
30
+ action: shorten or thicken the wire, cut the pack resistance, or move the
31
+ servos to their own rail
32
+ VIOLATION topology/wires/w.pack/fuse: observed 9.00 A fuse on 22 AWG wire w.pack, expected fuse <= 7.00 A, the
33
+ safe current for this wire
34
+ ...
35
+ action: fit a fuse at or below 7.00 A or upsize wire 'w.pack'
36
+ scored 12: 10 add up, 0 do not, 1 warn, 1 model check (links and joints unchanged
37
+ since the lock) · 1 not scored · 2 other violation(s) · 1 other warning(s)
38
+
39
+ NO-GO: 2 violation(s), 2 warning(s)
40
+ ...
41
+ ```
42
+
43
+ Command line: macOS, Linux and Windows. Desktop app: macOS (Apple silicon) and Linux.
44
+
45
+ `check` exits 1 on a NO-GO. Two real errors in a robot you have not built yet: with both servos stalled
46
+ the 5 V rail sags below the Jetson's minimum input and resets it, and a 9 A fuse sits on wire rated
47
+ for 7 A. Each finding names the part and where its limit came from, and says what to change
48
+ (`uvx lockwire check --all` also shows the two warnings: a servo data wire on a boot pin, and a 28 AWG
49
+ servo feed drawing about 5 A). The scored line counts the comparisons that add up and names
50
+ the findings outside them. Lockwire found these without being told. Errors like this are in public
51
+ robot models today, and maintainers at Seeed and DFKI (MiR100) have merged the fixes:
52
+ [the fixes sent upstream](https://github.com/Shivansh2703/lockwire/blob/main/docs/ledger.md).
53
+
54
+ ## Lock it
55
+
56
+ ```bash
57
+ uvx lockwire start robot.urdf
58
+ ```
59
+
60
+ This writes `lockwire.yaml`, the robot's physics lockfile: every link's mass, centre of mass and
61
+ inertia, every joint limit, and a hash of the model's structure. Commit it next to your model.
62
+ From now on `uvx lockwire check` checks the lockfile, and a mass or joint limit edited in the
63
+ model without re-locking is a NO-GO that names the value.
64
+
65
+ ## Run it in CI
66
+
67
+ ```bash
68
+ uvx lockwire agent-setup --ci
69
+ ```
70
+
71
+ That writes `.github/workflows/lockwire.yml`. The step it writes, plus two optional inputs:
72
+
73
+ ```yaml
74
+ - uses: actions/checkout@v4
75
+ - uses: Shivansh2703/lockwire@v0
76
+ with:
77
+ contract: lockwire.yaml # the lockfile
78
+ # model: robot.urdf # or check a model directly, with no lockfile
79
+ # adopt: "true" # annotate and report, but never fail the job
80
+ ```
81
+
82
+ A NO-GO fails the build, with annotations on the pull request and an HTML report.
83
+ Every input, pre-commit and other CI systems: [docs/guides/ci.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/ci.md).
84
+
85
+ ## Let your AI agent check it
86
+
87
+ ```bash
88
+ claude mcp add lockwire -- uvx --from "lockwire[mcp]" lockwire mcp
89
+ uvx lockwire agent-setup
90
+ ```
91
+
92
+ The first line gives Claude Code the checks over MCP. `agent-setup` writes the agent rules into
93
+ AGENTS.md and the Claude Code one, plus a pre-commit config and the CI workflow.
94
+ Cursor, Claude Desktop and other agents: [docs/guides/agents.md](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/agents.md).
95
+
96
+ ## No robot file? Try an example
97
+
98
+ 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.
99
+
100
+ ```console
101
+ $ uvx lockwire start --example servo-bench
102
+ 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
103
+ $ uvx lockwire check
104
+ VIOLATION model/joints/wrist/limits/effort: observed 0.40 N*m joint effort limit, expected <= 0.226 N*m, the feetech.scs0009
105
+ stall torque (1.8 times that)
106
+ ...
107
+ action: ... or find a stronger servo: uvx lockwire swap lockwire.yaml wrist
108
+ VIOLATION budgets/bud.power.servo-5v: observed 32.10 W, expected <= 15.00 W (off by +17.10 W, +114%)
109
+ ...
110
+ scored 9: 7 add up, 2 do not · 2 not scored
111
+
112
+ NO-GO: 2 violation(s), 0 warning(s)
113
+ ...
114
+ ```
115
+
116
+ The examples that pass the check (`lockwire start --example drone`, `rover`, `arm`, `quadruped`, `humanoid`,
117
+ `hexapod-param`, `rover-param`) are good starting points; `arm-power` and `servo-bench` show a catch, and so will your own robot.
118
+
119
+ ## Features
120
+
121
+ - **Check:** see which physical numbers in your model do not add up, and the command that fixes each one.
122
+ - **Lock:** keep those numbers in `lockwire.yaml`, so any drift is caught.
123
+ - **CI:** the same check on every push, with pull-request annotations and an HTML report.
124
+ - **Agents:** your AI coding agent runs the same check before it changes the robot.
125
+
126
+ Everything else (datasheet comparisons, power, torque and bus budgets, part swap, the servo
127
+ recorder, a sim file drifting from the lock): [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
128
+ preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
129
+
130
+ ## Download the app
131
+
132
+ The free desktop app does the same visually: [latest release](https://github.com/Shivansh2703/lockwire/releases/latest).
133
+
134
+ ![The free app: the start screen with the example list, then the Rover example open on the Check screen in 3D with a GO with notes verdict (1 warning, 1 advice, 3 not scored), its warning row and its tip margin advice open, then the not-scored list opened with its three rows](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/try-example.gif)
135
+
136
+ The nine examples that come with the app, each on its Check screen:
137
+
138
+ ![The nine bundled examples in the dark theme, two to a row, each robot in 3D beside its Check verdict: desk arm and servo bench NO-GO with 2 violations, quadruped and Rover GO with notes, the other five GO](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/every-example-dark.webp)
139
+
140
+ - **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".
141
+ - **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
142
+ - **Windows:** coming soon.
143
+
144
+ Want it installed instead of run through uvx? `pip install lockwire`, then drop the `uvx`.
145
+
146
+ ## Development and licence
147
+
148
+ 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).
149
+
150
+ <!-- mcp-name: io.github.lockwirerobotics/lockwire -->
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lockwire"
3
- version = "0.5.0"
3
+ version = "0.5.3"
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.5.1",
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: a plain install must stay lean, and the SDK is only needed by `lockwire mcp`.
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` — a plain CLI install stays lean; only the
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, E1-a).
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 — and `tests/test_cli.py` imports it to
93
- # anchor the uvicorn hidden-import test against uvicorn's real module list (box e1-d2).
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,16 @@ 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 — `ruff check`
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
 
114
- # measure_stacked_gate.py bootstraps sys.path before imports (B76) — E402 is intentional there.
115
- [tool.ruff.lint.per-file-ignores]
116
- "scripts/measure_stacked_gate.py" = ["E402"]
117
-
118
115
  [tool.pytest.ini_options]
119
116
  pythonpath = ["."]
120
117
  testpaths = ["tests"]
121
- # chrome: drives real headless Chrome (subprocess spawn). scripts/pytest_slot.sh
122
- # excludes this marker from every non-exclusive (targeted) run so workers' test
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.
118
+ # chrome: drives real headless Chrome (subprocess spawn). Registered here so
119
+ # --strict-markers, if ever turned on, does not bite. Deselect with `-m "not chrome"`.
125
120
  markers = [
126
- "chrome: drives real headless Chrome; excluded from targeted runs by scripts/pytest_slot.sh",
121
+ "chrome: drives real headless Chrome; deselect with -m 'not chrome'",
127
122
  ]
@@ -1,6 +1,6 @@
1
- """Lockwire — the physical-assumption contract for robots, enforced in CI and at preflight."""
1
+ """Lockwire - the physical-assumption contract for robots, enforced in CI and at preflight."""
2
2
 
3
- __version__ = "0.5.0"
3
+ __version__ = "0.5.3"
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
- app()
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 lockfile, not a bug: plain lines, no traceback
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
- "— this is a bug in lockwire, not a verdict[/]"
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`` — the same CLI the ``lockwire`` script runs.
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 — "what else could
5
- carry it" — headroom on every OTHER rail_power budget, plus a projected
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`` — the call only ever goes the other way,
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>`` — the same
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"`` — a projected figure reaching a door carries its mark and
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
  """