43 Commits
Author SHA1 Message Date
Dotta 6410143a35 Reduce D1 reads with incremental summaries and bounded API caching (#14) 2026-10-02 08:17:33 -05:00
Dotta 3dec121306 Avoid redundant D1 writes and keep dashboard requests read-only (#13) 2026-10-01 11:22:27 -05:00
DottaandPaperclip 4136d3d07a Add Paperclip documentation link (#11)
Co-authored-by: Paperclip <[email protected]>
2026-07-09 20:00:50 -05:00
DottaandPaperclip 3b1dc99f3c Fix leaderboard author links
Co-Authored-By: Paperclip <[email protected]>
2026-04-07 12:47:50 -05:00
DottaandPaperclip 1d4c2560e0 Add GitHub leaderboard and merge score
Co-Authored-By: Paperclip <[email protected]>
2026-04-07 12:05:58 -05:00
DottaandPaperclip 9f0d70980b Fix D1 bootstrap ordering for GitHub author rollout
Co-Authored-By: Paperclip <[email protected]>
2026-04-07 09:33:41 -05:00
DottaandPaperclip ccfea82f19 Add GitHub author pages on production master
Co-Authored-By: Paperclip <[email protected]>
2026-04-07 09:31:18 -05:00
Devin Foley d1c3a9bd7c Merge pull request #10 from paperclipai/fix/stale-pr-detection
Fix stale PR detection marking open PRs as closed
2026-04-01 15:39:15 -07:00
Devin FoleyandPaperclip 0b34941e03 fix: move pr_files writes into batch to fix FK constraint errors
pr_files inserts were running before the PR row was created via
runBatch, causing FOREIGN KEY constraint failures for all new PRs.
Moving the DELETE + INSERT into the batch ensures proper ordering.

Co-Authored-By: Paperclip <[email protected]>
2026-04-01 15:26:51 -07:00
Devin FoleyandPaperclip 61802dfd68 fix: don't mark still-open PRs as closed during stale detection
When octokit.paginate returns partial results (due to rate limits or
API pagination limits), the stale PR detection would check each
"missing" PR via pulls.get but then incorrectly mark it as closed
even if data.state was still 'open'. This caused ~half of all open
PRs to be missing from the triage database.

Now checks data.state before updating and leaves open PRs alone.
Also avoids assuming closed on API errors.

Co-Authored-By: Paperclip <[email protected]>
2026-04-01 15:12:29 -07:00
Devin Foley 56536eb5c0 Merge pull request #9 from paperclipai/feat/favicon
Add favicon and fix local dev serving
2026-03-25 21:50:08 -07:00
Devin Foley afab29b381 Fix favicon serving to work with both tsx and wrangler
Move the SVG import out of app.ts (tsx can't handle raw .svg imports)
and pass it as a parameter instead. worker.ts uses wrangler's bundled
import, server.ts reads from disk.
2026-03-25 21:48:33 -07:00
Devin FoleyandPaperclip b43b19a564 Add source-control themed SVG favicon to PR dashboard
- Create merge-branch SVG icon at src/web/favicon.svg
- Serve /favicon.svg and /favicon.ico (redirect) routes in app.ts
- Add <link rel="icon"> to dashboard HTML head
- Add SVG type declaration for TypeScript imports
- Add *.svg to wrangler text rules for Cloudflare Worker

Co-Authored-By: Paperclip <[email protected]>
2026-03-25 20:49:26 -07:00
Devin Foley ebfd69f78a Merge pull request #8 from paperclipai/feat/local-sync-button
Add local-only Sync Now button to dashboard
2026-03-25 17:12:13 -07:00
Devin Foley 4992137451 Add local-only Sync Now button to dashboard
When running locally (via server.ts), a "Sync Now" button appears in the
stats bar. It probes GET /api/sync to detect the local server, then
POST /api/sync triggers a full GitHub sync with mutex protection.
The button is hidden on the Cloudflare Worker deployment.
2026-03-25 17:09:06 -07:00
Devin Foley 17e02a96fc Merge pull request #7 from paperclipai/feat/similar-pr-scores
Show PR scores in similar/duplicate PR list
2026-03-23 14:22:19 -07:00
Devin FoleyandClaude Opus 4.6 f772004a27 Show PR scores in similar/duplicate PR list
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 14:18:10 -07:00
Devin Foley fd40bde0a0 Merge pull request #6 from paperclipai/docs/auto-deploy-note-v2
Add auto-deploy note to README
2026-03-23 11:58:30 -07:00
Devin FoleyandClaude Opus 4.6 f9369ddbe9 Add auto-deploy note to README
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 11:53:44 -07:00
Devin Foley 11c853295b Merge pull request #4 from paperclipai/docs/deploy-instructions
Add deploy instructions and move account config to .dev.vars
2026-03-23 11:40:07 -07:00
Devin FoleyandClaude Opus 4.6 106c44fdd0 Add deploy instructions and pin account config to .dev.vars
- Add Deploying section to README with wrangler setup steps
- Add deployment info to CLAUDE.md for agent context
- Add .dev.vars to .gitignore (stores API token + account ID)
- Remove account_id from wrangler.toml (loaded from env instead)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 11:38:36 -07:00
Devin Foley 6490e330f8 Merge pull request #3 from paperclipai/refactor/scoring-module
Refactor: extract scoring logic into dedicated module
2026-03-23 11:06:58 -07:00
Devin FoleyandClaude Opus 4.6 841e8773a8 Add CLAUDE.md with instruction to keep scoring docs in sync
Ensures agents updating src/scoring.ts also update README.md,
and adds a reminder in the README itself for human contributors.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 11:03:36 -07:00
Devin FoleyandClaude Opus 4.6 bbb3d84fa5 Add README with scoring algorithm documentation
Explains the PR triage dashboard, links to the live deployment,
and describes all ten scoring signals in plain English so
contributors can understand how their PRs are ranked.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 11:01:41 -07:00
Devin FoleyandClaude Opus 4.6 f28dccdf29 Refactor: extract all scoring logic into src/scoring.ts
Moves all scoring constants, thresholds, detection patterns, and
scoring functions out of routes.ts into a dedicated scoring module.
This makes scoring changes self-contained and easier to review.

No functional changes — routes.ts and filter.ts now import from scoring.ts.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 10:58:23 -07:00
Devin Foley 6831230f88 Merge pull request #2 from paperclipai/feat/similar-duplicate-prs
Add scoring improvements, bonus signals, and contributor priority
2026-03-23 10:57:41 -07:00
Devin FoleyandClaude Opus 4.6 c09ccacbdc Add issue link, freshness, and test/thinking path bonuses; smooth merge rate thresholds
Extends the composite scoring from 6 to 10 signals (max 180):
- Issue link detection: +10 for PRs linking GitHub issues (closes/fixes/resolves #)
- Freshness scoring: 0-10 tiered by age (<1d=10, 1-3d=8, 3-7d=5, 1-2w=2)
- Test file detection: +10 for PRs including test files
- Thinking Path detection: +10 for PRs with "Thinking Path" in description
- Smooth merge rate gradient: <20%=-30, 20-39%=-15, 40-59%=0, 60-79%=+5, 80%+=+10
- Remove Labels column from list view
- Add all 10 scoring components to hover tooltip and detail breakdown

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 10:43:59 -07:00
Devin FoleyandClaude Opus 4.6 e3a96fc084 Add contributor priority as +/- score factor with hover breakdown tooltip
Contributor score now affects composite ranking as a centered +/- factor
(-25 to +25) instead of always-positive. Authors with low merge rates
get penalized, dropping them in the list. Hovering over the Score column
shows a breakdown table of all six scoring components. Also fixes the
stats header showing total PRs instead of open PRs count.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 09:32:39 -07:00
Devin FoleyandClaude Opus 4.6 2ed95afc8f Add contributor priority score to PR detail page
Sync recent merged/closed PRs during sync to build author history.
Compute a contributor priority score (0-100) based on: newcomer bonus
for first-time contributors, track record from merged PRs, merge rate
quality signal, and open PR load for active contributors needing review
bandwidth. Display as a card on the PR detail page with score breakdown.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-23 08:36:14 -07:00
Devin Foley 13177620fb Merge pull request #1 from paperclipai/feat/similar-duplicate-prs
Add similar/duplicate PR detection to detail page
2026-03-21 17:34:59 -07:00
6032e1b825 Add pr-triage Claude Code skill for PR reviewer API
Adds a SKILL.md under .claude/skills/pr-triage/ so agents can discover
and use the PR Triage API endpoints. Updates .gitignore to allow
.claude/skills/ to be tracked.

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-20 05:43:59 -05:00
Devin FoleyandClaude Opus 4.6 5adf7a502e Add similar/duplicate PR detection with file overlap display
Detect related and potentially copied PRs on each PR detail page using
Jaccard similarity on title word sets and body text trigram shingles.
During sync, changed files per PR are fetched via GitHub's listFiles API
and stored for display. The similar PRs table shows title/body match
percentages, file overlap counts, and color-coded relationship labels
(potential copy, likely duplicate, similar topic, related). Each row
links to both the internal detail page and the GitHub PR.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-19 23:26:46 -07:00
DottaandPaperclip 9f97b4a608 Add LOC-based scoring: fewer changes rank higher
Adds a new LOC component (0-15 points) to the composite score using
logarithmic decay: small PRs (~50 LOC) earn ~12pts, medium (~200 LOC)
~8pts, large (~1000 LOC) ~6pts. Max score is now 115.

Updated scoring in filter.ts, routes.ts, scoreBreakdown, the /scoring
endpoint docs, and the dashboard UI. Added 7 new tests.

Co-Authored-By: Paperclip <[email protected]>
2026-03-18 12:32:40 -05:00
DottaandClaude Opus 4.6 57f5fe0853 Add --full flag to sync command to bypass incremental cache
Needed to backfill data when new columns (like LOC) are added after
PRs were already cached.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-18 12:25:51 -05:00
DottaandClaude Opus 4.6 74fde103a6 Fix D1 REST API batch: fall back to sequential queries
The D1 REST /query endpoint only accepts a single statement per request,
not an array. The native D1 binding supports .batch() but the HTTP client
needs sequential calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-18 12:20:31 -05:00
DottaandClaude Opus 4.6 adbc974d55 Speed up PR sync with incremental updates and batched DB writes
Skip detail fetches for PRs unchanged since last sync, batch all DB
writes per PR into a single round-trip, and avoid mergeable retry
delays when head_sha hasn't changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-18 12:18:46 -05:00
DottaandPaperclip 191806fd10 Add LOC changed column to PR dashboard
Store additions, deletions, and changed_files from GitHub API in the
pull_requests table. Display as +N -N in a new sortable LOC column
between Labels and Conflicts.

Co-Authored-By: Paperclip <[email protected]>
2026-03-18 11:25:35 -05:00
DottaandClaude Opus 4.6 1f8282bd18 Gitignore .claude/ and run sync every 15 minutes
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-18 08:54:04 -05:00
DottaandPaperclip 5b4060d729 Add scheduled PR sync workflow
Co-Authored-By: Paperclip <[email protected]>
2026-03-16 12:17:37 -05:00
DottaandClaude Opus 4.6 5445a36dc9 Fix PR detail view to match refactored API response shape
The detail endpoint was changed to return a flat object with computed
fields (compositeScore, ciStatus, labels, scoreBreakdown) but the
frontend template still referenced the old nested shape (d.pr, d.scores).
Also improved detail view to show score breakdown card and labels.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-12 14:38:38 -05:00
DottaandClaude Opus 4.6 6cf9bbd29b Add scoring improvements, labels, pagination, search, and full API surface
- Human comment count in composite scoring (excludes bots)
- FTS5 full-text search for PR comments with BM25 ranking
- PR state tracking (open/merged/closed) with sync detection
- GitHub labels synced and displayed with matching colors
- Pagination (25 per page) on PR list
- Search bar on main page, search as shareable page with query string
- Last activity column (latest of code push or comment) with time-ago display
- CI column compacted to colored dots
- Full agent-friendly API: /labels, /authors, /scoring, filters (author, label, sort)
- PR detail endpoint with score breakdown
- SKILL.md documenting all API endpoints for agent consumption

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-12 10:48:59 -05:00
ForgottenandClaude Opus 4.6 ed590cd791 Add web dashboard, D1 support, and Cloudflare Workers deployment
- Async DbClient interface with three backends: SQLite (local), D1 REST
  API (CLI remote), and D1 Worker binding (deployed, no tokens exposed)
- Hono web dashboard with PR list, filters, sorting, and detail views
- Deploy to Cloudflare Workers via wrangler (D1 binding, read-only)
- Fix greptile parser to handle HTML <h3> format from bot comments
- Make GITHUB_TOKEN and ANTHROPIC_API_KEY optional (only required for
  sync and review commands respectively)
- Add dotenv for .env loading, docker wrapper script
- Optimize list query from N+1 to single SQL (48s -> 0.7s on D1)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-11 11:53:44 -05:00
ForgottenandClaude Opus 4.6 68e416cbc8 Initial implementation of PR triage CLI for paperclipai/paperclip
GitHub sync with rate-limited Octokit, greptile score parsing, CI status
aggregation, composite scoring/filtering, and LLM review pipeline with
prompt injection defenses (random boundary delimiters, output validation).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-11 10:43:18 -05:00