You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prune old shard revisions (bound objects/ growth from reanalyze)
Follow-up from the PR #11 review. zeitghost reanalyze (#8) writes a new shard per re-scored article and keeps the prior revision in the store (that's the point — lineage). load_articles_from_shards collapses each chain to the latest for rendering, but the superseded shards persist forever. Under cron-driven re-analysis this grows objects/ unboundedly — same shape as the trace-retention concern in #10.
Idea
A zeitghost prune-revisions --keep-last N (default e.g. 3) that, per entity, deletes all but the newest N shards in the parent_shard_id chain — for both zeitghost:article and sw:article scopes.
Considerations
Don't break lineage you keep: if you keep the last N, the oldest kept shard's parent_shard_id will dangle (its parent was pruned). Either accept dangling parents as "history truncated here," or rewrite the oldest kept shard's parent to None. Document the choice.
Prune old shard revisions (bound objects/ growth from reanalyze)
Follow-up from the PR #11 review.
zeitghost reanalyze(#8) writes a new shard per re-scored article and keeps the prior revision in the store (that's the point — lineage).load_articles_from_shardscollapses each chain to the latest for rendering, but the superseded shards persist forever. Under cron-driven re-analysis this growsobjects/unboundedly — same shape as the trace-retention concern in #10.Idea
A
zeitghost prune-revisions --keep-last N(default e.g. 3) that, per entity, deletes all but the newest N shards in theparent_shard_idchain — for bothzeitghost:articleandsw:articlescopes.Considerations
parent_shard_idwill dangle (its parent was pruned). Either accept dangling parents as "history truncated here," or rewrite the oldest kept shard's parent to None. Document the choice.verify-traceshouldn't assume every referenced shard still exists.reanalyze's safety shape.Acceptance criteria
prune-revisionskeeps the newest N revisions per entity per scope, deletes the rest.--dry-runreports what would be deleted without touching the store.--keep-last 2leaves exactly the 2 newest.Relates to #8 (reanalyze, which creates the revisions) and #10 (trace retention — same unbounded-growth shape).