fix(understand): drawing_diff minors from the review — direction, repeated tags, bounded output
The review of Task 9 left four minor findings. Three change what a user reads: - A LINE drawn back to front and moved was reported as a geometry change. The signature already ignores a LINE's direction, so its movement now does too: the reversed order is tried before the entity is called reshaped. - An INSERT carrying one attribute tag twice was read as a dict. An edit of the first value could disappear, and since the pair then had nothing to report, it counted as unchanged. A repeated tag is now compared as the list of its values; a tag carried once keeps plain from / to. - cap_report capped the three lists but not the clusters. A widespread edit of a large drawing could return an unbounded cluster list. It is capped like the others, with truncated["clusters"]; the markup still clouds every cluster. The fourth bounds work: when the whole drawing moves, every entity reaches the position stage, and a generous move_tol gave each one hundreds of candidates, which is n x m memory. Only the 32 nearest per entity are kept now. A 200-line test shows each line still pairs with its own moved copy. The first three tests failed against the previous module (the attribute test with no changed row at all). The whole diff suite passes: 38 tests. 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:
co-authored by
Claude Opus 5.5
parent
2b74bf20a6
commit
1795dc7f2c
@@ -46,7 +46,7 @@ async def test_the_current_document_against_its_older_revision(client, tmp_path)
|
||||
pair["insert"],
|
||||
}
|
||||
assert result["blocks"]["compared"] is True and result["blocks"]["changed"] == []
|
||||
assert result["truncated"] == {"changed": 0, "added": 0, "removed": 0}
|
||||
assert result["truncated"] == {"changed": 0, "added": 0, "removed": 0, "clusters": 0}
|
||||
assert await _total(client) == before, "a diff without markup writes nothing"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user