Skip to content

fix: gate linear token sequences by flag profile - #114

Open
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1cfrom
agent/logs-reggie-l1d
Open

fix: gate linear token sequences by flag profile#114
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1cfrom
agent/logs-reggie-l1d

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

Summary

  • admits named-capture Linear Token Sequences only for explicit Reggie DOTALL requests
  • keeps source-inline modifiers and non-DOTALL semantic flags on the normal compiler route
  • derives modifier status from original source before normalization, including escape, quote, class,
    and comment contexts
  • converts logs LTS-positive fixtures to the Reggie-owned DOTALL API

Validation

  • ./gradlew jacocoVerify build
  • focused LTS, access-log, concurrency, and flag API suites
  • final implementation-plan validation and independent code review

Stacked on #113 (which is stacked on #112 and #111).

CopilotAI 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 tightens when the runtime compiler may take the named-capture Linear Token Sequence (LTS) fast-path by requiring an explicit Reggie DOTALL flag profile (rather than source-inline modifiers), and adds tests to lock in the new routing behavior and cache interactions.

Changes:

  • Gate LTS admission behind a source-derived “inline modifier present?” scan and an explicit Reggie DOTALL flag profile (not (?s) in the pattern text).
  • Thread the LTS-admission profile through RuntimeCompiler.compile(...) into tryCompileLinearTokenSequence(...) / isRuntimeExecutableLinearTokenSequence(...).
  • Update/add runtime tests to use the Reggie-owned DOTALL API and cover routing, cache-order independence, and inline-modifier detection.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/RuntimeCompiler.javaIntroduces and propagates LinearTokenSequenceAdmission and adds a source scanner to block LTS when inline modifiers are present unless explicitly permitted by the Reggie DOTALL flag profile.
reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/LinearTokenSequenceMatcherTest.javaUpdates fixtures to use ReggieFlags.DOTALL and adds tests covering the new LTS gating rules and inline-modifier scanner behavior.
reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/LinearTokenSequenceMatcherConcurrencyTest.javaUpdates compilation of LTS fixtures to use explicit Reggie DOTALL when fixtures previously used a leading (?s).
reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/LinearTokenSequenceAccessLogTest.javaSame fixture compilation update as concurrency test; centralizes it in a helper to convert leading (?s) into ReggieFlags.DOTALL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jbachorik
jbachorik marked this pull request as ready for review August 14, 2026 12:54

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:dde7ffc2e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jbachorik
jbachorikforce-pushed the agent/logs-reggie-l1d branch from dde7ffc to 77e99a5CompareAugust 14, 2026 13:05
@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.28090% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.4%. Comparing base (81f6dc5) to head (f4bb496).

Files with missing linesPatch %Lines
.../com/datadoghq/reggie/runtime/RuntimeCompiler.java75.0%6 Missing and 16 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## agent/logs-reggie-l1c #114 +/- ##
=======================================================
Coverage 84.4% 84.4% Complexity 1 1 =======================================================
Files 147 147 Lines 42993 43067 +74 Branches 5860 5890 +30 =======================================================
+ Hits 36296 36367 +71 + Misses 4911 4905 -6 - Partials 1786 1795 +9 
Files with missing linesCoverage Δ
...om/datadoghq/reggie/codegen/automaton/CharSet.java90.2% <ø> (ø)
...ghq/reggie/runtime/LinearTokenSequenceMatcher.java80.6% <100.0%> (ø)
.../com/datadoghq/reggie/runtime/RuntimeCompiler.java87.0% <75.0%> (-1.0%)⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81f6dc5...f4bb496. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbachorik
jbachorikforce-pushed the agent/logs-reggie-l1d branch from 77e99a5 to c4b2025CompareAugust 14, 2026 13:32
@jbachorik
jbachorikforce-pushed the agent/logs-reggie-l1d branch from c4b2025 to f4bb496CompareAugust 14, 2026 13:42
Sign up for freeto 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.

3 participants

@jbachorik@codecov-commenter