Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Correctness gates
timeout-minutes: 10
run: ./gradlew :reggie-integration-tests:test --tests '*AlgorithmicFuzzTest.divergenceGate_enforcedViaProperty' -Dreggie.fuzz.enforce=true -Dreggie.fuzz.maxFindings=65
run: ./gradlew :reggie-integration-tests:test --tests '*AlgorithmicFuzzTest.divergenceGate_enforcedViaProperty' -Dreggie.fuzz.enforce=true -Dreggie.fuzz.maxFindings=28

- name: Generate coverage report and verify gates
run: ./gradlew jacocoAggregateReport jacocoVerify
Expand Down
928 changes: 59 additions & 869 deletions AGENTS.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [1.0.0] - Unreleased

### 1.0.0 pre-release checklist
- [x] Fuzz divergence budget ≤ 30 (currently 28 — all remaining gaps are group-span on adversarial inputs)
- [x] Zero boolean divergences (no false positives / false negatives on real-world patterns)
- [x] `StrategyCorrectnessMetaTest` 0 mismatches
- [x] PCRE conformance 100% (53/53)
- [x] Thread-safety contract documented: `RuntimeCompiler` is thread-safe; matcher instances are not
- [x] Thread-safety stress test for `RuntimeCompiler` concurrent compile/match (`RuntimeCompilerTest.testConcurrentCompilation`, `DfaMatcherConcurrencyTest`)

### Changes since 0.3.0
- fix: route B-CGG-1 (negated CharClass in SPECIALIZED_CONCAT_GREEDY_GROUP) to JDK fallback — eliminates false negatives for patterns like `[1]([^b]{2})`
- fix: route B-SQG-1 (inner quantifier min>1 in SPECIALIZED_QUANTIFIED_GROUP) to JDK fallback — eliminates false positives for patterns like `(c{2}){1,}`
- fix: fuzz divergence budget 34 → 28 (B-CGG-1 + B-SQG-1 guards)
- fix: atomic groups and possessive quantifiers (#92)
- fix: DFA_UNROLLED_WITH_GROUPS group-span divergences A1+A2 routed to PIKEVM_CAPTURE (#90)
- fix: per-config backref NFA, cache collision fixes, CRLF anchors, fallback guards (#89)
- fix: DFA assertion evaluation for sandwich lookaround and lookahead-in-quantifier (#87, #88)
- fix: POSIX aliases, inline flag regression tests, backref digit disambiguation (#88)

## [Unreleased]

- feat: ReggieOption/@RegexPattern fallback substrate + PIKEVM routing groundwork
Expand Down
36 changes: 4 additions & 32 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
# Development Guide

**IMPORTANT INSTRUCTIONS FOR CLAUDE CODE AND AI TOOLS:**
**DO NOT EDIT THIS FILE.** It is a redirect stub for tools that expect `CLAUDE.md`.

## DO NOT EDIT THIS FILE

**All updates MUST be made to [AGENTS.md](AGENTS.md) instead.**

`AGENTS.md` is the single source of truth for this project. When you need to:
- Add new build commands or workflows
- Document new features or modules
- Update code conventions or style rules
- Add critical rules or best practices
- Update testing/debugging procedures
- Document performance optimizations
- Update PCRE conformance status
- Make ANY documentation changes

**→ Edit AGENTS.md, NOT this file.**

This file exists only as a redirect to maintain compatibility with tools that expect CLAUDE.md.

---

## For All Development Guidance, See:

**[AGENTS.md](AGENTS.md)** - The authoritative reference containing:
- Build commands and workflows
- Module architecture
- Code conventions and style
- Critical rules and best practices
- Testing and debugging
- Performance optimization
- PCRE conformance status
- All project documentation
All development guidance — build commands, architecture, conventions, critical rules,
testing/debugging, performance, PCRE conformance status — lives in **[AGENTS.md](AGENTS.md)**,
the single source of truth for this project. Edit that file instead.
29 changes: 16 additions & 13 deletions doc/2026-07-02-reggie-1.0.0-readiness-assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ work. Evidence-backed (file:line / gate output / build). Current version: **`0.4
## Verdict: **Materially closer to 1.0 — P0 and key P1 items resolved. A focused burst can close it.**

The P0 boolean-correctness blocker (#31 sandwich lookaround) is fixed. The meta-test shows zero
mismatches across all strategies. The fuzz gate runs at 34 (down from 69 on June 18). New strategies
mismatches across all strategies. The fuzz gate runs at 28 (down from 69 on June 18). New strategies
(COUNTING_GLUSHKOV, atomic groups, possessive quantifiers) are fully covered. The remaining blockers
are documentation hygiene (P0-1, P0-3) and one thread-safety validation (P1-4).

## Gate metrics (current HEAD `3edd608`, 2026-07-02)
## Gate metrics (current HEAD `eedc7c1`, 2026-07-02)

| Metric | June 18 | July 2 | Change |
|---|---|---|---|
| `./gradlew test` | GREEN | **GREEN** | ✅ |
| Fuzz budget (`KNOWN_FINDINGS_BUDGET`) | 69 | **34** | ✅ −35 |
| Fuzz gate findings | 34/34 (at budget) | **34/34** | → holds |
| Fuzz budget (`KNOWN_FINDINGS_BUDGET`) | 69 | **28** | ✅ −41 |
| Fuzz gate findings | 34/34 (at budget) | **28/28** | → holds |
| Meta-test mismatches | unknown | **0** | ✅ |
| PCRE conformance | inconsistent | **100.0% (53/53)** | ✅ |
| Build-breaking regressions (post-merge) | — | **3 files, now fixed** | fixed in this session |
Expand All @@ -28,7 +28,7 @@ are documentation hygiene (P0-1, P0-3) and one thread-safety validation (P1-4).
| Build / full test suite | Ready | **Ready** | Post-merge duplicate-declaration bugs fixed this session |
| ReDoS / linear-time guarantee | Ready | **Ready** | COUNTING_GLUSHKOV adds O(n) bound-independent counting |
| Boolean match correctness | **Gap (#31)** | **Ready** | `fix(#28,#31)` (PR #87) fixed sandwich lookaround; meta-test = 0 mismatches |
| Group-span / capture correctness | Gap (69) | **Gap (34)** | Budget halved; 34 pre-existing native span divergences remain (all degenerate inputs) |
| Group-span / capture correctness | Gap (69) | **Gap (28)** | Budget halved; 28 pre-existing native span divergences remain (all degenerate inputs) |
| Fallback policy (code) | Ready | **Ready** | throw-by-default; opt-in JDK via `allowJdkFallback()` |
| Correctness-guarantee docs | **Gap (P0)** | **Gap (P0)** | AGENTS.md prose still contradicts throw-by-default; not reconciled |
| Conformance metrics | **Gap (P0)** | **Ready** | AGENTS.md now states 100.0% (53/53); `CorrectnessTest` passes against Reggie |
Expand All @@ -37,18 +37,21 @@ are documentation hygiene (P0-1, P0-3) and one thread-safety validation (P1-4).
| Release tooling | Ready | **Ready** | scripts/release.sh confirmed |
| Versioning / CHANGELOG | Gap (minor) | **Gap (minor)** | No 1.0 checklist in CHANGELOG |
| Parser robustness | Gap (minor) | **Gap (minor)** | Malformed patterns can still leak generic RuntimeException |
| Lazy quantifiers | Partial | **Partial** | Unchanged; native for some RECURSIVE_DESCENT cases; known limitation |
| Lazy quantifiers | Partial | **Ready (basic)** | Routed to PIKEVM_CAPTURE with lazy-aware NFA (ThompsonBuilder(true)); guard against lookaround, possessive, backref; tested by PikeVmCaptureRegressionTest |
| Atomic groups / possessive | — | **Ready** | New in `ae96462` + `3edd608`; `AtomicGroupPikeVMTest` covers correctness |
| COUNTING_GLUSHKOV strategy | — | **Ready** | New in `3edd608`; routing test + runtime test cover correctness |

## Updated pre-1.0.0 punch list

**P0 — still open (must do before any public correctness claim):**
1. **Reconcile AGENTS.md / README prose** with actual throw-by-default behavior. State: native-or-throw
by default; opt-in JDK fallback via `compileAllowingFallback()`. Currently AGENTS.md:717-737 says
"logs a WARNING and falls back" which is wrong.
by default; opt-in JDK fallback via `compileAllowingFallback()`. AGENTS.md:717-737 correctly
describes NFA matcher thread-safety (not fallback policy). The fallback description is at
AGENTS.md:757-762 ("Automatic Fallback" section) and correctly states that
`compileAllowingFallback()` emits a WARNING log — that is the opt-in path, not the default.
Verify the README and any user-facing doc page does not imply fallback is automatic/silent.
2. ~~Establish single source of truth for PCRE conformance~~ **DONE** (AGENTS.md:69 = 100.0%, 53/53).
3. **State the fuzz guarantee honestly**: "zero *boolean* divergences; 34 known native group-span
3. **State the fuzz guarantee honestly**: "zero *boolean* divergences; 28 known native group-span
divergences on degenerate inputs, all O(n)/ReDoS-safe." Current wording does not say this.

**P1 — one remaining:**
Expand All @@ -59,9 +62,9 @@ are documentation hygiene (P0-1, P0-3) and one thread-safety validation (P1-4).
6. ~~Audit #28, #33, #34, #37~~ **DONE** via fixes in PR #87, PR #88, PR #89.

**P2 — capture-correctness gaps (can ship 1.0 with documented known limitations):**
7. **34-finding fuzz gate**: drive down or document as "known, native, O(n), span-only,
degenerate-input" and give the budget headroom (budget > count). Currently at-budget (34/34) which
is brittle — any regression will hit zero headroom immediately. Recommend: budget = 40 with
7. **28-finding fuzz gate**: drive down or document as "known, native, O(n), span-only,
degenerate-input" and give the budget headroom (budget > count). Currently at-budget (28/28) which
is brittle — any regression will hit zero headroom immediately. Recommend: budget = 34 with
explicit classification doc.
8. Quantify real-world frequency (fuzzer-shape evidence only so far).

Expand All @@ -74,7 +77,7 @@ are documentation hygiene (P0-1, P0-3) and one thread-safety validation (P1-4).

- **Boolean correctness gap closed**: issue #31 (sandwich lookaround silent wrong-answer) fixed.
Meta-test at 0 mismatches across all 28+ strategies.
- **Fuzz budget halved** 69 → 34: per-config backref NFA (PR #89), DFA group-span routing (PR #90),
- **Fuzz budget reduced** 69 → 28: per-config backref NFA (PR #89), DFA group-span routing (PR #90),
atomic group / possessive quantifiers (PRs #92 + `3edd608`), CRLF / fallback guards.
- **COUNTING_GLUSHKOV** strategy: O(n) bound-independent counting for `X{n,m}` (max>10, group-free
body). New engine path with routing + runtime tests.
Expand Down
Loading
Loading