feat(understand): drawing_topology_check and the three topo_* critique focuses

engineering/understand/topology.py reads a line network (LINE, polylines
with true bulge arcs, ARC) on the chosen layers and reports dangling
ends, near misses (end-end and end-segment within gap, one row per pair)
and interior crossings of two straight segments of one layer. An end on
another network line is joined; an end on any curve of another layer or
inside a block reference's box is attached; a line drawn twice is not a
join, so a doubled pipe still dangles. gap defaults to 0.2 % of the
network diagonal, never under ten tol.

drawing_topology_check joins drawing_diff in SECTION 26: default layers
are those classify_layer calls piping or electrical at >= 0.9, reported
with their classification; no such layer is a refusal, not a pass.

topo_dangling_endpoint (warning), topo_near_miss (error) and
topo_interior_crossing (info) join the closed enum and run under
focus=None, excluding the P&ID and architectural layer sets, so a
pid_from_spec sheet and an arch_plan_from_spec plan get none of them;
a drawing with no candidate layer is never snapshotted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
Umut CAN
2026-09-24 12:20:24 +03:00
co-authored by Claude Opus 5.5
parent 30f886c240
commit 2b74bf20a6
12 changed files with 1585 additions and 15 deletions
+8 -7
View File
@@ -495,7 +495,7 @@ async def test_tool_groups_is_byte_identical_to_the_source_declared_grouping():
async def test_tool_group_sizes_are_unchanged():
"""Frozen snapshot of the surface (242 tools, 26 groups).
"""Frozen snapshot of the surface (243 tools, 26 groups).
Taken before @cad_tool landed at 131 tools; `batch` moved 2 -> 3 when
v1.5.0's `cad_batch` joined `entity_batch_create`/`entity_batch_modify`, and
@@ -593,14 +593,15 @@ async def test_tool_group_sizes_are_unchanged():
pre-track-F value.
Track H group D opened its copy of SECTION 26 (Understanding & QA) with
`drawing_diff`, tagged `analysis` and `query`; `analysis` outranks `query`
in `_GROUP_TAG_PRIORITY`, so it files under `analysis` (12 -> 13). This
snapshot is branch-local: the track H merge recomputes it once the
understand, network and diff branches have landed.
`drawing_diff` and `drawing_topology_check`, both tagged `analysis` and
`query`; `analysis` outranks `query` in `_GROUP_TAG_PRIORITY`, so both file
under `analysis` (12 -> 14). This snapshot is branch-local: the track H
merge recomputes it once the understand, network and diff branches have
landed.
"""
sizes = {label: len(names) for label, names in (await server._tool_groups()).items()}
assert sizes == {
"analysis": 13,
"analysis": 14,
"architecture": 12,
"batch": 3,
"blocks": 9,
@@ -627,4 +628,4 @@ async def test_tool_group_sizes_are_unchanged():
"validation": 1,
"view": 4,
}
assert sum(sizes.values()) == 242
assert sum(sizes.values()) == 243