Skip to content

tests: property-based tests for the parsers and id derivations - #48

Merged
open-coder-ai-org merged 3 commits into
mainfrom
fix/property-tests
Sep 7, 2026
Merged

tests: property-based tests for the parsers and id derivations#48
open-coder-ai-org merged 3 commits into
mainfrom
fix/property-tests

Conversation

@open-coder-ai-org

Copy link
Copy Markdown
Collaborator

What

Scorecard's fuzzing check scored zero: nothing exercised the parsers beyond hand-picked examples. Six Hypothesis properties now hold for any input, 200 or 100 examples each:

  • a rule id is non-empty, lowercase, hyphenated, at most 48 characters, and stable under re-slugging
  • extracting rules from any file never raises, never repeats an id, and every candidate carries a valid id
  • input_hash is deterministic and order-sensitive
  • a prompt.md frontmatter mapping and body read back as written
  • the run history table names every run and every subject-model pair
  • rendered Markdown links to .md files become .html links while other links stay

Two strategies are scoped on purpose, to plain YAML scalars and to bodies without a bare carriage return, so the properties test the frontmatter split and not YAML's scalar grammar or read_text's newline normalisation. hypothesis joins the dev extra, the hash-pinned CI requirements and the chock dependency allowlist. Scorecard recognises Hypothesis for its fuzzing check.

Note: this branch conflicts with #43's requirements/ci.txt only if merged first; merge #43, #45, #46 then this, or tell me and I will rebase.

Definition of done

  • python -m ruff check . and python -m ruff format --check . clean
  • python -m pytest -q green: 400 passed on 3.11; 397 passed and 3 skipped on 3.10 (the version-pinned figure compare and two that need optional packages not installed there)
  • Schema changes: none
  • chock check clean; .agents/policies/ unchanged; the regenerated requirements/ci.txt installs in a fresh venv with --require-hashes

Claims

  • No row is described as re-derivable unless it actually recomputes from the subject
    plus its recorded configuration and carries an inputHash. A row that could not be
    measured says NotAvailable, Error, or NotApplicable and why. Tests only.

🤖 Generated with Claude Code

https://claude.ai/code/session_014gwmBVUHSgohCLkNVqAR77


Generated by Claude Code

Scorecard's fuzzing check scored zero: nothing exercised the parsers
beyond hand-picked examples. Six Hypothesis properties now hold for any
input: a rule id is short, lowercase, hyphenated and stable under
re-slugging; extracting rules from any file never raises and never
repeats an id; input hashes are deterministic and order-sensitive;
prompt.md frontmatter round-trips its mapping and body; the run
history table names every run and pair; rendered Markdown links point
at pages while other links stay. hypothesis joins the dev extra, the
hashed CI requirements and the dependency allowlist.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gwmBVUHSgohCLkNVqAR77
Signed-off-by: Claude <noreply@anthropic.com>
matplotlib 3.11 requires Python >= 3.11, and this package still declares
requires-python >= 3.10 with a 3.10 job in CI. Dependabot's bump in #47 was
compiled on a newer interpreter, so its lockfile dropped the pins that only
3.10 needs (typing-extensions, tomli, exceptiongroup) and the hashed install
failed on the first job; it also rewrote the floor in ci.in to >= 3.11.1.

Pin the ceiling in ci.in with the reason beside it, and tell Dependabot to
skip feature bumps of matplotlib under /requirements so the same PR does not
reopen every week. Patch releases still flow. The regenerated ci.txt is
byte-identical to the current one, which confirms the lock was already the
3.10-compatible resolution.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gwmBVUHSgohCLkNVqAR77
Signed-off-by: Claude <noreply@anthropic.com>
@open-coder-ai-org
open-coder-ai-org marked this pull request as ready for review September 7, 2026 15:32
@open-coder-ai-org
open-coder-ai-org merged commit 68e88db into main Sep 7, 2026
13 checks passed
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.

2 participants