Skip to content

Cyriellewu/openpatch-lab

Repository files navigation

OpenPatch Lab

CI Release License: MIT Python

Open-source contribution intelligence. Before you spend hours on a GitHub issue, ask openpatch whether it's actually worth starting: is it still open, unclaimed, and free of a competing PR? What files does it touch? — so contributors stop duplicating work and maintainers receive fewer low-quality AI PRs.

$ openpatch inspect stablyai/orca#9705

openpatch inspect - stablyai/orca#9705

Issue status:            Open
Assigned:                No
Competing PR:            None found
Claim signals:           0
Likely files:            4
Age (days since update): 6

-- model-derived (optional) --
Model layer:             unavailable (no LLM key configured)
Reproduction confidence: unavailable
Estimated effort:        unavailable
Model agreement:         unavailable

Recommended action:      Ask maintainer before implementation
                         Open and unclaimed with no competing PR, but maintainer triage is not confirmed.

Design integrity: facts vs. estimates

The single most important property of this tool is that it never fabricates.

Field Source
Issue status, Assigned, Competing PR, Claim signals, Likely files, Age, Labels FACTUAL — read directly from the GitHub API. Never inferred.
Reproduction confidence, Estimated effort, Model agreement MODEL-DERIVED — optional LLM layer. Renders as unavailable (never a fake number) when no LLM key is set.
Recommended action Deterministic rule engine over the factual signals. The model layer may only refine wording — it can never invent a "safe to start" green light.

If the GitHub API or the LLM is unavailable, the report degrades a field — never the whole run.

Install

pip install git+https://github.com/Cyriellewu/openpatch-lab

Authentication for the factual layer uses your existing gh login if present, otherwise a GITHUB_TOKEN / GH_TOKEN environment variable.

Usage

openpatch inspect owner/repo#123               # human-readable report
openpatch inspect owner/repo#123 --format md   # Markdown report
openpatch inspect owner/repo#123 --json        # full machine-readable report
openpatch scan owner/repo --top 5              # rank a repo's open issues by startability
openpatch scan owner/repo --top 10 --format md # ...as a Markdown table

inspect reports one issue; scan ranks a repo's most-startable open issues (open + unassigned + no competing PR + not stale rank highest). --format {text,json,md} selects output; --json is a back-compat shorthand for inspect.

Use it as a GitHub Action

Auto-comment an OpenPatch report on every newly-opened issue — copy examples/workflow-openpatch.yml into a repo as .github/workflows/openpatch.yml:

on:
  issues:
    types: [opened]
permissions:
  issues: write
jobs:
  report:
    runs-on: ubuntu-latest
    steps:
      - uses: Cyriellewu/openpatch-lab@v0.2.0
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

What it reports (v0.1)

  • Issue status — open / closed-completed / closed-not-planned.
  • Assigned — current assignees.
  • Competing PR — open/closed PRs cross-referenced from the issue timeline.
  • Claim signals — third-party "I'll take this" / /assign comments (the reporter's own comments are excluded).
  • Likely files — source paths referenced in the issue body (URLs and dotted runtime names filtered out).
  • Age & skip labels — staleness signal; stale / wontfix / duplicate / invalid flags.
  • Recommended action — one of: ask maintainer first, coordinate (likely claimed), review competing PR first, skip (resolved / stale).

Roadmap

  • v0.2 — Markdown report export (--format md) and a reusable GitHub Action that comments the report on new issues. ✅ shipped.
  • v0.3openpatch scan owner/repo batch-ranks a repo's open issues by startability. ✅ shipped.
  • v0.4 — optional LLM scoring backend (reproduction confidence, effort, multi-sample model agreement), still degrading honestly without a key; HTML export.
  • Later — weekly trending-issue discovery, contributor/issue matching.

See DESIGN.md and SCOPE.md for the full architecture and scope.

Development

python -m unittest discover -s tests    # offline: no network/token needed

License

MIT — see LICENSE.

Contributing

Issues and PRs welcome — new factual signals, recommendation rules (with a rationale and a fixture), and report exporters especially. Every rule change should come with an offline test fixture. See CONTRIBUTING.md.

About

Open-source contribution intelligence: inspect a GitHub issue (validity, claims, competing PRs, change surface) before you spend effort on it. Facts from the GitHub API, never fabricated.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages