diff --git a/changelog.d/2863-timed-scan-verdict-negation-table-cell.md b/changelog.d/2863-timed-scan-verdict-negation-table-cell.md new file mode 100644 index 00000000..9f306ee2 --- /dev/null +++ b/changelog.d/2863-timed-scan-verdict-negation-table-cell.md @@ -0,0 +1 @@ +- **Timed-test scan: "판정 없이 지났습니다" no longer silences an expired test, and an hour offset in a table row is demoted in relative mode (#2863).** `VERDICT` matched a bare "판정", so a comment after the booked end saying none was given ("종료 시각이 판정 없이 지났습니다", "미판정 상태로 종료 시각이 지났습니다") read as a heading verdict and the expired finding disappeared. `VERDICT` now shares the exclusions #2864 gave `SETTLED` (`미판정`, `판정(이/은/도) 없…`, `판정 주체/예정/대기`; `판정 기준` still counts), and the first-line `EARLY_VERDICT` excludes the same negations, so such a comment no longer opens the follow-up window either. A re-booking ("판정이 없어 새 종료 일시를 정합니다: 2026-11-30 09:00 KST") is judged on its own new end, and "판정: 합격 — 유지" still settles. In relative mode, `table-cell-content` demotes an `N시간 후/뒤` in a markdown table row with no judging word or `종료` in the row (nclex#1112 "| … | 석고붕대 6시간 후 사정 |"); a2a-nexus#2395 and family-messenger#404 stay high. diff --git a/docs/timed-test-deadline-scan.md b/docs/timed-test-deadline-scan.md index 33f10e4d..86c1bba3 100644 --- a/docs/timed-test-deadline-scan.md +++ b/docs/timed-test-deadline-scan.md @@ -60,7 +60,10 @@ later comment promised a follow-up at an absolute datetime that has passed with verdict so far), `cross-reference`, `already-settled`, `claim-eta`, `date-only`. "판정" marks a completion report only as a verdict that was given: `미판정`, `판정이 없어` / `판정 없이` and `판정 주체/예정/대기` do not - demote a booking (#2863). A time already past when the comment was posted is a record, + demote a booking (#2863), and they are not a verdict either: a comment after + the end that says `판정 없이 지났습니다` or `미판정 상태로 …` leaves the + expired finding up, and does not open the follow-up window. `판정 기준` + stays a verdict word. A time already past when the comment was posted is a record, not a promise (`past-at-posting`), and is never reported. - `--include-closed-days N` (followup mode only, default 0 = open issues only) also fetches issues closed on or after `now - N days` with a second @@ -136,8 +139,9 @@ under `dropped_candidates`. Checked in this order: | `interval-unit` | the unit of a gap being described: an interval noun (`간격`, `주기`, `빈도`) within 8 characters before the term and `단위` right after it, with no judging word (`판정`, `확인`, `점검`, `승격`, …) in the rest of the sentence | nclex#974 (#2901) | | `system-behaviour` | what the system does by itself once a condition holds: a conditional or concessive ending (`…면`, `…아도/어도/해도`) earlier in the **same sentence**, then — within 60 characters after the term, up to the sentence end or table bar — an alert/state noun (`알림`, `경고`, `표시`, `상태`, `만료`, `expired`, `stale`, …) and a closing plain present verb (`나옵니다`, `간다`, `뜬다`, `바뀐다`, …), with no judging word in between. `문제가 없으면 24시간 뒤 알림을 확인한다` and `조건이 맞으면 24시간 뒤 승격됩니다` stay high | ccc-node#2137, iphone-agent-cast#179 (#2901) | | `past-event-offset` | how long something already took, in incident forensics: a past-tense predicate (`일어났고`, `걸렸다`, `였다`, `이었습니다`, `했습니다` — a syllable ending in ㅆ other than `있`/`겠`, with a finished ending) within 25 characters after the term, in the same clause (no comma or sentence end in between). `없었다면`, `됐는지`, `뒤에야 판정할 수 있다` stay windows | family-messenger#616, ccc-node#2635 | +| `table-cell-content` | an hour offset (`N시간 후`/`N시간 뒤`) in a markdown table row (a line starting with `\|`), with no judging word (`판정`, `확인`, `점검`, `승격`, …) and no `종료` anywhere in the row: the row's content, such as a nursing step in a question table. `\| 롤백 \| 24시간 후 판정 \|` stays high, and so does the same content outside a table or a `며칠`/`T+24h` in a row | nclex#1112 (#2863) | -The last eight (from `operational-wording` down) judge the wording, so they never apply when the paragraph names +The last nine (from `operational-wording` down) judge the wording, so they never apply when the paragraph names an observation (`관찰`, `관측`, `소크`, `카나리`, `모니터링`, `파일럿`, `시범 운영`, `soak`, `canary`, `monitor`, `observ…`, `pilot`, `burn-in`), and every unquoted term in the paragraph must be explained by one of them. The diff --git a/scripts/timed_test_deadline_scan.py b/scripts/timed_test_deadline_scan.py index 12a773f2..12d9fcc8 100644 --- a/scripts/timed_test_deadline_scan.py +++ b/scripts/timed_test_deadline_scan.py @@ -173,8 +173,18 @@ # reported at high confidence. Bare "완료" and "✅" stay out — both lead # ordinary progress updates ("yukson 연결 완료") that say nothing about the # test — and the whole regex still only sees the heading window. +# +# "판정" counts only as a verdict that was given (_GIVEN_VERDICT, shared with +# SETTLED below). A post-deadline comment saying none was given — "종료 시각이 +# 판정 없이 지났습니다", "미판정 상태로 종료 시각이 지났습니다" — is exactly +# the case expired mode exists for, yet the bare word read it as a heading +# verdict and silenced the alert (#2863). Excluded: 미판정, 판정(이/은/도) 없…, +# 판정 주체/예정/대기. "판정 기준" stays a verdict word: real verdicts write +# "판정 기준 충족". A re-booking ("판정이 없어 새 종료 일시를 정합니다: …") +# carries its own later deadline, which is judged on its own. +_GIVEN_VERDICT = r"(? str: # "판정 주체 오너" each demoted a real booking to already-settled, which is # never a booking (NOT_A_BOOKING), so the deadline it set was not tracked # (#2863; iphone-agent-cast#87/#89, 2026-11-15). Excluded: 미판정, 판정(이/은/도) -# 없…, 판정 주체/예정/대기. VERDICT is deliberately left as it is. +# 없…, 판정 주체/예정/대기 — the same _GIVEN_VERDICT that VERDICT uses. SETTLED = re.compile( r"(완료|✅|통과|합격|불합격|종료\s*보고|결과\s*갱신|실제\s*종료" - r"|(? str: REL_SYSTEM = "system-behaviour" # ccc-node#2137 "…않으면 24시간 뒤 `expired`로만 나옵니다" (#2901) REL_INTERVAL = "interval-unit" # nclex#974 "최근 글 간격 며칠 단위" (#2901) REL_PRACTICE = "generic-practice" # ccc-node#2827 "에이전트들이 며칠~몇 주 뒤의 관측을 … 걸고 있다" (#2901) +REL_TABLE_CELL = "table-cell-content" # nclex#1112 "| … | 석고붕대 6시간 후 사정 |" (#2863) # Issue-level shapes (#2817), applied after the paragraph rules above: REL_SUPERSEDED = "superseded-by-absolute" # iphone-agent-cast#87/#89 REL_NOT_STARTED = "not-started" # a2a-nexus#2395 @@ -417,6 +434,17 @@ def _first_line(body: str) -> str: PRACTICE_SUBJECT = re.compile(r"[가-힣]들(?:이|은|도)\s") PRACTICE_PREDICATE = re.compile(r"고\s*있(?:다|습니다|음|어요)[\s*_`))]*$") PRACTICE_WINDOW_CHARS = 80 +# An hour offset inside a markdown table row is the row's content, not a +# booking (#2863): nclex#1112's item table had "| 4 | `RN-BASIC-0039` | … | +# 전완 골절 도수정복·석고붕대 6시간 후 사정 |" — a nursing step in a question, +# re-reported every three days. Only "N시간 후/뒤" is judged this way, and a +# test word anywhere in the same row keeps it a window: an observation word +# (the guard before every wording rule), a judging word (판정·확인 …) or +# TABLE_TEST_WORD (종료). The rows of a test plan ("| 롤백 | 24시간 뒤 판정 |") +# say one of these. +TABLE_ROW = re.compile(r"^\s*\|") +TABLE_HOUR_OFFSET = re.compile(r"^\d+\s*시간\s*(?:후|뒤)$") +TABLE_TEST_WORD = re.compile(r"종료") # Anchor + offset bookings (#2252). a2a-nexus#1504 booked Phase 7-B as # "실행 예약: … OnCalendar=2026-10-09 22:00:00 KST" with "B8: 관측 타이머 @@ -978,9 +1006,20 @@ def _wording_reason(paragraph: str, match: re.Match[str]) -> str | None: clause = _clause_after(paragraph, match) if PAST_PREDICATE.search(clause) and not FUTURE_INTENT.search(clause): return REL_PAST_EVENT + if _is_table_cell_content(paragraph, match): + return REL_TABLE_CELL return None +def _is_table_cell_content(paragraph: str, match: re.Match[str]) -> bool: + return bool( + TABLE_ROW.match(paragraph) + and TABLE_HOUR_OFFSET.match(match.group(0)) + and not JUDGING_WORD.search(paragraph) + and not TABLE_TEST_WORD.search(paragraph) + ) + + def classify_relative_paragraph( paragraph: str, *, @@ -1010,7 +1049,7 @@ def classify_relative_paragraph( checked before the observation guard below, because here the observation is what is being described. - The remaining eight judge the wording, so they never apply when the + The remaining nine judge the wording, so they never apply when the paragraph names an observation (``OBSERVATION_WORD``), and every unquoted term must be explained by one of them: @@ -1034,6 +1073,10 @@ def classify_relative_paragraph( ``past-event-offset`` how long something already took: a past-tense predicate in the term's clause ("15시간 뒤에야 일어났고", #2635). + ``table-cell-content`` an hour offset ("N시간 후/뒤") in a markdown + table row with no judging word or 종료 in the + row ("| … | 석고붕대 6시간 후 사정 |", + nclex#1112, #2863). """ if author is not None and not is_fleet_author(author): return REL_EXTERNAL_AUTHOR diff --git a/scripts/timed_test_deadline_scan_test.py b/scripts/timed_test_deadline_scan_test.py index 68ec17eb..b7c669fa 100644 --- a/scripts/timed_test_deadline_scan_test.py +++ b/scripts/timed_test_deadline_scan_test.py @@ -1455,6 +1455,115 @@ def test_the_live_booking_expires_at_high_confidence(self) -> None: ) +# The five synthetic cases from the #2863 decision comment (2026-11-27): a +# booking, then one comment after its end, judged in expired mode a week later. +VERDICT_2863_BOOKING = "종료 일시 2026-11-20 09:00 KST · 판정 주체 오너" +VERDICT_2863_BOOKED_AT = "2026-11-13T00:00:00Z" +VERDICT_2863_AFTER = "2026-11-21T00:00:00Z" # after the booked end +VERDICT_2863_END = dt.datetime(2026, 11, 20, 9, 0) +VERDICT_2863_NOW = dt.datetime(2026, 11, 27, 10, 0) + + +class VerdictNegation2863Tests(unittest.TestCase): + """A post-deadline comment saying no verdict was given must not count as one.""" + + def _judge(self, follow_up: str | None, now: dt.datetime = VERDICT_2863_NOW) -> scanner.Finding | None: + comments = [_rel_comment(VERDICT_2863_BOOKING, VERDICT_2863_BOOKED_AT, author="jinon86")] + if follow_up is not None: + comments.append(_rel_comment(follow_up, VERDICT_2863_AFTER, author="jinon86")) + return scanner.judge_issue(_rel_issue(comments=comments), now, "expired") + + def assertExpiredHigh(self, follow_up: str | None) -> None: + finding = self._judge(follow_up) + assert finding is not None, follow_up + self.assertEqual( + (finding.kind, finding.deadline, finding.confidence, finding.weak_reason), + ("expired-unjudged", VERDICT_2863_END, "high", None), + ) + + def test_no_follow_up_is_expired_high(self) -> None: + self.assertExpiredHigh(None) + + def test_passed_without_a_verdict_is_expired_high(self) -> None: + self.assertExpiredHigh("종료 시각이 판정 없이 지났습니다") + + def test_unjudged_state_is_expired_high(self) -> None: + self.assertExpiredHigh("미판정 상태로 종료 시각이 지났습니다") + + def test_other_negated_or_role_wording_is_not_a_verdict(self) -> None: + for follow_up in ("## 판정이 없습니다 — 오너 확인 필요", "판정은 없고 로그만 남았습니다", + "판정 예정 시각이 지났습니다", "판정 대기 중", "판정 주체: 오너"): + with self.subTest(follow_up=follow_up): + self.assertExpiredHigh(follow_up) + + def test_rebooking_without_a_verdict_is_a_new_deadline(self) -> None: + rebooking = "판정이 없어 새 종료 일시를 정합니다: 2026-11-30 09:00 KST" + self.assertIsNone(self._judge(rebooking)) # the new end has not passed + finding = self._judge(rebooking, now=dt.datetime(2026, 12, 1, 10, 0)) + assert finding is not None + self.assertEqual( + (finding.deadline, finding.confidence), (dt.datetime(2026, 11, 30, 9, 0), "high") + ) + + def test_a_given_verdict_still_settles(self) -> None: + for follow_up in ("판정: 합격 — 유지", "## 관측 종료 판정 — 불합격", + "## 판정 기준 충족 — 유지", "## 판정은 합격"): + with self.subTest(follow_up=follow_up): + self.assertIsNone(self._judge(follow_up)) + + def test_verdict_strength_ignores_negated_wording(self) -> None: + # The heading window opens followup mode; a negation must not open it. + self.assertIsNone(scanner._verdict_strength("종료 시각이 판정 없이 지났습니다")) + self.assertIsNone(scanner._verdict_strength("미판정 상태로 종료 시각이 지났습니다")) + self.assertEqual(scanner._verdict_strength("## 관측 종료 판정 — 합격"), "strict") + self.assertEqual(scanner._verdict_strength("메모\n관측 종료 판정은 아래에"), "heading") + + +# nclex#1112 (2026-11-27 relative rescan): an item table row whose clinical +# content holds an hour offset. +LINE_1112_ROW = "| 4 | `RN-BASIC-0039` | basic_care | 가설 우선순위 | 전완 골절 도수정복·석고붕대 6시간 후 사정 |" + + +class TableCellContent2863Tests(unittest.TestCase): + _judge = RelativeFalsePositive2901Tests._judge + assertDemoted = RelativeFalsePositive2901Tests.assertDemoted + assertFlagged = RelativeFalsePositive2901Tests.assertFlagged + + def test_hour_offset_in_a_table_row_is_demoted(self) -> None: + for line in ( + LINE_1112_ROW, + " | 2 | 수술 후 처치 | 배액관 24시간 뒤 제거 |", + ): + with self.subTest(line=line): + self.assertDemoted(_rel_issue(body=line, author="jinon86"), "table-cell-content") + self.assertDemoted(_rel_issue(comments=[_rel_comment(line)]), "table-cell-content") + + def test_a_test_word_in_the_row_keeps_it_high(self) -> None: + for line in ( + "| 롤백 | 배포 24시간 후 판정 |", + "| 3 | 배포 | 6시간 후 확인 |", + "| 소크 | 48시간 뒤 정리 |", + "| 카나리 | 12시간 뒤 승격 |", + "| 관측 | 24시간 후 |", + "| 배포 | 24시간 후 종료 |", + ): + with self.subTest(line=line): + self.assertFlagged(_rel_issue(comments=[_rel_comment(line)])) + + def test_only_hour_offsets_in_table_rows(self) -> None: + for line in ( + # Not a table row: the same content as prose stays a window. + "전완 골절 도수정복·석고붕대 6시간 후 사정", + # A table row, but the term is not an hour offset. + "| 4 | 배포 | 며칠 운영 |", + "| 4 | 배포 | T+24h |", + ): + with self.subTest(line=line): + self.assertFlagged(_rel_issue(comments=[_rel_comment(line)])) + # The documented true positives (family-messenger#404, a2a-nexus#2395) + # are not table rows; RelativeFalsePositive2544Tests keeps them high. + + class ReposFileTests(unittest.TestCase): """An unconfigured scheduled scan must never look like a clean scan.