Repository navigation
docs: add rules for deciding what to test - #2816
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
| received the test's own inputs. | ||
| - A new test that needs Postgres goes in `scripts/ci/db-contracts.txt` (or `db-pins.txt` for a | ||
| query budget) in the same change, or isn't written; CI skips database tests no list or job | ||
| selects. CI has no Redis, so don't add tests that need one. |
There was a problem hiding this comment.
The blanket prohibition on Redis-dependent tests in AGENTS.md conflicts with rule 22, which requires Go lookup query-count regression tests through production handlers backed by real PostgreSQL and Redis. Restrict the prohibition to CI jobs without Redis and explicitly preserve those integration tests.
Also found in:
CONTRIBUTING.md:178-178
Kody rule violation: Batch scoped Go lookups and bound dependency fan-out
selects. Keep Redis-dependent tests separate from CI jobs without Redis, but pin Go lookup
query-count regressions through production handlers backed by real PostgreSQL and Redis.Prompt for LLM
File AGENTS.md:
Line 207:
The blanket prohibition on Redis-dependent tests in AGENTS.md conflicts with rule 22, which requires Go lookup query-count regression tests through production handlers backed by real PostgreSQL and Redis. Restrict the prohibition to CI jobs without Redis and explicitly preserve those integration tests.
**Also found in:**
- `CONTRIBUTING.md:178-178`
Suggested Code:
selects. Keep Redis-dependent tests separate from CI jobs without Redis, but pin Go lookup
query-count regressions through production handlers backed by real PostgreSQL and Redis.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Leaving this as written. No CI job runs Redis, so a test that needs a live Redis never runs in CI, which is why the section says not to add one. Query-count regressions still have a CI home: they go in scripts/ci/db-pins.txt, which the Go DB pins job runs against Postgres, and the CONTRIBUTING.md bullet names that list. The Redis half of the Kody rule cannot be met in CI as it is set up today.
There was a problem hiding this comment.
Agreed—my suggestion was not actionable with the current CI setup. Requiring live Redis would add tests that CI never runs, while query-count regressions already have a CI path through scripts/ci/db-pins.txt against Postgres.
I withdraw the suggested documentation change. The mismatch is in the Kody rule’s Redis requirement, not this PR. If you’d like, I can propose a rule update that preserves query-count regression coverage without requiring Redis where CI does not provide it.
Problem
Related issue: N/A
Validation tasks: none
CONTRIBUTING.md tells every change to add a test that fails before the fix, and docs/ai-contributions.md says to add tests for changed behavior. Nothing says what not to test. Coding agents, which write most changes here, take that literally: they add a test for every change and repeat it at every layer. Go and web test code reached about 876,000 lines, as large as the production Go code, and much of it catches nothing while adding CI time and slowing every change. This change gives contributors and agents rules for when a test earns its place.
Approach
The rules come from what the test-suite audit in #2817 found most often among low-value tests: tests that only echo a fake, the same behavior tested at several layers and on both
/api/v1and/api/v2, pins on SQL statements, copy, or CSS, Postgres and Redis tests that no CI job runs, and retry tests that sleep through real backoff. silo-android's AGENTS.md already has a narrower rule of this kind.Validation
make verify-local-paths: passes.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-2816/
Risks
Reviewers and agents will ask for fewer tests than before. The rules still require tests for security, data integrity, public contracts, and failure handling.
Checklist
AI Disclosure
🤖 Generated with Claude Code