Skip to content

fix(registry): cache org profile endpoint behind SWR read-through - #188

Merged
harlan-zw merged 1 commit into
mainfrom
fix/issue-183
Sep 14, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/issue-183

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #183

❓ Type of change

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

📚 Description

The org profile route was the last bare handler on the registry API. Every crawler hit ran the full compute: the skills query, the owners read, repo source identities, generated tags, the sync summary, plus a live ungh.cc fetch per repo. That is the shape the ops ledger blames for the recurring D1 overload bursts (SKILLD-1M, SKILLD-1N and the 2026-08-05 orgs family).

The skill detail route already got the identical read-through stale-while-revalidate shield after SKILLD-1V. This gives the owner route the same treatment, one key per owner: fresh for 60s, stale served for 5min while one background refresh recomputes, and concurrent cold misses sharing a single computation. Failures stay uncached, so a 404 for an owner with no skills still recomputes per hit.

Unsure about one thing: I could not measure real hit rate. If crawler traffic concentrates on distinct cold owners, a 60s fresh window may be too short to move D1 load, and a longer TTL would trade profile freshness for fewer computes. The test also keeps the shared D1 harness honest about batches: querySkills batches three SELECTs and reads .results off each, which the harness's batch() silently dropped before.

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

@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 Sep 8, 2026
@harlan-github-agent

harlan-github-agent Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 MERGED

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

GitHub merged this pull request.

No material findings were recorded.

0933ab7c-1e84-4777-8a2c-a0398171988b

@harlan-github-agent harlan-github-agent Bot added harlan-agent-pending The automated Review is waiting on a gate for this head commit. 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. harlan-agent-pending The automated Review is waiting on a gate for this head commit. labels Sep 8, 2026
@harlan-zw
harlan-zw merged commit 73a0c9e into main Sep 14, 2026
5 checks passed
@harlan-zw
harlan-zw deleted the fix/issue-183 branch September 14, 2026 06:43
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Sep 14, 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.

Org profile endpoint runs uncached D1 queries per request

1 participant