Skip to content

feat: expose native pattern capabilities#119

Draft
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1hfrom
agent/logs-reggie-l1j
Draft

feat: expose native pattern capabilities#119
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1hfrom
agent/logs-reggie-l1j

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

Summary

Exposes explicit immutable capabilities for native named-LTS compiled patterns:

  • native-only execution;
  • native-algorithm linearity, scoped to caller-controlled sequence cost;
  • caller-thread cooperative interruptible CharSequence matching.

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
  • final implementation-plan validation: clean
  • final independent code review: clean

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReggieNativeCapability enum 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.

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