feat: reach forward by the declared member count

This commit is contained in:
Abdessamad Derraz committed 2026-08-10 17:31:59 +02:00
1 parent 4f7aa5f853
commit 7ac19f4c9f
2 files changed
+6 -3

No files matched your search

+4 -1
View File
@@ -729,8 +729,11 @@ def verify_at_pin(part: RefPart, pin_lines, tokens) -> PartResult:
)
if not tokens:
return PartResult(part, "ANCHORED", None, None, None, [])
# An archive ref cites the line declaring the set; its members follow, one
# per line, so the window reaches forward as far as the entry has members.
reach = SELF_CHECK_CONTEXT + len(tokens)
lo = max(0, part.start - 1 - SELF_CHECK_CONTEXT)
hi = min(len(pin_lines), (part.end or part.start) + SELF_CHECK_CONTEXT)
hi = min(len(pin_lines), (part.end or part.start) + reach)
window = "\n".join(pin_lines[lo:hi]).lower()
if any(token in window for token in tokens):
return PartResult(part, "ANCHORED", None, None, None, [])