Repository navigation
chore(registry): keep the newest 30 revisions per Skill - #694
Merged
Merged
Conversation
`skill_revisions` held 146,515 rows on 2026-11-12, one commit message each, and nothing deleted one. One sync reads a Skill's last 30 commits and every reader wants the newest, so the sync now drops rows past that window in the same batch that inserts new ones (ADR-0019). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. fd040a4d-aa96-4016-b150-57028711db26 |
Contributor
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Related to #126 (daily check-in: database capacity incident). Step 2 of ADR-0019 (#692).
❓ Type of change
📚 Description
skill_revisionsis insert-only. On 2026-11-12 it held 146,515 rows at about 830 bytes each, one commit message per row, and nothing deleted one.One sync reads a Skill's last 30 commits (
history(first:30)), and every reader wants the newest: the Skill page shows the latest sha, the digest reads a month back withLIMIT 20, and the feed joins the revision at or before an activity row. After a changed body inserts its commits, the sync now deletes that Skill's rows beyond the newest 30, in the same bounded D1 batch. A Skill with few revisions is untouched, and an unchanged Skill writes nothing.Existing rows past the window go the next time their Skill's body changes. There is no separate prune, so a Skill that never changes again keeps what it has.
Rollback: delete the statement.
🤖 Generated with Claude Code