feature(1100): Discover .markdown posts and always log run summary
Extend the anniversary matcher to recursively scan both .md and .markdown posts under _posts/blog, retaining the existing filename validation and relative-path dedupe identifier so published-state bookkeeping keeps working. Drop the zero-counter short-circuit in log_run_summary so the run_complete line is always emitted on a successful pass. Debug and manual runs now clearly show that scanning completed and found nothing instead of going silent. Update matching, logging, and run-logging tests to cover the new extension and always-emit contract, and refresh the logging architecture doc accordingly.
This commit is contained in:
@@ -61,10 +61,19 @@ def test_log_run_summary_emits_one_line_with_counters() -> None:
|
||||
assert payload["posted_ids"] == ["x"]
|
||||
|
||||
|
||||
def test_log_run_summary_silent_when_no_matches() -> None:
|
||||
def test_log_run_summary_always_emits_summary_line_with_zero_counters() -> None:
|
||||
buf = _capture(logging.getLogger("tenbackward"))
|
||||
log_run_summary(0, 0, 0, 0, [])
|
||||
assert buf.getvalue() == ""
|
||||
lines = [line for line in buf.getvalue().splitlines() if line.strip()]
|
||||
assert len(lines) == 1
|
||||
payload = json.loads(lines[0])
|
||||
assert payload["message"] == "run complete"
|
||||
assert payload["event"] == "run_complete"
|
||||
assert payload["scanned"] == 0
|
||||
assert payload["matched"] == 0
|
||||
assert payload["posted"] == 0
|
||||
assert payload["skipped"] == 0
|
||||
assert payload["posted_ids"] == []
|
||||
|
||||
|
||||
def test_log_startup_emits_single_info_line() -> None:
|
||||
|
||||
Reference in New Issue
Block a user