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:
m0rph3us1987
2026-08-05 11:58:04 +02:00
parent 5f6ddf76a4
commit f243f2213c
6 changed files with 79 additions and 12 deletions
+11 -2
View File
@@ -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: