Repository navigation
Require reproducible examples on issues; add ProfilingMiddleware - #141
Merged
Merged
Conversation
Issues filed from recent reviews carried illustrative snippets -- models the reader had to invent, harnesses that appeared nowhere -- rather than something a maintainer could run. Add the rule to AGENTS.md: every issue asserting behavior carries a `## Reproduction` section with one complete, minimal, runnable script, the command, the verbatim output, the expected output, and the environment. Cover the edges: performance findings ship their measurement harness, and findings with nothing to run put their evidence (the search, its output) under the same heading. Add matching GitHub issue forms (bug, enhancement, documentation, upstream friction) so filings through the web UI collect the same fields, with blank issues disabled. The upstream form states up front that it is a drafting workspace and nothing is sent upstream without a maintainer. Assisted-by: Claude:claude-opus-5
TinyDB has no indexes, so costs are paid in whole-table reads and writes -- and the recent performance issues (#122, #123, #130) each had to hand-roll a counting Storage subclass to show how many. Ship that tool instead: ProfilingMiddleware wraps any storage, counts each read() and write() that reaches it, and resets between measurements. Counters live on the middleware instance, which is the same object TinyDB uses, so a kept reference is all a test needs. Documented with the other middlewares on the storage page, with a doctested example asserting the exact per-insert counts -- so the docs' own numbers break loudly if the write path's cost changes. Assisted-by: Claude:claude-fable-5
✅ Deploy Preview for tinydantic-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Two related changes: the convention that issues carry runnable evidence, and the tool that makes the performance half of that convention easy.
Reproduction sections on issues
AGENTS.mdnow requires every issue that asserts behavior to carry a## Reproductionsection: one complete, minimal, runnable script, the command that ran it, the verbatim output, the expected output, and the environment. Performance findings ship their measurement harness on the same terms, and findings with genuinely nothing to run (a missing docs page, a decision to record) put their evidence — the search, its output — under the same heading.Matching GitHub issue forms (
bug,enhancement,documentation,upstreamfriction) collect the same fields for filings through the web UI, with blank issues disabled. The upstream form states up front that it is a drafting workspace: nothing is sent to an upstream project without a maintainer sending it.All 19 open issues that predate the rule have already been backfilled with run-and-pasted reproduction sections; this PR is the convention and the forms.
ProfilingMiddleware
The performance issues (#122, #123, #130) each had to hand-roll a counting
Storagesubclass to show how many reads an operation costs.ProfilingMiddlewareships that tool: it wraps any storage, counts eachread()andwrite()that reaches it, andreset()s between measurements. Counters live on the middleware instance — the same object TinyDB uses — so a kept reference is all a test needs.Documented beside the other middlewares on the storage page, with a doctested example asserting the exact per-insert counts, so the docs' own numbers fail CI if the write path's storage cost ever changes.
Verification
poe test— 3875 passed (7 new middleware tests plus the new doctests)poe check— ruff, reuse, cspell, mypy, pyright all greenpoe docs-build— strict mode, greenpoe test-matrix— 3875 passed on each of Python 3.10, 3.11, 3.12, 3.13, 3.14