Skip to content

Require reproducible examples on issues; add ProfilingMiddleware - #141

Merged
cdwilson merged 2 commits into
mainfrom
issue-reproduction-conventions
Aug 13, 2026
Merged

cdwilson merged 2 commits into
mainfrom
issue-reproduction-conventions

Conversation

@cdwilson

Copy link
Copy Markdown
Collaborator

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.md now requires every issue that asserts behavior to carry a ## Reproduction section: 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, upstream friction) 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 Storage subclass to show how many reads an operation costs. ProfilingMiddleware ships that tool: it wraps any storage, counts each read() and write() that reaches it, and reset()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 green
  • poe docs-build — strict mode, green
  • poe test-matrix — 3875 passed on each of Python 3.10, 3.11, 3.12, 3.13, 3.14

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
@netlify

netlify Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tinydantic-preview ready!

Name Link
🔨 Latest commit 669ada1
🔍 Latest deploy log https://app.netlify.com/projects/tinydantic-preview/deploys/6a7e37592dbf260008b21561
😎 Deploy Preview https://deploy-preview-141--tinydantic-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 78
Accessibility: 98
Best Practices: 83
SEO: 97
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant