Determine whether a shared query service could replace any of Punch's aggregation work while preserving its knot-event sources and push-count semantics. A PDS-record SQL service alone is not a substitute for the current collector.
Source findings #
Inspected local revision aff2398.
worker/src/drain.tsconsumes each knot's/eventsstream and countssh.tangled.git.refUpdate, using the existing committer/owner/repository fallback for attribution.worker/src/index.ts:runCycleaccumulates push counts, records repository activity, advances per-knot cursors and triggers language scans.serveBoardbuilds the leaderboard with the existing D1 query.worker/src/langs.tscalls knotsh.tangled.repo.languagesendpoints; pushed-to repositories become dirty and are scanned ahead of the rotation.- Public push counts are intentionally not Git commit counts. The repository-activity view has a rolling 30-day observation window. Neither can be substituted with counts of repository declarations or current
org.tangled.git.refsrecords without changing meaning.
Mizumi currently queries Hydrant/PDS event tables. We have not established that it contains Punch's per-knot push stream, attribution data or language observations. There is also no dedicated Fly server demonstrated to disappear: the current indexer is a Worker with D1/KV.
Investigation boundary #
Use a bounded capture of the actual knot events and language observations already consumed by Punch. Preserve source host/cursor, replay identity, attribution and observation times. Compare the existing leaderboard and repository-window aggregates against a query projection, including duplicate replay, cursor recovery, missing committer identities and window expiry. Treat language observations as separately refreshed enrichment.
Only propose consolidation if the shared source can own those inputs and replay guarantees, and the result names exact D1/cron/collector code that can be removed without losing behavior. Otherwise retain the existing implementation: moving an already-small SQL aggregation to another service would add machinery. This issue records a possible comparison, not evidence that consolidation or savings are available.
Context: original Mizumi demonstration.