Skip to content

fix(registry): guard the cluster page against the D1 parameter cap - #50

Merged
harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20260820-skilld
Aug 20, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20260820-skilld

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 🐞 Bug fix

📚 Description

Sentry check-in of the skilld project, 2026-08-20. Eight of the nine open issues are already closed by deployed commits. This is the gap the ninth left behind.

SKILLD-X was 173 events of:

Error: D1_ERROR: too many SQL variables at offset 488: SQLITE_ERROR
  GET /api/clusters

ba8ede4 chunked those reads and the errors stopped. The guard that came with it measures clusterMembersSql, which is a fragment rather than a statement. /api/clusters/<slug> wraps that fragment twice and binds each pinned skill four times across the count and the list, so the guard reads 30 parameters for context-engineering where D1 counts 60 against its cap of 100. Eleven more pins on that track breaches the cap while the old guard stays green.

The route now asks cluster-membership for both statements instead of assembling the ORDER BY itself, so the thing being measured is the thing being sent.

Loose end I did not take: nothing enforces this at runtime, so a breach that lands without CI still surfaces as a D1 error in production. I could not think of a runtime check better than failing the build.

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

The regression guard for SKILLD-X measured the shared membership SQL
fragment. /api/clusters/<slug> wraps that fragment twice and binds each
pinned skill four times, so the guard read 30 parameters where D1 counts
60 against its cap of 100.

The route now asks cluster-membership for both statements, so the thing
under the cap is the thing that gets sent.
@harlan-zw
harlan-zw merged commit 0349755 into main Aug 20, 2026
4 checks passed
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