Single-file script that:
- Fetches a Bitbucket PR diff
- Detects parameter/functional changes
- Fetches full file content once per file
- Builds a change list and asks an LLM to find bugs
- Node.js >= 18
- pnpm
pnpm install
Copy .env.example to .env and fill in values (or set the same keys in your shell).
BITBUCKET_EMAIL,BITBUCKET_API_TOKEN(required for Bitbucket API)MOON_SHOT_KEY(required for Kimi / Moonshot analysis)- Optional:
BITBUCKET_WORKSPACE(default: smart_eco-platform) - Optional:
PORT(default: 3000 in code; use.envto override, e.g. 3002) - Optional:
TAVILY_API_KEY(web search in recheck step) - Optional:
PR_FETCH_INTERVAL_MSin.env(e.g.300000= 5 min; if unset, the app uses 5 min as fallback) - Optional:
PR_AUTHOR_UUIDS(comma-separated UUIDs; defaults to a built-in list)
pnpm start -- <bitbucket-pr-url>
Example:
pnpm start -- https://bitbucket.org/workspace/repo/pull-requests/123
The server periodically fetches today's PRs (UTC day window) from the configured workspace every 5 minutes by default. It logs the total count each tick.