audit-tests
Audit the ProbPipe test suite for gaps, stale tests, duplicates, style issues, weak assertions, and mathematical correctness.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Audit the ProbPipe test suite for gaps, stale tests, duplicates, style issues, weak assertions, and mathematical correctness.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Review a ProbPipe PR for documentation, tests, API consistency, philosophy adherence, and code quality. Use when asked to review a PR or check for issues.
Critically interview the user about a plan or design until every design-significant branch reaches shared understanding. Use when the user wants to stress-test a plan, clarify an uncertain idea, compare real alternatives, expose edge cases, or be grilled before implementation.
Extend a design criticizing session with repository-aware documentation discovery, terminology checks, decision status, and controlled documentation updates. Use when the user wants to stress-test a plan against existing code and documented intent, create a private working draft, or keep canonical design documentation aligned as decisions are accepted.
Run four independent PR reviews (/review-pr, /review, /code-review, /audit-tests) in parallel and merge them into one deduplicated, severity-tiered report. Use for a thorough multi-lens review before merging a non-trivial PR.
| name | audit-tests |
| description | Audit the ProbPipe test suite for gaps, stale tests, duplicates, style issues, weak assertions, and mathematical correctness. |
| disable-model-invocation | true |
| allowed-tools | Read Grep Glob Bash(pytest *) Bash(git *) Agent |
| argument-hint | ["test-file-or-pattern"] |
Audit the test suite for quality, correctness, and completeness.
Scope: If $ARGUMENTS is provided, audit only the specified files or
patterns (e.g., tests/test_continuous.py, tests/test_joint*). Otherwise,
audit the entire tests/ directory.
You are performing a read-only audit. Do not edit any files. Your job is to analyze the tests and present a structured report of findings with concrete suggestions. The user will decide which suggestions to act on before any changes are made.
Read the testing conventions section of STYLE_GUIDE.md and the architecture
overview in CONTRIBUTING.md. These define the expected test structure, naming,
fixture patterns, and project abstractions that tests should exercise.
Read the source files that the tests under audit are exercising. You need to
understand the actual behavior in order to judge whether tests are correct,
complete, and non-stale. For a full audit, scan probpipe/__init__.py for the
public API surface, then read source files as needed per test file.
Read every test file in scope. Also read:
tests/conftest.py — shared fixturespyproject.toml — pytest configuration, markers, xdist settingsWork through every category below for each test file in scope. Note specific findings with file paths, line numbers, and the test function/class name. If a category has no issues for a file, say so briefly.
Identify source code that lacks test coverage:
TypeError, ValueError, and other expected exceptions
tested? Do tests verify that the correct exception type and message are raised?SupportsSampling,
SupportsLogProb, etc.), is each protocol method tested?Identify tests that have become outdated:
sample() but never checking the
result beyond its existence)assert True, assert result is not None, or similarly weak
assertions where a meaningful value check is possibleatol=1.0) that would pass even
with incorrect resultsFlag tests that appear to have been added to make the test suite pass or inflate coverage rather than to validate real behavior:
test_coverage_gaps.py or similar that merely touch code paths
without meaningful assertionsFor tests of mathematical operations (distributions, inference, linear algebra, expectations, etc.), check:
Independent baselines — Does the test validate results against an independent calculation? Valid baselines include:
log_prob consistency with prob,
KL divergence non-negativity, law of total expectation)The baseline should not use the same code path as the implementation being
tested. For example, testing mean(Normal(0, 1)) by checking it equals
Normal(0, 1).loc just verifies passthrough, not correctness.
Tolerance appropriateness — Are atol/rtol values tight enough to
catch bugs but loose enough for floating-point and Monte Carlo noise? Flag
both overly loose (masks bugs) and overly tight (flaky) tolerances.
Shape and broadcasting — Do tests verify output shapes, especially for batched operations, broadcasting, and multi-dimensional inputs?
Edge cases specific to math — Degenerate parameters (zero variance, unit matrices), extreme values (very large/small), numerical stability (log-space operations, underflow/overflow).
Check tests against the conventions in STYLE_GUIDE.md section 8 and patterns
established in the existing suite:
Test* classes? Are related tests
grouped logically?test_<method>_<scenario> pattern?probpipe (public API), not from private modules?pytest.importorskip() or pytest markers
for optional backends?np.testing.assert_allclose for numerical comparisons
(not bare assert with manual tolerance)?Organize your findings into a structured report with this format:
## Test Audit: <scope description>
### Summary
<1-2 sentence overall assessment of test suite health>
### Findings
#### Critical (tests that are wrong, misleading, or mask bugs)
- ...
#### Gaps (missing tests that should exist)
- ...
#### Recommended (improvements to existing tests)
- ...
#### Minor (style, naming, cleanup)
- ...
### Suggested Changes
<Numbered list of concrete, actionable changes. For each:
- The file and test function/class
- What is wrong or missing
- What the fix or new test should look like (brief description, not full code)
Group related changes together.>
Do not make any changes. Present the report and wait for the user to decide which suggestions to implement. Once the user approves specific items, then proceed with edits.