Inspect Petri PR Contribution Recipe
Also apply the shared OSS contribution quality protocol in
../../references/contribution-quality.md.
Project-specific instructions below override the shared protocol when they
conflict.
Use this recipe for meridianlabs-ai/inspect_petri. Keep every PR small, issue-linked, and easy for Meridian Labs maintainers to review.
Project facts
- Local checkout:
/Users/dejain/nvidia/oss/inspect_petri
- Upstream repo:
meridianlabs-ai/inspect_petri
- Default branch:
main
- Fork/head owner:
deepujain
- Python: 3.12+
- Dev setup:
uv sync --group dev
- Full validation:
make check and make test
- CI: ruff, pyright, pytest, package build/import on Python 3.12 and 3.14
- Docs: Quarto under
docs/
Required live reconnaissance
Before creating a new contribution or updating this skill, inspect the live repo state:
gh issue list --repo meridianlabs-ai/inspect_petri --state open --limit 100
gh pr list --repo meridianlabs-ai/inspect_petri --state open --limit 100
gh pr list --repo meridianlabs-ai/inspect_petri --author deepujain --state open
Then search overlap for the specific issue:
gh search prs --repo meridianlabs-ai/inspect_petri '<issue-number> in:title,body' --state open
gh search prs --repo meridianlabs-ai/inspect_petri '<key error text or feature phrase>' --state open
At the start of every repeated sweep, reconcile the previous or recent authored
PR set with the current open set. For every PR that disappeared, query its exact
state and merge/close timestamps, then inspect final comments, reviews, timeline,
linked issue, overlapping PRs, and any replacement commit. Record merged PRs as
merged. For a PR closed without merge, establish whether it was duplicate,
superseded, out of scope, policy-blocked, abandoned, or unresolved, and say
whether the contribution survived in another PR. If the closure yields a
reusable testing, design, review, or workflow lesson, add the smallest durable
rule at the correct place in this skill, validate it, and commit/push the skill
repository. Do not overfit unexplained closures; report no skill change needed
when there is no reusable lesson. Include a departed-PR table before the open-PR
table whenever anything merged or closed since the previous sweep.
Latest observed state from the 2026-05-08 UTC sweep:
- #60 rescore existing logs with a different judge -> PR #88 merged.
- #49 reusable target tool definitions -> PR #87 closed; maintainer said this is already supported in Petri 3.0 via seed tools.
- #23 image input tool / multimodal audit messages -> PR #89 closed; issue remains open, but maintainer feedback says generic multimodal input plumbing is not currently useful enough for the main package without stronger scenario/research evidence.
Refresh this before acting. If #23 is still the only open issue, do not reopen the generic image-message PR. Prefer either no-op/status reporting, or a narrower research-backed contribution that demonstrates image-specific seeds/scenarios reducing eval-awareness or enabling realistic computer-use screenshots.
Contribution loop
Understand the issue before editing.
- Read the full issue body, comments, linked PRs, and relevant code paths.
- Search for overlapping PRs by issue number, title terms, error text, and affected files.
- Do not start an issue that already has an active PR unless the user explicitly asks to take over or help that PR.
Sync before changing files.
cd /Users/dejain/nvidia/oss/inspect_petri
git fetch origin main
git switch main
git pull --ff-only origin main
git switch -c issue-NN-short-topic
If the fork remote is needed, use fork for deepujain/inspect_petri. Confirm remotes before pushing.
Implement the smallest useful fix.
- Follow
AGENTS.md, CONTRIBUTING.md, and nearby code patterns.
- Core code lives under
src/inspect_petri; important areas include _task, _auditor, _target, _judge, _seeds, target, and tools.
- Tests live under
tests; audit flows are usually covered in tests/e2e, target replay/history in tests/target, judge/scorer behavior in tests/scorer or tests/judge, and seed parsing in tests/seeds.
- Docs live under
docs; reference docs use Quarto pages in docs/reference.
- Public API changes need type hints, Google-style docstrings where appropriate, docs updates, and changelog notes when user-visible.
- For seeds and dimensions, preserve the existing Markdown/frontmatter format and tags.
- Avoid speculative knobs, broad refactors, unrelated formatting, and private tool-generated references in code, commit messages, PR bodies, or comments.
Validate the requested feature, not only the suite.
- Run the narrowest test that proves the issue requirement first, then broaden.
- Add or update tests for behavior changes.
- For audit flow changes, validate the exact flow the issue requests: target tools, sample metadata, judge/rescore behavior, image or multimodal content, log replay, or docs command.
- In the PR body, include both:
- Feature validation: which test or manual command proves the issue is fixed and why.
- Regression validation:
make check and make test, or exact blockers if the environment cannot run them.
Run checks.
uv run pytest tests/path/to/test_file.py::test_name -v
make check
make test
make check runs pyright plus ruff fixes/formatting locally. After it runs, review the diff so formatting changes are intentional. CI checks ruff formatting without applying fixes, so the local tree must be clean and formatted before push.
For docs changes, render the affected Quarto docs when practical:
uv sync --group doc
cd docs
source ../.venv/bin/activate
quarto render
If full tests fail for an unrelated existing issue, capture the failing tests, keep the focused feature proof, and state the residual risk plainly.
Commit and push.
- Commit only files for this PR.
- Use the author
Deepak Jain <deepujain@gmail.com>.
- Use a direct, maintainer-facing message such as
feat: add image messages to audits or fix: support rescore judge override.
- Include
Closes #NN in the PR body, not necessarily in the commit message.
Open the PR.
gh pr create \
--repo meridianlabs-ai/inspect_petri \
--base main \
--head deepujain:issue-NN-short-topic \
--draft
PR body shape:
Summary
- ...
Feature validation
- ...
Regression validation
- make check
- make test
Closes #NN.
After opening or updating a PR, close the loop.
- Inspect CI, review comments, and bot feedback on the current head.
- Fix actionable comments, rerun focused validation, push, and leave a short factual comment.
- If feedback is stale or unrelated, verify current head and explain briefly rather than guessing.
Issue selection preferences
- Trigger phrase: "sweep" when the active repo/thread context identifies Inspect Petri.
Prefer issues that have concrete acceptance criteria and can be proven locally. Good Inspect Petri issue shapes include audit API gaps, Inspect AI integration mismatches, target tool handling, sample metadata behavior, scorer/judge/rescore flows, multimodal message support, docs examples, and small testable seed/dimension fixes.
Avoid issues that depend on hidden product direction, secrets, private eval data, or large design decisions unless the user explicitly wants that conversation.
1---2name: inspect-petri-pr-contribution3description: Find, implement, validate, and shepherd focused GitHub PRs for meridianlabs-ai/inspect_petri. Use when the user wants to contribute to Inspect Petri, work on Petri issues, fix an Inspect Petri PR, sweep Petri review feedback or CI, mentions Inspect Petri contribution work, or uses the one-word trigger "sweep" when the active repo/thread context identifies Inspect Petri.4---56# Inspect Petri PR Contribution Recipe78Also apply the shared OSS contribution quality protocol in9[../../references/contribution-quality.md](../../references/contribution-quality.md).10Project-specific instructions below override the shared protocol when they11conflict.1213Use this recipe for [meridianlabs-ai/inspect_petri](https://github.com/meridianlabs-ai/inspect_petri). Keep every PR small, issue-linked, and easy for Meridian Labs maintainers to review.1415## Project facts1617- Local checkout: `/Users/dejain/nvidia/oss/inspect_petri`18- Upstream repo: `meridianlabs-ai/inspect_petri`19- Default branch: `main`20- Fork/head owner: `deepujain`21- Python: 3.12+22- Dev setup: `uv sync --group dev`23- Full validation: `make check` and `make test`24- CI: ruff, pyright, pytest, package build/import on Python 3.12 and 3.1425- Docs: Quarto under `docs/`2627## Required live reconnaissance2829Before creating a new contribution or updating this skill, inspect the live repo state:3031```bash32gh issue list --repo meridianlabs-ai/inspect_petri --state open --limit 10033gh pr list --repo meridianlabs-ai/inspect_petri --state open --limit 10034gh pr list --repo meridianlabs-ai/inspect_petri --author deepujain --state open35```3637Then search overlap for the specific issue:3839```bash40gh search prs --repo meridianlabs-ai/inspect_petri '<issue-number> in:title,body' --state open41gh search prs --repo meridianlabs-ai/inspect_petri '<key error text or feature phrase>' --state open42```4344At the start of every repeated sweep, reconcile the previous or recent authored45PR set with the current open set. For every PR that disappeared, query its exact46state and merge/close timestamps, then inspect final comments, reviews, timeline,47linked issue, overlapping PRs, and any replacement commit. Record merged PRs as48merged. For a PR closed without merge, establish whether it was duplicate,49superseded, out of scope, policy-blocked, abandoned, or unresolved, and say50whether the contribution survived in another PR. If the closure yields a51reusable testing, design, review, or workflow lesson, add the smallest durable52rule at the correct place in this skill, validate it, and commit/push the skill53repository. Do not overfit unexplained closures; report `no skill change needed`54when there is no reusable lesson. Include a departed-PR table before the open-PR55table whenever anything merged or closed since the previous sweep.5657Latest observed state from the 2026-05-08 UTC sweep:5859- #60 rescore existing logs with a different judge -> PR #88 merged.60- #49 reusable target tool definitions -> PR #87 closed; maintainer said this is already supported in Petri 3.0 via seed tools.61- #23 image input tool / multimodal audit messages -> PR #89 closed; issue remains open, but maintainer feedback says generic multimodal input plumbing is not currently useful enough for the main package without stronger scenario/research evidence.6263Refresh this before acting. If #23 is still the only open issue, do not reopen the generic image-message PR. Prefer either no-op/status reporting, or a narrower research-backed contribution that demonstrates image-specific seeds/scenarios reducing eval-awareness or enabling realistic computer-use screenshots.6465## Contribution loop66671. **Understand the issue before editing.**68 - Read the full issue body, comments, linked PRs, and relevant code paths.69 - Search for overlapping PRs by issue number, title terms, error text, and affected files.70 - Do not start an issue that already has an active PR unless the user explicitly asks to take over or help that PR.71722. **Sync before changing files.**7374 ```bash75 cd /Users/dejain/nvidia/oss/inspect_petri76 git fetch origin main77 git switch main78 git pull --ff-only origin main79 git switch -c issue-NN-short-topic80 ```8182 If the fork remote is needed, use `fork` for `deepujain/inspect_petri`. Confirm remotes before pushing.83843. **Implement the smallest useful fix.**85 - Follow `AGENTS.md`, `CONTRIBUTING.md`, and nearby code patterns.86 - Core code lives under `src/inspect_petri`; important areas include `_task`, `_auditor`, `_target`, `_judge`, `_seeds`, `target`, and `tools`.87 - Tests live under `tests`; audit flows are usually covered in `tests/e2e`, target replay/history in `tests/target`, judge/scorer behavior in `tests/scorer` or `tests/judge`, and seed parsing in `tests/seeds`.88 - Docs live under `docs`; reference docs use Quarto pages in `docs/reference`.89 - Public API changes need type hints, Google-style docstrings where appropriate, docs updates, and changelog notes when user-visible.90 - For seeds and dimensions, preserve the existing Markdown/frontmatter format and tags.91 - Avoid speculative knobs, broad refactors, unrelated formatting, and private tool-generated references in code, commit messages, PR bodies, or comments.92934. **Validate the requested feature, not only the suite.**94 - Run the narrowest test that proves the issue requirement first, then broaden.95 - Add or update tests for behavior changes.96 - For audit flow changes, validate the exact flow the issue requests: target tools, sample metadata, judge/rescore behavior, image or multimodal content, log replay, or docs command.97 - In the PR body, include both:98 - **Feature validation:** which test or manual command proves the issue is fixed and why.99 - **Regression validation:** `make check` and `make test`, or exact blockers if the environment cannot run them.1001015. **Run checks.**102103 ```bash104 uv run pytest tests/path/to/test_file.py::test_name -v105 make check106 make test107 ```108109 `make check` runs pyright plus ruff fixes/formatting locally. After it runs, review the diff so formatting changes are intentional. CI checks ruff formatting without applying fixes, so the local tree must be clean and formatted before push.110111 For docs changes, render the affected Quarto docs when practical:112113 ```bash114 uv sync --group doc115 cd docs116 source ../.venv/bin/activate117 quarto render118 ```119120 If full tests fail for an unrelated existing issue, capture the failing tests, keep the focused feature proof, and state the residual risk plainly.1211226. **Commit and push.**123 - Commit only files for this PR.124 - Use the author `Deepak Jain <deepujain@gmail.com>`.125 - Use a direct, maintainer-facing message such as `feat: add image messages to audits` or `fix: support rescore judge override`.126 - Include `Closes #NN` in the PR body, not necessarily in the commit message.1271287. **Open the PR.**129130 ```bash131 gh pr create \132 --repo meridianlabs-ai/inspect_petri \133 --base main \134 --head deepujain:issue-NN-short-topic \135 --draft136 ```137138 PR body shape:139140 ```markdown141 Summary142 - ...143144 Feature validation145 - ...146147 Regression validation148 - make check149 - make test150151 Closes #NN.152 ```1531548. **After opening or updating a PR, close the loop.**155 - Inspect CI, review comments, and bot feedback on the current head.156 - Fix actionable comments, rerun focused validation, push, and leave a short factual comment.157 - If feedback is stale or unrelated, verify current head and explain briefly rather than guessing.158159## Issue selection preferences160161- Trigger phrase: **"sweep"** when the active repo/thread context identifies Inspect Petri.162163Prefer issues that have concrete acceptance criteria and can be proven locally. Good Inspect Petri issue shapes include audit API gaps, Inspect AI integration mismatches, target tool handling, sample metadata behavior, scorer/judge/rescore flows, multimodal message support, docs examples, and small testable seed/dimension fixes.164165Avoid issues that depend on hidden product direction, secrets, private eval data, or large design decisions unless the user explicitly wants that conversation.