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
+8 -2
View File
@@ -80,7 +80,7 @@ def test_run_emits_one_info_summary_on_success(env_setup, data_dir, capture_logg
assert "already-1" in state
def test_run_silent_when_no_matches(env_setup, data_dir, capture_logger, monkeypatch) -> None:
def test_run_emits_zero_summary_when_no_matches(env_setup, data_dir, capture_logger, monkeypatch) -> None:
monkeypatch.setenv("DATA_DIR", str(data_dir))
monkeypatch.setattr(main_module, "ensure_repo", lambda *a, **kw: None)
monkeypatch.setattr(main_module, "_iter_candidates", lambda config: [])
@@ -90,7 +90,13 @@ def test_run_silent_when_no_matches(env_setup, data_dir, capture_logger, monkeyp
lines = _run_lines(capture_logger)
summary = [line for line in lines if line.get("event") == "run_complete"]
assert summary == []
assert len(summary) == 1
payload = summary[0]
assert payload["scanned"] == 0
assert payload["matched"] == 0
assert payload["posted"] == 0
assert payload["skipped"] == 0
assert payload["posted_ids"] == []
def test_run_returns_nonzero_on_pipeline_error(env_setup, data_dir, capture_logger, monkeypatch) -> None: