lockwire 0.5.3__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.
Files changed (145) hide show
  1. {lockwire-0.5.3 → lockwire-0.5.4}/PKG-INFO +25 -14
  2. {lockwire-0.5.3 → lockwire-0.5.4}/README.md +24 -13
  3. {lockwire-0.5.3 → lockwire-0.5.4}/pyproject.toml +4 -1
  4. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/__init__.py +1 -1
  5. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/agent_setup.py +167 -6
  6. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/api.py +133 -38
  7. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/api_payload.py +35 -4
  8. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/catalog.py +15 -2
  9. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/catalog_seed.yaml +71 -0
  10. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/check_sim.py +59 -4
  11. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/checks.py +435 -100
  12. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/cli.py +394 -77
  13. lockwire-0.5.4/src/lockwire/confine.py +72 -0
  14. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/copy.py +94 -2
  15. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/describe.py +5 -2
  16. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/edit.py +525 -44
  17. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/NOTICE +4 -0
  18. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/contract.yaml +29 -3
  19. lockwire-0.5.4/src/lockwire/examples/arm/so101_new_calib.urdf +453 -0
  20. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/humanoid/NOTICE +11 -1
  21. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/humanoid/contract.yaml +2 -1
  22. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/quadruped/NOTICE +7 -0
  23. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/quadruped/contract.yaml +30 -3
  24. lockwire-0.5.4/src/lockwire/examples/quadruped/leg.xacro +392 -0
  25. lockwire-0.5.4/src/lockwire/examples/quadruped/solo12.urdf.xacro +101 -0
  26. lockwire-0.5.4/src/lockwire/examples/rover/LICENSE +203 -0
  27. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover/NOTICE +5 -0
  28. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover/contract.yaml +13 -3
  29. lockwire-0.5.4/src/lockwire/examples/rover/turtlebot3_burger.urdf +199 -0
  30. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/export_mhs.py +1 -1
  31. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/export_model.py +3 -0
  32. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/fieldpath.py +1 -1
  33. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/fixes.py +22 -9
  34. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/forces.py +27 -8
  35. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/gitref.py +10 -0
  36. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/hook_check.py +1 -1
  37. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/hw.py +3 -3
  38. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/material_compare.py +4 -2
  39. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/mcp_server.py +88 -41
  40. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/mechanism.py +1 -1
  41. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/missing.py +3 -3
  42. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/mjcf.py +2 -2
  43. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/motor_card.py +3 -0
  44. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/page.py +42 -16
  45. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/parts_list.py +1 -0
  46. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/esp32-devkitc-wroom-32.yaml +7 -7
  47. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/plan.py +16 -14
  48. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/plan_payload.py +11 -0
  49. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/report.py +105 -36
  50. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/report_html.py +23 -11
  51. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/report_json.py +17 -4
  52. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/review_draft.py +1 -1
  53. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/scene.py +8 -0
  54. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/scene_import.py +4 -4
  55. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/scene_urdf.py +28 -10
  56. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/scene_view.py +6 -4
  57. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/schema.py +225 -45
  58. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/sdf.py +2 -1
  59. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/serve.py +154 -29
  60. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/servo_bus.py +2 -0
  61. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/standing.py +75 -5
  62. lockwire-0.5.4/src/lockwire/start_operation.py +998 -0
  63. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/statics.py +23 -12
  64. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/swap.py +74 -9
  65. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/thrust.py +2 -2
  66. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/thrust_tables.yaml +41 -4
  67. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/urdf.py +71 -2
  68. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/vcs.py +81 -21
  69. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/whatif.py +1 -1
  70. lockwire-0.5.3/src/lockwire/confine.py +0 -31
  71. lockwire-0.5.3/src/lockwire/start_operation.py +0 -568
  72. {lockwire-0.5.3 → lockwire-0.5.4}/LICENSE +0 -0
  73. {lockwire-0.5.3 → lockwire-0.5.4}/NOTICE +0 -0
  74. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/__main__.py +0 -0
  75. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/_filelock.py +0 -0
  76. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/advice.py +0 -0
  77. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/battery.py +0 -0
  78. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/bench.py +0 -0
  79. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/blame.py +0 -0
  80. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/catalog_robots.yaml +0 -0
  81. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/cli_line.py +0 -0
  82. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/constraints.py +0 -0
  83. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/controls.py +0 -0
  84. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/drift.py +0 -0
  85. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/emit_ts.py +0 -0
  86. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/LICENSE +0 -0
  87. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/plan.yaml +0 -0
  88. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/scene.glb +0 -0
  89. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm/starter.json +0 -0
  90. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm-power/README.md +0 -0
  91. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm-power/contract.yaml +0 -0
  92. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm-power/plan.yaml +0 -0
  93. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/arm-power/starter.json +0 -0
  94. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/drone/contract.yaml +0 -0
  95. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/drone/plan.yaml +0 -0
  96. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/drone/scene.glb +0 -0
  97. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/drone/starter.json +0 -0
  98. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/hexapod-param/contract.yaml +0 -0
  99. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/hexapod-param/starter.json +0 -0
  100. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/humanoid/plan.yaml +0 -0
  101. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/humanoid/scene.glb +0 -0
  102. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/humanoid/starter.json +0 -0
  103. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/quadruped/plan.yaml +0 -0
  104. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/quadruped/scene.glb +0 -0
  105. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/quadruped/starter.json +0 -0
  106. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover/plan.yaml +0 -0
  107. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover/scene.glb +0 -0
  108. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover/starter.json +0 -0
  109. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover-param/contract.yaml +0 -0
  110. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/rover-param/starter.json +0 -0
  111. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/examples/servo-bench.yaml +0 -0
  112. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/explain.py +0 -0
  113. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/factdiff.py +0 -0
  114. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/findings_export.py +0 -0
  115. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/harness.py +0 -0
  116. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/kicad.py +0 -0
  117. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/mesh_dae.py +0 -0
  118. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/mesh_simple.py +0 -0
  119. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/meshread.py +0 -0
  120. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/arduino-nano.yaml +0 -0
  121. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/arduino-uno-r3.yaml +0 -0
  122. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/basicmicro-roboclaw-2x15a.yaml +0 -0
  123. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/holybro-pixhawk-6c.yaml +0 -0
  124. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/nvidia-jetson-orin-nano-devkit.yaml +0 -0
  125. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/pololu-tb6612fng-carrier.yaml +0 -0
  126. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/raspberry-pi-4b.yaml +0 -0
  127. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/raspberry-pi-5.yaml +0 -0
  128. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-opencr-1-0.yaml +0 -0
  129. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-u2d2-power-hub.yaml +0 -0
  130. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/robotis-u2d2.yaml +0 -0
  131. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pinouts/waveshare-bus-servo-adapter-a.yaml +0 -0
  132. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/pins.py +0 -0
  133. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/plugins.py +0 -0
  134. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/power_budget.py +0 -0
  135. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/presets.py +0 -0
  136. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/relevance.py +0 -0
  137. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/scan.py +0 -0
  138. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/sensitivity.py +0 -0
  139. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/servo_bus_dxl.py +0 -0
  140. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/slicer.py +0 -0
  141. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/stress.py +0 -0
  142. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/units.py +0 -0
  143. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/variants.py +0 -0
  144. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/webots.py +0 -0
  145. {lockwire-0.5.3 → lockwire-0.5.4}/src/lockwire/whatif_table.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockwire
3
- Version: 0.5.3
3
+ Version: 0.5.4
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
@@ -46,7 +46,11 @@ Description-Content-Type: text/markdown
46
46
  </picture>
47
47
  </p>
48
48
 
49
- **From idea to robot: catch the error in your robot model before the real robot does.**
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).
50
54
 
51
55
  ## Check your robot
52
56
 
@@ -58,7 +62,7 @@ uvx lockwire check robot.urdf
58
62
  ```
59
63
 
60
64
  No robot file yet? This writes a small example arm, with its power and wiring, into the current folder
61
- and checks it:
65
+ (two files, `lockwire.yaml` and `lockwire.plan.yaml`) and checks it:
62
66
 
63
67
  ```bash
64
68
  uvx lockwire start --example arm-power
@@ -101,7 +105,9 @@ uvx lockwire start robot.urdf
101
105
  This writes `lockwire.yaml`, the robot's physics lockfile: every link's mass, centre of mass and
102
106
  inertia, every joint limit, and a hash of the model's structure. Commit it next to your model.
103
107
  From now on `uvx lockwire check` checks the lockfile, and a mass or joint limit edited in the
104
- model without re-locking is a NO-GO that names the value.
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.
105
111
 
106
112
  ## Run it in CI
107
113
 
@@ -131,8 +137,9 @@ uvx lockwire agent-setup
131
137
  ```
132
138
 
133
139
  The first line gives Claude Code the checks over MCP. `agent-setup` writes the agent rules into
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).
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).
136
143
 
137
144
  ## No robot file? Try an example
138
145
 
@@ -159,13 +166,17 @@ The examples that pass the check (`lockwire start --example drone`, `rover`, `ar
159
166
 
