pipe_takeoff merged line ends closer than tol = 1.0 drawing units and
silently dropped any segment shorter than that. On a millimetre P&ID that is
1 mm. On a metre drawing it is a metre: ends a metre apart were merged and
every pipe under a metre disappeared from the totals, with no warning. The
review of the network engine found this.
- tol now defaults to 1 mm in the unit the P&ID's geometry implies: 1.0 on
a millimetre drawing, 0.001 on a metre one. A tol the caller gives is
used as given.
- build_network counts the segments that collapse to a point
(stats.segments_below_tol), and pipe_rows turns a non-zero count into a
warning naming the tolerance.
A new wire test builds a metre P&ID with a 0.6 m pipe and a 5 m pipe. Before
this change the takeoff said 5.0 m; now it says 5.6 m. The network test
checks that a sub-tolerance stub is counted. Registry, packs, aliases and
every track H suite: 472 passed. The inventory matches the live surface.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
The merge agent stopped this branch on an add/add conflict it had not been
told to expect: groups U and N each created tests/test_understand_tools.py.
Resolved by hand:
- tests/test_understand_tools.py stays U's (the drawing_understand wire
tests), and N's takeoff wire tests move whole to
tests/test_understand_takeoff_tools.py. Each file keeps its own client
fixture: U's opens a fresh document, N's reads files only.
- server.py: SECTION 26 (4 tools, U then D) is kept as merged, and SECTION
27 (Plant Takeoffs, 2 tools) follows it whole, above the RESOURCES
banner.
- discovery/aliases.py: additive; the two takeoff records follow the four
readers.
- tests/test_tool_registry.py: all three branches' paragraphs are kept.
The snapshot is recomputed from the live registry: analysis 18, 247
tools. Task 11 ranks `understand` and `plant`.
- docs/tool-inventory.json regenerated (247 tools, 26 groups); README
counts are 247 registered / 242 advertised. The collected-tests figure
is left to Task 11.
ruff check passes. Suite: 4919 passed, 1 xfailed. The one deselected test
is the collected-tests figure.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd