Metadata-Version: 2.4
Name: ossa
Version: 0.1.0a1
Summary: OSSA toolbox: the deterministic half of a safety-first open-source contribution crew that runs on Claude Code.
Author: Rahul Seervi
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/Rahul-cs50/ossa
Project-URL: Repository, https://github.com/Rahul-cs50/ossa
Project-URL: Issues, https://github.com/Rahul-cs50/ossa/issues
Project-URL: Safety, https://github.com/Rahul-cs50/ossa/blob/main/SAFETY.md
Keywords: open-source,contributions,claude-code,sandbox,safety,pull-requests
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.6
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.7
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# OSSA

**Your open-source crew. Runs on Claude Code.**

OSSA is a small crew that contributes to open-source projects with you. It finds issues worth your
time, reproduces the bug, fixes it, tries hard to break its own fix, and drafts the PR in the
project's own style. Nothing reaches GitHub until you have read it and approved it in your own words.

It is built for maintainers' trust first: repos that don't want AI help are skipped, AI help is
always disclosed, volume stays low, and every PR comes with evidence a maintainer can check.

> Pre-release. The plugin, the toolbox and this README are still moving.

## The crew

| | Job |
|---|---|
| **Captain** | the one you talk to; plans and hands out the work |
| **Scout** | finds repos and issues, reads each repo's rules and its last 10 merged outside PRs |
| **Sherlock** | builds a sandbox and reproduces the bug with a failing test |
| **Patch** | writes the minimal fix and its regression test |
| **Breaker** | tries to break the fix with tests that run, without seeing Patch's reasoning |
| **Judge** | settles disputes between Patch and Breaker, on evidence |
| **Scribe** | writes the commit, the PR in the repo's template, and the evidence pack |

## Install

