From 02219b0d6863405d4650835057cafb8f9425775c Mon Sep 17 00:00:00 2001 From: Steve-too Date: Wed, 15 Jul 2026 20:57:57 +0000 Subject: [PATCH] fix(recall): ignore archived page titles --- src/vouch/recall.py | 6 +++++- tests/test_recall.py | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/vouch/recall.py b/src/vouch/recall.py index 911d512c..2d7fec13 100644 --- a/src/vouch/recall.py +++ b/src/vouch/recall.py @@ -17,6 +17,7 @@ import yaml from .context import _RETRACTED_CLAIM_STATUSES +from .models import PageStatus from .storage import KBStore DEFAULT_ENABLED = True @@ -58,7 +59,10 @@ def build_digest(store: KBStore, *, max_chars: int = DEFAULT_MAX_CHARS) -> str: c for c in store.list_claims() if c.status not in _RETRACTED_CLAIM_STATUSES ] - pages = store.list_pages() + pages = [ + p for p in store.list_pages() + if p.status != PageStatus.ARCHIVED + ] if not claims and not pages: return "" diff --git a/tests/test_recall.py b/tests/test_recall.py index a08a02ce..d2aaca40 100644 --- a/tests/test_recall.py +++ b/tests/test_recall.py @@ -7,7 +7,7 @@ import pytest from vouch import recall -from vouch.models import ClaimStatus +from vouch.models import ClaimStatus, PageStatus from vouch.proposals import approve, propose_claim, propose_page from vouch.storage import KBStore, _starter_config @@ -47,6 +47,18 @@ def test_digest_excludes_retracted_claims(store: KBStore) -> None: assert "archived fact" not in d +def test_digest_excludes_archived_pages(store: KBStore) -> None: + _approve_page(store, "live design") + archived = _approve_page(store, "obsolete design") + archived.status = PageStatus.ARCHIVED + store.update_page(archived) + + d = recall.build_digest(store) + + assert "live design" in d + assert "obsolete design" not in d + + def test_empty_kb_digest_is_empty(store: KBStore) -> None: assert recall.build_digest(store) == ""