Skip to content

Commit 5dddf3d

Browse files
committed
fix: require archive suggestion threshold
1 parent d981d3e commit 5dddf3d

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

evals/check_watchlist.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ def validate_top_level_fields(text: str, result: ValidationResult, options: Vali
250250
f"Invalid archive_policy: {archive_policy}. Use manual or suggest.",
251251
)
252252

253+
if archive_policy == "suggest" and archive_after_days is None:
254+
add_format_finding(
255+
result,
256+
options,
257+
"ARCHIVE_SUGGEST_WITHOUT_ARCHIVE_AFTER_DAYS",
258+
"archive_policy: suggest requires archive_after_days.",
259+
)
260+
return
261+
253262
if archive_after_days is None:
254263
return
255264

evals/test_check_watchlist.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,29 @@ def test_archive_after_days_without_policy_fails_strict_format(self):
291291
"--strict-format",
292292
)
293293

294+
def test_archive_suggest_without_after_days_warns_by_default(self):
295+
text = VALID_WATCHLIST.replace(
296+
"timezone: Asia/Seoul\n",
297+
"timezone: Asia/Seoul\narchive_policy: suggest\n",
298+
)
299+
300+
result = self.run_check(text)
301+
302+
self.assertEqual(result.returncode, 0, result.stderr + result.stdout)
303+
self.assertIn("ARCHIVE_SUGGEST_WITHOUT_ARCHIVE_AFTER_DAYS", result.stdout)
304+
305+
def test_archive_suggest_without_after_days_fails_strict_format(self):
306+
text = VALID_WATCHLIST.replace(
307+
"timezone: Asia/Seoul\n",
308+
"timezone: Asia/Seoul\narchive_policy: suggest\n",
309+
)
310+
311+
self.assert_check_fails_with_args(
312+
text,
313+
"ARCHIVE_SUGGEST_WITHOUT_ARCHIVE_AFTER_DAYS",
314+
"--strict-format",
315+
)
316+
294317
def test_strict_safety_rejects_bearer_token(self):
295318
text = VALID_WATCHLIST.replace(
296319
"- source: GitHub Actions run for PR #12",

0 commit comments

Comments
 (0)