feat: expose native pattern capabilities#119
Draft
jbachorik wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an explicit, immutable “capabilities” surface for native named-LTS compiled patterns, and extends tests to ensure those capabilities remain stable across compilation paths and that interruptibility checks execute on the caller thread.
Changes:
- Add
ReggieNativeCapabilityenum to represent guaranteed properties of native named-LTS patterns. - Expose
ReggieCompiledPattern.capabilities()returning a shared immutable capability set. - Add/extend runtime tests covering capability stability (direct compile, cached compile, eviction/recompile, separate compiler instances) and verifying interrupt checks run on the matching caller thread.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieNativeCapability.java | Defines the stable capability enum and documents interruptibility/linearity guarantees. |
| reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieCompiledPattern.java | Exposes an immutable capability set via capabilities(). |
| reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/ReggieNativeCapabilityTest.java | Adds coverage for capability immutability and stability across caching/eviction/compiler instances. |
| reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/InterruptibleCharSequenceTest.java | Adds a test asserting interruption checks run on the matching caller thread. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Exposes explicit immutable capabilities for native named-LTS compiled patterns:
CharSequencematching.The capability set is stable across direct compilation, bounded-cache hits, eviction/recompile, and independent compiler instances.
Validation
./gradlew :reggie-runtime:test --tests com.datadoghq.reggie.runtime.ReggieNativeCapabilityTest --tests com.datadoghq.reggie.runtime.InterruptibleCharSequenceTest./gradlew :reggie-runtime:test./gradlew spotlessApply