160
167
  ## Features
161
168
 
162
- - **Check:** see which physical numbers in your model do not add up, and the command that fixes each one.
163
- - **Lock:** keep those numbers in `lockwire.yaml`, so any drift is caught.
164
- - **CI:** the same check on every push, with pull-request annotations and an HTML report.
165
- - **Agents:** your AI coding agent runs the same check before it changes the robot.
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">
166
178
 
167
- Everything else (datasheet comparisons, power, torque and bus budgets, part swap, the servo
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
179
+ More in [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
169
180
  preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
170
181
 
171
182
  ## Download the app
@@ -174,9 +185,9 @@ The free desktop app does the same visually: [latest release](https://github.com
174
185
 
175
186
  ![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
187
 
177
- The nine examples that come with the app, each on its Check screen:
188
+ ![The nine bundled examples in the dark theme, three to a row, each robot in 3D beside its Check verdict. Top row: desk arm NO-GO, servo bench NO-GO, arm GO. Middle row: drone GO, humanoid GO, quadruped GO with notes. Bottom row: rover GO with notes, hexapod GO, parametric rover GO](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/every-example-3x3-dark.webp)
178
189
 
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)
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.
180
191
 
181
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".
182
193
  - **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
@@ -5,7 +5,11 @@
5
5
  </picture>
6
6
  </p>
7
7
 
8
- **From idea to robot: catch the error in your robot model before the real robot does.**
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).
9
13
 
10
14
  ## Check your robot
11
15
 
@@ -17,7 +21,7 @@ uvx lockwire check robot.urdf
17
21
  ```
18
22
 
19
23
  No robot file yet? This writes a small example arm, with its power and wiring, into the current folder
20
- and checks it:
24
+ (two files, `lockwire.yaml` and `lockwire.plan.yaml`) and checks it:
21
25
 
22
26
  ```bash
23
27
  uvx lockwire start --example arm-power
@@ -60,7 +64,9 @@ uvx lockwire start robot.urdf
60
64
  This writes `lockwire.yaml`, the robot's physics lockfile: every link's mass, centre of mass and
61
65
  inertia, every joint limit, and a hash of the model's structure. Commit it next to your model.
62
66
  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.
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.
64
70
 
65
71
  ## Run it in CI
66
72
 
@@ -90,8 +96,9 @@ uvx lockwire agent-setup
90
96
  ```
91
97
 
92
98
  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).
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).
95
102
 
96
103
  ## No robot file? Try an example
97
104
 
@@ -118,13 +125,17 @@ The examples that pass the check (`lockwire start --example drone`, `rover`, `ar
118
125
 
119
126
  ## Features
120
127
 
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.
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">
125
137
 
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
138
+ More in [the guides](https://github.com/Shivansh2703/lockwire/blob/main/docs/guides/index.md). The powered-on
128
139
  preflight gate, ROS 2 bags and drift tracked across many units are Lockwire Pro, waitlist only: https://lockwirerobotics.com.
129
140
 
130
141
  ## Download the app
@@ -133,9 +144,9 @@ The free desktop app does the same visually: [latest release](https://github.com
133
144
 
134
145
  ![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
146
 
136
- The nine examples that come with the app, each on its Check screen:
147
+ ![The nine bundled examples in the dark theme, three to a row, each robot in 3D beside its Check verdict. Top row: desk arm NO-GO, servo bench NO-GO, arm GO. Middle row: drone GO, humanoid GO, quadruped GO with notes. Bottom row: rover GO with notes, hexapod GO, parametric rover GO](https://raw.githubusercontent.com/Shivansh2703/lockwire/main/docs/img/every-example-3x3-dark.webp)
137
148
 
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)
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.
139
150
 
140
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".
141
152
  - **Linux:** `chmod +x Lockwire-*.AppImage`, then run it. Ubuntu 22.04 needs `sudo apt install libfuse2`; 24.04 needs `libfuse2t64`.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lockwire"
3
- version = "0.5.3"
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 = [
@@ -111,6 +111,9 @@ dev = [
111
111
  # passed while `ruff format` wanted to rewrite 12 files. At 100 the sweep is a net
112
112
  # reduction (83 insertions / 105 deletions); at 88 it was +219/-80.
113
113
  line-length = 100
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"]
114
117
 
115
118
  [tool.pytest.ini_options]
116
119
  pythonpath = ["."]
@@ -1,6 +1,6 @@
1
1
  """Lockwire - the physical-assumption contract for robots, enforced in CI and at preflight."""
2
2
 
3
- __version__ = "0.5.3"
3
+ __version__ = "0.5.4"
4
4
 
5
5
 
6
6
  def main() -> None:
@@ -1,11 +1,14 @@
1
1
  """`lockwire agent-setup`: put the three agent rules, a pre-commit hook and a CI workflow in a repo."""
2
2
 
3
3
  import json
4
+ import os
4
5
  import re
6
+ import shutil
5
7
  import sys
6
8
  from pathlib import Path
7
9
 
8
10
  import lockwire
11
+ from lockwire.gitref import git_path
9
12
  from lockwire.cli_line import cli_line
10
13
 
11
14
  START, END = "<!-- lockwire:start -->", "<!-- lockwire:end -->"
@@ -62,7 +65,7 @@ _RUN = (
62
65
  _LAST = (
63
66
  " run lockwire; run uvx --from lockwire lockwire;"
64
67
  ' echo "lockwire could not be run, so this robot-model edit is blocked: install or repair it'
65
- ' (uv tool install lockwire, then lockwire agent-setup --claude) and retry, or remove the'
68
+ " (uv tool install lockwire, then lockwire agent-setup --claude) and retry, or remove the"
66
69
  ' PreToolUse entry with lockwire hook-check from .claude/settings.local.json"'
67
70
  " >&2; exit 2"
68
71
  )
@@ -73,13 +76,42 @@ GUARD = _GATE + _RUN + ' [ -x "$0" ] && run "$0" -m lockwire;' + _LAST
73
76
  GUARD_PORTABLE = _GATE + _RUN + _LAST
74
77
 
75
78
 
79
+ def _repo_root_for(root: Path) -> tuple[Path, str] | None:
80
+ """(top folder, ``root``'s path inside it) for a subfolder of a checkout or linked worktree.
81
+
82
+ A linked worktree's own top folder is its root for pre-commit and GitHub. None keeps today's
83
+ behaviour: files in ``root`` itself (not a repository, git missing, or ``root`` is the top).
84
+ """
85
+ top = git_path(root, "--show-toplevel")
86
+ if top is None or root.resolve() == top:
87
+ return None
88
+ return top, root.resolve().relative_to(top).as_posix()
89
+
90
+
91
+ def _can_append(old: str) -> bool:
92
+ """True when a hook entry written at two-space indent can go after the last line of ``old``."""
93
+ if not re.search(r"(?m)^repos:\s*(#.*)?$", old):
94
+ return False
95
+ after = old[re.search(r"(?m)^repos:", old).end() :]
96
+ if re.search(r"(?m)^[A-Za-z_][\w-]*\s*:", after): # a later top-level key
97
+ return False
98
+ return all(m == " " for m in re.findall(r"(?m)^(\s*)- repo:", old))
99
+
100
+
76
101
  def agent_setup(root: Path, *, ci_only: bool = False) -> list[str]:
77
- """Write what is missing under ``root``; return one line per file. Re-running changes nothing."""
102
+ """Write what is missing under ``root``; return one line per file. Re-running changes nothing.
103
+
104
+ In a subfolder of a git repository the pre-commit config and the workflow go to the repository
105
+ root (pre-commit and GitHub read only there) and name the subfolder's lockfile.
106
+ """
78
107
  lines = []
108
+ sub = _repo_root_for(root)
79
109
 
80
- def put(name: str, text: str, *, append: bool = False, head: str = "") -> None:
81
- # ponytail: fixed names under root, so no `confine` (it refuses .yaml targets by design).
82
- path = root / name
110
+ def put(
111
+ name: str, text: str, *, append: bool = False, head: str = "", base: Path = root
112
+ ) -> None:
113
+ # ponytail: fixed names under base, so no `confine` (it refuses .yaml targets by design).
114
+ path = base / name
83
115
  old = path.read_text(encoding="utf-8") if path.exists() else None
84
116
  if old is not None and (not append or text.split("\n")[0] in old):
85
117
  lines.append(f"kept {name}")
@@ -92,6 +124,39 @@ def agent_setup(root: Path, *, ci_only: bool = False) -> list[str]:
92
124
 
93
125
  for name in () if ci_only else ("CLAUDE.md", "AGENTS.md"):
94
126
  put(name, rules(), append=True)
127
+ if sub:
128
+ top, rel = sub
129
+ contract = f"{rel}/lockwire.yaml"
130
+ if not ci_only:
131
+ _sub_pre_commit(top, rel, contract, lines)
132
+ slug = re.sub(r"[^a-z0-9]+", "-", rel.lower()).strip("-")
133
+ name = f".github/workflows/lockwire-{slug}.yml"
134
+ lines.append(
135
+ f"{top / name}: this folder is inside a git repository; GitHub runs workflows only "
136
+ "from the repository root"
137
+ )
138
+ text = WORKFLOW.replace("name: lockwire\n", f"name: lockwire {rel}\n").replace(
139
+ "lockwire.yaml", _q(contract)
140
+ )
141
+ mine = f"contract: {_q(contract)}"
142
+ found = (top / name).is_file() and re.search(
143
+ r"(?m)^\s*contract:.*$", (top / name).read_text(encoding="utf-8")
144
+ )
145
+ if found and found[0].strip() != mine: # another robot's file, or its line is gone
146
+ lines.append(
147
+ f"{name} already checks another robot ({found[0].strip()[10:].strip()}); "
148
+ f"{contract} is not checked by CI: save these lines as another workflow file"
149
+ )
150
+ lines.extend(text.rstrip("\n").split("\n"))
151
+ elif (top / name).is_file() and not found:
152
+ lines.append(
153
+ f"{name} already checks another robot (no contract line); {contract} is not "
154
+ "checked by CI: save these lines as another workflow file"
155
+ )
156
+ lines.extend(text.rstrip("\n").split("\n"))
157
+ else:
158
+ put(name, text, base=top)
159
+ return lines
95
160
  # ponytail: appends after the last line, so a config whose `repos:` is not last needs a hand merge.
96
161
  if not ci_only:
97
162
  # the hook pins the lockwire that wrote it: an older one refuses the lockfiles this one writes
@@ -108,6 +173,41 @@ def agent_setup(root: Path, *, ci_only: bool = False) -> list[str]:
108
173
  return lines
109
174
 
110
175
 
176
+ def _q(s: str) -> str:
177
+ """``s`` as a YAML scalar: bare when it is plain path characters, else double-quoted."""
178
+ return s if re.fullmatch(r"[\w./-]+", s) else json.dumps(s)
179
+
180
+
181
+ def _sub_pre_commit(top: Path, rel: str, contract: str, lines: list[str]) -> None:
182
+ """One hook entry per robot in the repository root's config, found again by its ``args`` line."""
183
+ path = top / ".pre-commit-config.yaml"
184
+ lines.append(
185
+ f"{path}: this folder is inside a git repository; pre-commit reads its config only at "
186
+ "the repository root"
187
+ )
188
+ args = f"args: [{_q(contract)}]"
189
+ files = f"files: (?i)^{re.escape(rel)}/(.*\\.(urdf|xacro|sdf)|(.*/)?lockwire\\.ya?ml)$"
190
+ if not rel.replace("/", "").replace("-", "").replace("_", "").isalnum(): # not plain: quote
191
+ files = "files: " + json.dumps(files[7:])
192
+ entry = PRE_COMMIT.split(" files:")[0].format(version=lockwire.__version__)
193
+ entry += f" {files}\n {args}\n"
194
+ old = path.read_text(encoding="utf-8") if path.exists() else None
195
+ if old is not None and args in old:
196
+ lines.append("kept .pre-commit-config.yaml")
197
+ elif old is not None and not _can_append(old):
198
+ lines.append(
199
+ f"{path.name} already has content this tool cannot add to; {contract} is not checked "
200
+ "by the commit hook: add these lines by hand under repos:"
201
+ )
202
+ lines.extend(entry.rstrip("\n").split("\n"))
203
+ else:
204
+ path.write_text(
205
+ "repos:\n" + entry if old is None else old.rstrip("\n") + "\n" + entry,
206
+ encoding="utf-8",
207
+ )
208
+ lines.append("wrote .pre-commit-config.yaml")
209
+
210
+
111
211
  def stale_pin(config: str) -> str | None:
112
212
  """The rev of the Lockwire pre-commit entry when it is older than this Lockwire, else None."""
113
213
  found = re.search(r"Shivansh2703/lockwire\s*\n\s*rev:\s*['\"]?([^\s'\"]+)", config)
@@ -164,6 +264,64 @@ def _move_out_of_shared(root: Path) -> str | None:
164
264
  )
165
265
 
166
266
 
267
+ def _on_windows() -> bool:
268
+ return os.name == "nt"
269
+
270
+
271
+ def local_settings_root(root: Path) -> tuple[Path, str]:
272
+ """Where Claude Code reads ``.claude/settings.local.json`` for ``root``, and one line saying why.
273
+
274
+ In a linked git worktree that is the main checkout (git's common dir is ``<main>/.git``); in a
275
+ subfolder of a normal checkout it is the repository root; anywhere else, or if git is missing
276
+ or the layout is unclear, it is ``root`` itself.
277
+ """
278
+ top, common = git_path(root, "--show-toplevel"), git_path(root, "--git-common-dir")
279
+ if top is None or common is None: # not a repo (or git missing): today's behaviour
280
+ return root, "" if shutil.which(
281
+ "git"
282
+ ) else "git is not available, so this folder is used as is"
283
+ if common == top / ".git":
284
+ if root.resolve() == top:
285
+ return root, ""
286
+ if _on_windows():
287
+ return (
288
+ root,
289
+ "this folder is inside a git repository, but on Windows Claude Code reads local settings here",
290
+ )
291
+ if top == Path.home().resolve():
292
+ return (
293
+ root,
294
+ "the repository root is your home folder, so Claude Code reads local settings here",
295
+ )
296
+ return (
297
+ top,
298
+ "this folder is inside a git repository; Claude Code reads local settings from the repository root",
299
+ )
300
+ main = common.parent
301
+ gitdir = git_path(root, "--git-dir") # a registered linked worktree: <common>/worktrees/<name>
302
+ if (
303
+ gitdir is None
304
+ or gitdir.parent != common / "worktrees"
305
+ or common.name != ".git"
306
+ or not (main / ".git").is_dir()
307
+ or git_path(main, "--show-toplevel") != main
308
+ ):
309
+ return root, "git layout unclear (no main checkout found), so this folder is used as is"
310
+ # Claude Code also keeps the file beside settings.json when the repo root is not owned by the
311
+ # user; that ownership check is out of scope here (worktree and subfolder cases alike).
312
+ if _on_windows():
313
+ return root, "this is a git worktree, but on Windows Claude Code reads local settings here"
314
+ if main == Path.home().resolve():
315
+ return (
316
+ root,
317
+ "this is a git worktree of your home folder, so Claude Code reads local settings here",
318
+ )
319
+ return (
320
+ main,
321
+ "this folder is a git worktree; Claude Code reads local settings from the main checkout",
322
+ )
323
+
324
+
167
325
  def claude_hook(root: Path) -> list[str]:
168
326
  """Merge the PreToolUse edit hook into ``root/.claude/settings.local.json``; re-running adds nothing.
169
327
 
@@ -181,7 +339,10 @@ def claude_hook(root: Path) -> list[str]:
181
339
  )
182
340
  moved = _move_out_of_shared(root)
183
341
  lines = [moved] if moved else []
184
- path = root / ".claude" / "settings.local.json"
342
+ target, why = local_settings_root(root)
343
+ path = target / ".claude" / "settings.local.json"
344
+ if why:
345
+ lines.append(f"{path}: {why}" if target != root else why)
185
346
  settings = json.loads(path.read_text(encoding="utf-8")) if path.exists() else {}
186
347
  groups = settings.setdefault("hooks", {}).setdefault("PreToolUse", [])
187
348
  ours = [h for g in groups for h in g.get("hooks", []) if _is_ours(h)]