Skip to content

chore(registry): keep the newest 30 revisions per Skill - #694

Merged
harlan-zw merged 1 commit into
mainfrom
chore/skill-revision-retention
Nov 12, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
chore/skill-revision-retention

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #126 (daily check-in: database capacity incident). Step 2 of ADR-0019 (#692).

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

skill_revisions is 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 with LIMIT 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.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

🤖 Generated with Claude Code

`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>
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Nov 12, 2026
@harlan-github-agent

harlan-github-agent Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-11-12 06:50 UTC.

GitHub merged this pull request.

No material findings were recorded.

fd040a4d-aa96-4016-b150-57028711db26

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Nov 12, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit 2c64950 into main Nov 12, 2026
8 checks passed
@harlan-zw
harlan-zw deleted the chore/skill-revision-retention branch November 12, 2026 06:45
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant