fix(task-6): the reader no longer hands a signal line the neighbouring pipe's label
pid_graph step 5 ran the TEXT label fallback for every edge without a
number. Once signal lines stopped carrying a fabricated number (3c0babf),
every pneumatic/electric run drawn by pid_line_draw entered it, and a
transmitter-to-controller run 12 mm above a labelled header came back as
line_number="100-P-1", number_source="label" — on both engines, with no
confidence field on edges to flag it.
The fallback now skips an edge that carries its own record (an
ACADMCP_PID payload: its `number: null` is the answer) and any
signal-class edge, payload or layer-classified (`signal_unknown`
included): LINE_NUMBER_RE is the pipe grammar, so a match near a signal
line always belongs to a neighbouring pipe. A foreign process line still
takes its label; a verbatim number on a signal line still reads back
from XDATA.
Tests: the finding's layout in test_pid_graph (engine-drawn signal beside
a labelled pipe, verbatim signal number, foreign electric and
signal_unknown lines beside a labelled foreign pipe) and the line_list
row in test_pid_deliverables — three of the four fail on the old reader.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
co-authored by
Claude Opus 5
parent
3c0babfef1
commit
cfb5d5082c
@@ -137,6 +137,30 @@ async def test_line_list_rows(backend):
|
||||
assert hand_drawn["to_tag"] is None and hand_drawn["number_source"] is None
|
||||
|
||||
|
||||
async def test_line_list_keeps_a_signal_line_unnumbered_beside_a_labelled_pipe(backend):
|
||||
"""The line list prints what the reader publishes, and the reader must not
|
||||
hand a 12 mm-parallel signal run the header's label (its own XDATA says
|
||||
``number: null``)."""
|
||||
proc = await draw_line(
|
||||
backend, {"x": 20, "y": 100}, {"x": 200, "y": 100}, size="100", service="P"
|
||||
)
|
||||
ft = await place_symbol(
|
||||
backend, "instrument", 40, 112, tag="FT-1", type="dcs", location="primary"
|
||||
)
|
||||
fic = await place_symbol(
|
||||
backend, "instrument", 180, 112, tag="FIC-1", type="dcs", location="primary"
|
||||
)
|
||||
sig = await draw_line(backend, {"handle": ft["handle"]}, {"handle": fic["handle"]}, "electric")
|
||||
rows = {r["handle"]: r for r in line_list(await build_graph(backend))}
|
||||
assert (rows[proc["handle"]]["line_number"], rows[proc["handle"]]["number_source"]) == (
|
||||
"100-P-1",
|
||||
"xdata",
|
||||
)
|
||||
signal = rows[sig["handle"]]
|
||||
assert (signal["line_number"], signal["number_source"]) == (None, None)
|
||||
assert (signal["from_tag"], signal["to_tag"]) == ("FT-1", "FIC-1")
|
||||
|
||||
|
||||
async def test_equipment_list_rows(backend):
|
||||
graph = await _pid(backend)
|
||||
rows = equipment_list(graph)
|
||||
|
||||
Reference in New Issue
Block a user