New Feature·Pushed May 1, 2026·M
PR detector and size assessment added to GitHub analyzer
GitHub actions now detect whether commits came through a pull request and enrich each story with linked issues, accurate diff stats, and a size classification — no more guessing whether a change was a direct push or a merged PR.
The GitHub analyzer can now tell the difference between a merged pull request and a direct push. When a commit has an associated PR, the analyzer fetches its title, description, linked issues, and accurate addition/deletion/file counts directly from GitHub's GraphQL API. For direct pushes, the context is explicitly flagged so the LLM knows it wasn't reviewed through the normal PR process.
Each story now carries a size classification: XS, S, M, L, or XL. The classification is rule-based — no LLM involved — using thresholds for total lines changed and number of files modified. Defaults match established review best practices, but workflow maintainers can override the thresholds via a JSON input if their codebase has different conventions.
The site displays this size as a small pill next to each story's metadata, with the full reasoning available as a tooltip on hover. Story IDs also changed: merge commits use [[code]]pr-{number}[[/code]] while direct pushes use [[code]]commit-{sha7}[[/code]], making it immediately clear which is which at a glance.
In the action pipeline, PR author and URL are now preferred over git committer information when available, giving better attribution for merged work.
Technical description
Two major capabilities are being added: PR detection via GitHub's GraphQL API and rule-based size assessment.
**PR Detection via GraphQL**
A new [[code ref=1]]GitHubClient[[/code]] class in [[code]]action/src/github.ts[[/code]] uses [[code]]@octokit/graphql[[/code]] to query the GitHub GraphQL API. The [[code]]fetchPRForCommit()[[/code]] method queries [[code]]Commit.associatedPullRequests[[/code]] and returns PR metadata including title, body, author login/URL, mergedAt timestamp, additions/deletions/changedFiles, and linked issues from [[code]]closingIssuesReferences[[/code]].
In [[code]]action/src/index.ts[[/code]], each commit is processed by first attempting a PR lookup. If found, [[code ref=2]]formatPRContext()[[/code]] formats the context with full PR data including a "Linked Issues" block. If no PR is associated, [[code]]formatCommitAsPRContext()[[/code]] adds an explicit "This commit was pushed directly to the default branch" note so the LLM understands the context.
The [[code ref=6]]buildStoryFromCommit()[[/code]] function in [[code]]action/src/render.ts[[/code]] now returns different Story shapes for PRs vs direct pushes: [[code]]kind: 'pr'[[/code]] with [[code]]prNumber[[/code]] and [[code]]prUrl[[/code]] fields, or [[code]]kind: 'direct-push'[[/code]]. Story IDs follow the pattern [[code]]pr-{number}[[/code]] for merges and [[code]]commit-{sha7}[[/code]] for direct pushes. Author attribution prefers PR author over git committer when available.
**Size Assessment**
A new [[code]]action/src/size.ts[[/code]] file implements rule-based size classification. The [[code ref=3]]assessPRSize()[[/code]] function computes total lines (additions + deletions) and compares against configurable thresholds. Default thresholds: XS ≤10 lines/1 file, Small ≤100 lines/5 files, Medium ≤500 lines/15 files, Large ≤1000 lines/30 files, XL above.
The [[code]]parseThresholds()[[/code]] function accepts JSON to override any threshold subset, falling back to defaults on parse failure. The [[code ref=5]]size-thresholds[[/code]] workflow input in [[code]].github/workflows/analyze.yml[[/code]] exposes this as the [[code]]GITPULSE_SIZE_THRESHOLDS[[/code]] environment variable.
**Site Changes**
The [[code ref=4]]StoryCard[[/code]] component in [[code]]site/src/components/StoryCard.tsx[[/code]] now renders a size pill using the [[code]]sizeLabel()[[/code]] helper from [[code]]site/src/lib/stories.ts[[/code]]. The pill displays XS/S/M/L/XL with [[code]]title={story.sizeReasoning}[[/code]] for the tooltip. The Story type definition was updated to include [[code]]sizeAssessment[[/code]], [[code]]sizeReasoning[[/code]], [[code]]additions[[/code]], [[code]]deletions[[/code]], and [[code]]filesChanged[[/code]] fields.
**Workflow Configuration**
Two environment variables are now exposed in the analyze workflow: [[code]]GITHUB_TOKEN[[/code]] (from [[code]]secrets.GITHUB_TOKEN[[/code]]) enables the GraphQL PR lookup, and [[code]]GITPULSE_SIZE_THRESHOLDS[[/code]] carries the optional size threshold override.
[[codeblock lang="mermaid" file="action/src/flow.ts"]]graph LR
A[walkCommits] --> B[fetchFileChanges]
B --> C[GitHubClient.fetchPRForCommit]
C --> D{pr found?}
D -->|yes| E[formatPRContext]
D -->|no| F[formatCommitAsPRContext]
E --> G[summarize with context]
F --> G
G --> H[assessPRSize]
H --> I[buildStoryFromCommit]
I --> J[writeStory JSON]
I --> K[StoryCard displays]
Categories
- New Feature (70%) — Core value is adding PR detection via GraphQL, size assessment rules, and UI display — new capabilities that didn't exist before
- Configuration (20%) — Workflow inputs and environment variables for size thresholds and GitHub token exposure
- Refactoring (10%) — LLM summarizer decoupled from commit/PR type in llm.ts