You need [Claude Code](https://claude.com/claude-code), git, Docker and Python 3.11+, on Linux, macOS, or
Windows through WSL2 (below).

```sh
curl -fsSL https://raw.githubusercontent.com/Rahul-cs50/ossa/main/install.sh | sh
```

The installer checks those, installs the `ossa` toolbox with `uv`, and runs `ossa init`, which asks
five questions and makes your workspace (`~/ossa`). The OSSA plugin is switched on in that folder
only; your other Claude Code sessions are never touched.

Or by hand:

```sh
uv tool install ossa                     # the toolbox
ossa init --marketplace Rahul-cs50/ossa  # workspace + plugin
ossa doctor                              # checks everything
```

### Windows

OSSA runs on Windows inside WSL2, the Linux that comes with Windows 10 and 11:

1. In PowerShell, run `wsl --install` and restart. That installs Ubuntu.
2. Open **Ubuntu** from the Start menu. Everything below happens there.
3. Install Claude Code inside Ubuntu. A copy installed in Windows doesn't count: OSSA's safety hooks have
   to run in Linux.
4. For Docker, turn on Docker Desktop's *Settings → Resources → WSL integration* for Ubuntu, or install
   Docker Engine inside Ubuntu.
5. Run the install line above. Keep the workspace in your Linux home (the default, `~/ossa`), not under
   `/mnt/c`, which is slow and ignores letter case.

`ossa doctor` checks each of these. Run in Windows itself, `ossa` and the installer only print these steps.
WSL has no system keychain, so `ossa init` keeps your GitHub token in `~/.config/ossa/token`, a file only
you can read; the crew can't open it.

## Use

```sh
ossa wake        # start the crew (Claude Code in ~/ossa, with the Captain)
```

Then talk to the Captain: "find something to fix in a Python project", "what's waiting for me?".
When a PR is ready, the Captain tells you. You review and decide in your own terminal:

```sh
ossa approve     # read each card; approve in your own words, ask for changes, or reject
ossa status      # your level, caps, open PRs and what waits for you
```

The card fits what you need to decide on one screen: what broke, the evidence (the reproduction,
the tests, Breaker's attacks), the repo's rules, the PR text exactly as it will go out, and the diff.

<img src="docs/demo/card.svg" alt="The approval card for a sample fix: what broke, the evidence, the repo's rules, the PR text, the commit message and the diff" width="720">

*The pictures here are OSSA's real screens, drawn from sample data about a made-up repo
(`scripts/demo.py`).*

### Your commands

| Command | What |
|---|---|
| `ossa wake` | start the crew |
| `ossa approve [attempt]` | review queued PRs; approve, ask for changes, or reject |
| `ossa claim <attempt>` | post a claim comment the crew drafted, for repos that assign issues first |
| `ossa allow <repo> --why ...` | after reading the quote yourself: lift an AI-ban match or a CLA block |
| `ossa sleep [--hours N]` | stop the crew in every session in the workspace until `ossa wake` (or N hours) |
| `ossa status`, `ossa doctor`, `ossa gc` | standing and what happened while you were away, health check, cleanup |

The crew's own commands (`ossa repos`, `policy`, `issues`, `start`, `env`, `test`, `repro`,
`verify`, `risk`, `attack`, `duel`, `queue`, ...) print JSON for Claude; you rarely need them.

### The crew pane

In your workspace, a pane beside the chat shows who in the crew is on shift and what they're doing,
your 5-hour and 7-day quota, the PRs waiting for you and your level: 😴 when a usage limit stopped
the crew (until the reset), 💤 while you have it on `ossa sleep`, 💦 while tests run in the sandbox,
🪧 when something needs you. It is the `ossa-pet` plugin, installed beside `ossa`, and it only reads
files: it never writes one or uses the network. It interrupts you only when you're needed: a toast
when a new PR starts waiting for you.

<img src="docs/demo/pane.svg" alt="The crew pane: who is on shift, your level, quota bars, the PR waiting for you, and what happened while you were away" width="560">

**While you were away.** `ossa wake` and `ossa status` show what the ledger recorded since you last
looked: PRs ready for you, fixes the crew dropped and why, PRs opened, merged or closed, new maintainer
comments, usage-limit stops. The pane and the Captain show the same list. It comes from the ledger,
not from the crew's own account of its work. In background mode each run's summary on GitHub carries
it too (`ossa away --md`).

<img src="docs/demo/status.svg" alt="ossa status with sample data: level, the PR waiting for you, open PRs, caps, and while you were away" width="720">

Rename the crew in `ossa.toml` (`[crew]`, e.g. `breaker = "Bruno"`). Instant commands, no model call:

| In Claude Code | What |
|---|---|
| `/ossa` | open the pane |
| `/ossa status` | the same, as text |
| `/ossa pause`, `/ossa resume` | hold the crew's next `ossa` step or crew agent, then let it go on |

`/ossa pause` holds one session. `ossa sleep`, in your own terminal, stops the crew everywhere in the
workspace, headless sessions included: until `ossa wake`, its next `ossa` step and every file write are
refused. When the crew stops on a usage limit, OSSA notes when it resets (`runs/limit.json`), and
`ossa status` says when the crew can go on.

## Safety

The short version: the crew can't publish, can't run repository code outside a sandbox, can't touch
your credentials, and can't skip a repo's rules; you approve every PR in your own words. Every
guarantee, how it is enforced, and the known limits are in [SAFETY.md](SAFETY.md). Found a way around
one? Report it privately: [SECURITY.md](SECURITY.md).

## How OSSA is tested

| What | How | Run it |
|---|---|---|
| The toolbox and the guard | 400+ tests, no network, Docker, token or model needed | `pytest -q` |
| The crew under pressure | red-team evals: injected instructions in an issue and in a CONTRIBUTING.md, an AI-banning repo, requests to mass-open PRs, hide AI help, use an alternate account, post a security hole, run your own steps, or work while you have the crew asleep | `claude plugin eval plugin --scaffold --allow-tools Write Edit` |
| Reading real AI policies | 19 real projects' policies against a careful human reading (18 agree; see SAFETY.md) | `python scripts/policy_corpus.py` |
| A first install | install.sh and the five `ossa init` questions at a real terminal, on a clean Linux container and on macOS in CI | `sh scripts/install_test_docker.sh` |
| The crew pane | it only reads files: `claude plugin validate pet` lists every call it makes | `claude plugin test pet` |

## Levels

Trust is the currency. You earn XP for outcomes maintainers decide (a merge is +100, an approving
review +30, feedback addressed +20, a weak fix stopped before it went out +10; a PR closed unmerged
is -50), never for PRs opened. Levels raise your caps, from 1 open PR as a newcomer to 8 as a veteran.

## For maintainers

Don't want OSSA contributions? Add this line to your AGENTS.md or CONTRIBUTING.md:

```
ossa: opt-out
```

or open a PR adding your repo to [`src/ossa/data/optout.txt`](src/ossa/data/optout.txt). Every OSSA
user's crew checks both before any work, and nobody can override them. If you have an AI policy,
OSSA reads it: clear bans stop the crew, and disclosure rules are followed word for word. What an
OSSA PR looks like, and how to tell us when one wasted your time: [docs/maintainers.md](docs/maintainers.md).

## Development

```sh
uv venv && uv pip install -e '.[dev]'
.venv/bin/pytest -q                      # no network, Docker, token or LLM needed
claude plugin validate plugin            # the plugin
claude --plugin-dir plugin               # try it from a workspace folder holding ossa.toml
sh scripts/release_check.sh              # build and check the package as PyPI will
```

Releases: [RELEASING.md](RELEASING.md).
