Shape.Remove can leave a spanning annotation anchored to a removed end segment
Maintainer thường phản hồi trong vòng 1 ngày
@johnml1135 đang làm issue này rồi.
Từ ngày 23/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
Start in Shape.Remove, follow the call to Shape.UpdateAnnotations, then inspect AnnotationList.Find for directional range boundaries. Use the deterministic reproduction in the issue as the first check, then add the requested single-span and tied-span controls for both endpoint directions, including last and interior segment removal. Done means surviving annotations have endpoints in the shape, payloads and unaffected annotations are preserved, and empty spans are removed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Removing the rightmost segment of a shape can leave a spanning annotation pointing at the detached node instead of shrinking its end to the previous segment. A single spanning annotation is enough; this is separate from #506's tied-node skip-list fix and #554's equal-container descent.
I reran this minimal reproduction against the #506 candidate based on 259920414132bdd5a85542722d9af5509aed8943, with the first-match-in-search-direction change in BidirList.Find. No Shape.Remove or AnnotationList.Find(offset, direction) changes are included in that candidate.
Expected after removing nodes[3]: the annotation spans [nodes[1], nodes[2]], and none of its endpoints refers to nodes[3].
Observed:
singleSpanRightShrink=False; staleEndpoint=True
Reproduction (reference src/SIL.Machine/SIL.Machine.csproj; RNG seeding is confined to this test instance):
using System.Reflection;
using SIL.Machine.Annotations;
using SIL.Machine.DataStructures;
using SIL.Machine.FeatureModel;
var annotations = new AnnotationList<ShapeNode>();
typeof(BidirList<Annotation<ShapeNode>>)
.GetField("_rand", BindingFlags.Instance | BindingFlags.NonPublic)!
.SetValue(annotations, new Random(0));
var shape = new Shape(begin => new ShapeNode(FeatureStruct.New().Value), annotations);
ShapeNode[] nodes = Enumerable.Range(0, 4).Select(_ => shape.Add(FeatureStruct.New().Value)).ToArray();
var span = new Annotation<ShapeNode>(Range<ShapeNode>.Create(nodes[1], nodes[3]), FeatureStruct.New().Value);
shape.Annotations.Add(span, false);
shape.Remove(nodes[3]);
bool shrunk = shape.Annotations.Any(annotation => annotation.Range.Start == nodes[1] && annotation.Range.End == nodes[2]);
bool stale = shape.Annotations.Any(annotation => annotation.Range.Start == nodes[1] && annotation.Range.End == nodes[3]);
Console.WriteLine($"singleSpanRightShrink={shrunk}; staleEndpoint={stale}");
The source path is Shape.Remove → Shape.UpdateAnnotations → AnnotationList.Find for the directional range boundaries. The new #506 tests distinguish tie-boundary loss from this existing right-end range case; fixing tie equality alone does not repair it.
Acceptance criteria:
- Correctly shrink a spanning annotation when its ending segment is removed, including the shape's last segment and an interior segment.
- Preserve annotation payloads/children and unaffected annotations; remove only annotations whose span becomes empty.
- Include deterministic single-span and tied-span controls, both endpoint directions, and verify actual endpoint membership in the surviving shape.
- Keep this follow-up independently reviewable from #506 and #554. No HermitCrab grammar manifestation has been demonstrated by this reproduction.
- Ngôn ngữ chính
- C#
- Star
- 29
- Fork
- 16
- Merge trung bình
- 6 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sillsdev/machine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Port 'Fix verse range marker placement bug'Có thể đã có người làm @claude đã nhận hôm nay. Đang mởporting
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
sillsdev/machine#558 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AnnotationList.FindDepthFirst misses descendants in tied containers depending on insertion orderCó thể đã có người làm @johnml1135 đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Hermit Crab
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
sillsdev/machine#552 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HermitCrab: partial lexical entries switch off final-template pruning for the whole grammarCó thể đã có người làm @johnml1135 đã nhận 3 ngày trước. Đang mởHermit Crab
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
sillsdev/machine#551 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sillsdev/machine
Issue tương tự
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dotnet/dotnet-api-docs#13210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aspnet-core/svc doc-enhancement mvc/subsvc Pri2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dotnet/AspNetCore.Docs#38016 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
HicServices/RDMP#2398 ·
-
[Android] Memory leak in MAUI Graphics text drawing and measurement during repeated renderingĐang mởarea-drawing platform/android t/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
dotnet/maui#39676 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày