Skip to content

Contributing

Marcus Richards edited this page Oct 7, 2026 · 2 revisions

Contributing

The repo's own guide is CONTRIBUTING.md (added at 980da3e). Summary:

The one rule

Authority only narrows. No code path may widen what an agent can spend. If a change touches permit/ or settlement/, the PR description must say why it cannot widen authority. Caps, allowlists, expiries and approval thresholds can be narrowed live, never widened.

Setup

git clone https://github.com/marsojuji-cmyk/permit && cd permit
python -m pip install pytest      # tests only; runtime is stdlib
python -m pytest -q               # must stay green (mock rail)
python demo.py                    # CI also runs this

The sandbox rail (--sandbox) needs PERMIT_PAYPAL_CLIENT_ID / PERMIT_PAYPAL_CLIENT_SECRET and interactive payer approval. See PayPal Sandbox Runbook. Live agent demos need PERMIT_GROK_CLI.

Good PRs

  • One behaviour per PR. Keep it small, reversible and tested.
  • Tests are the spec. Refusal-path and race-path tests are valued over happy-path tests.
  • Every change that moves money or authority writes a receipt (permit/ledger.py).
  • Production-shaped code must work against the sandbox client too, not just the mock.
  • Target main. CI must pass.
  • Look for issues labelled good first issue, or open an issue first to scope the work.

Invariants worth guarding (from README + code)

  • The four clauses stay exact. settlement/verifier.py stays the only capture caller. permit/permit.py stays free of PayPal imports (a test enforces this).
  • Amounts are positive integer cents. Capture idempotency key: {permit_id}:{auth_id}:capture.
  • Timeouts go UNKNOWN and are never guessed.

Security

Use GitHub private vulnerability reporting (Security tab). There is no bug bounty. See SECURITY.md.

License

MIT.

Clone this wiki locally