Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ All notable changes to vouch are documented here. Format follows
- console Dashboard view: 12-month activity calendar, last-30-days bars,
hour-of-week heatmap, top actors and event mix, driven by `kb.activity`.

### Fixed
- `vouch digest --limit` now caps the followups-due section like the
pending, decisions, and stale sections — it previously returned every
due followup regardless of the limit, contradicting the `--limit` help.

## [1.2.2] — 2026-07-07

### Packaging
Expand Down
2 changes: 1 addition & 1 deletion src/vouch/digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def build(
if str(p.metadata.get("followup_status", "")) not in _CLOSED_FOLLOWUP_STATUSES
),
key=lambda r: r.due_at,
)
)[:limit]

m = compute(store, since=since, stale_after_days=stale_after_days, now=now)

Expand Down
18 changes: 18 additions & 0 deletions tests/test_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ def test_build_limit_caps_sections(store: KBStore) -> None:
assert len(d.decisions) <= 1


def test_build_limit_caps_followups(tmp_path: Path) -> None:
# --limit documents that it caps every section including followups; seed
# more due-open followups than the limit and confirm the list is bounded
# like pending/decisions/stale rather than returned whole.
s = KBStore.init(tmp_path)
for i in range(5):
due = (NOW - timedelta(days=i + 1)).date().isoformat()
s.put_page(
Page(
id=f"fu-{i}", title=f"followup {i}", type="followup",
status=PageStatus.ACTIVE,
metadata={"due_at": due, "followup_status": "open"},
)
)
d = digest_mod.build(s, limit=3, now=NOW)
assert len(d.followups_due) == 3


def test_digest_is_read_only(store: KBStore) -> None:
audit_before = (store.kb_dir / "audit.log.jsonl").read_text(encoding="utf-8")
files_before = sorted(p.name for p in (store.kb_dir / "proposed").glob("*"))
Expand Down
Loading