Conversation
The existing tests derive their answer key from epigrep itself: the eval corpus freezes expectations the matcher computed, and the semantic fixtures, while hand-written, are tiny. Both catch drift; neither can catch a semantic regression at volume. Add a generator that goes the other way. A PatternSpec describes a pattern; the generator plants episodes that are matches or near-misses by construction and never calls match() or explain(), so the answer key is independent of the code under test. Each negative violates exactly one clause at exactly one step, which is directly its expected NearMiss reason, so all four reasons are covered without hand-enumeration. Two noise regimes. Disjoint background uses types the pattern can never mention, giving exact ground truth. Adversarial background reuses the pattern's own vocabulary, where ground truth no longer holds and the corpus feeds oracle/compiled parity and metamorphic properties instead. The answer key is made to have teeth, and this is asserted rather than assumed: random gaps almost never land on a window's inclusive bound, so the first pass missed a one-unit widening of a three-step window. Planted episodes now sit on the boundaries (first positive at each window's upper bound, window_exceeded negatives missing by exactly 1, predicate values boundary-tight), and a mutation test requires nine one-clause pattern changes to each break the corpus. A companion test requires adversarial noise to genuinely perturb results, so that regime cannot silently test nothing. Test-only: nothing under python/epigrep/ or src/ references synth, so invariant 5 holds and the wheel is unchanged. Three v1 restrictions are enforced by PatternSpec.validate with tests asserting the rejection -- distinct event types per spec, integer predicate literals, and no shared partitions for unwindowed specs. Equal-timestamp tie-breaking stays with fixtures 02/03. Verified: pytest 476 passed / 6 skipped; cargo test 52+2 passed; fmt and clippy (core and epigrep-py) clean; check_version_sync and LICENSE diff pass; mkdocs build --strict passes; apps/ 56 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CjMbfWJXUgcHTxd4c7BfHM
Per reference:repo-agent-policy, a repo's stated commands block and its CI must never disagree. Three did. - mkdocs build --strict never gated a pull request. docs.yml runs it only on pushes to main, behind a paths: filter for docs/ and mkdocs.yml, so a PR could break the docs build (or a README snippet) unnoticed. ci.yml now owns the gate; docs.yml stays responsible for publishing. - The Python job installed a hand-listed "maturin pytest pandas" rather than the [test] extra declared in pyproject, so polars and pyarrow were absent and the parquet CLI test and the polars eventise test skipped silently -- a 0.2 shipped feature untested in CI. It now installs the built wheel by path with its [test] extra, which keeps epigrep coming from dist/ while sourcing test dependencies from pyproject, so the two cannot drift apart again. - The apps/ apparatus tests ran nowhere. They consume the public installed API and had no gate stopping them rotting. Gating them does not make apparatus part of the package, so invariant 5 is reworded rather than weakened: apps/ still may not be imported by python/epigrep/, appear in the wheel, or become a dependency. Also adds .claude/skills/epigrep-slice/, the optional repo-local slice skill the canon sanctions, encoding the loop executably instead of as prose an agent may skip -- including the step OB keeps proving necessary: verify OB's claims against the repo before planning, because it has repeatedly gone stale about merge and release state. CLAUDE.md's workflow now also says to open a PR, since CI does not run on a bare branch push. .gitignore excludes .claude/settings.local.json; the committed skills directory is deliberate. Verified: pytest 476 passed / 6 skipped; apps/ 56 passed; mkdocs build --strict clean; ci.yml parses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CjMbfWJXUgcHTxd4c7BfHM
This branch has not been deployed
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.
What
Adds a synthetic-corpus generator and the suite that consumes it. Test-only — nothing under
python/epigrep/orsrc/references it, so invariant 5 holds and the wheel is unchanged.Why
The existing tests derive their answer key from epigrep itself:
apps/epigrep-eval/tasks.jsonfreezes expectations the matcher computed, and the semantic fixtures, while hand-written, are tiny. Both catch drift; neither catches a semantic regression at volume.crates/epigrep-py/tests/synth.pygoes the other way. APatternSpecdescribes a pattern; the generator plants episodes that are matches or near-misses by construction and never callsmatch()orexplain(). Each negative violates exactly one clause at exactly one step, which is directly its expectedNearMissreason, so all four reasons are covered without hand-enumeration.Two noise regimes:
The answer key has teeth, and that is asserted
Random gaps almost never land on a window's inclusive bound, so the first pass missed a one-unit widening of a three-step window. Planted episodes now sit on the boundaries — first positive at each window's upper bound,
window_exceedednegatives missing by exactly 1, predicate values boundary-tight.test_a_single_clause_change_breaks_the_answer_keyruns nine one-clause pattern mutations and requires each to break the corpus. A companion test requires adversarial noise to genuinely perturb results, so that regime cannot silently test nothing.Deliberate v1 restrictions
Each enforced by
PatternSpec.validate, with tests asserting the rejection:A -> Ashapes are not generable);Equal-timestamp tie-breaking is not covered here; it stays with fixtures
02/03.Verified locally
pytest crates/epigrep-py/tests/cargo testcargo fmt --check, clippy (core +epigrep-py)check_version_sync.py,diff LICENSEmkdocs build --strictapps/tests🤖 Generated with Claude Code
https://claude.ai/code/session_01CjMbfWJXUgcHTxd4c7BfHM