taskops-cli 0.5.7__py3-none-any.whl → 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
taskops/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  __title__ = "taskops"
4
- __version__ = "0.5.7" # single source of truth; pyproject reads it dynamically
4
+ __version__ = "0.6.0" # single source of truth; pyproject reads it dynamically
taskops/store/cache.py CHANGED
@@ -93,8 +93,19 @@ class Cache:
93
93
  rows = self._query("SELECT kind, COUNT(*) FROM events GROUP BY kind")
94
94
  return {str(kind): int(n) for kind, n in rows}
95
95
 
96
- def since(self, seq: int) -> list[tuple[int, Event]]:
97
- return self._events("WHERE seq > ? ORDER BY seq", (seq,))
96
+ def since(self, seq: int, limit: int | None = None) -> list[tuple[int, Event]]:
97
+ """Everything after `seq`, OLDEST first — replay's order, and the order
98
+ a live reader catches up in.
99
+
100
+ `limit` is for the second caller only (`verbs/events.py`'s `after=`): a
101
+ page of a CATCH-UP is read forwards, so the cap has to fall on the
102
+ oldest end and not on the newest, which is the one thing a descending
103
+ `page()` cannot do. Replay passes nothing and reads the tail whole —
104
+ that is what makes a cache rebuildable.
105
+ """
106
+ if limit is None:
107
+ return self._events("WHERE seq > ? ORDER BY seq", (seq,))
108
+ return self._events("WHERE seq > ? ORDER BY seq LIMIT ?", (seq, limit))
98
109
 
99
110
  def page(self, before: int | None, limit: int) -> list[tuple[int, Event]]:
100
111
  """One page of the whole log, NEWEST FIRST, by keyset on `seq`.