Skip to content

feat: add native full capture spans - #121

Open
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1kfrom
agent/logs-reggie-l1l
Open

feat: add native full capture spans#121
jbachorik wants to merge 1 commit into
agent/logs-reggie-l1kfrom
agent/logs-reggie-l1l

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

Adds a conservative direct native full-capture LTS profile for the logs migration stack.\n\n- preserves numeric spans for admitted source captures\n- fails closed on unproven capture/control-flow transforms\n- keeps legacy named-only routing and caches isolated\n\nValidation: spotlessApply; focused runtime tests; :reggie-runtime:test.

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 extends the native linear-token-sequence (LTS) admission path to a conservative full-capture profile, exposing numeric capture spans (groupCount(), start(int), end(int)) while remaining native-only (no JDK fallback) and keeping the legacy/general compiler caches isolated.

Changes:

  • Add a direct “full-capture LTS” compilation path in RuntimeCompiler, with stricter admission checks around capture layout and deterministic boundaries.
  • Expose numeric capture-group span APIs on ReggieMatchState and expand runtime tests to validate JDK-equivalent numeric spans (including unmatched optional captures) and cache isolation.
  • Add AST-level validation (CaptureProjection.fullCaptureLayout) and update documentation describing the July 2026 adoption progress and remaining work.

Reviewed changes

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

Show a summary per file
FileDescription
reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/ReggieCompiledPatternTest.javaAdds/updates tests for numeric spans, rejection shapes, DOTALL behavior, cache isolation, and input mutation safety.
reggie-runtime/src/test/java/com/datadoghq/reggie/runtime/InterruptibleCharSequenceTest.javaAdjusts interruption regression coverage to avoid now-rejected alternation shapes under full-capture admission.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/RuntimeCompiler.javaImplements full-capture LTS admission and supporting deterministic-boundary/capture-layout validation.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieNativeCapability.javaUpdates capability documentation to refer to full-capture LTS.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieMatchState.javaAdds groupCount(), start(int), and end(int) for numeric source capture spans.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieCompileFlag.javaUpdates documentation to reflect the full-capture LTS flag profile.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieCompiledPattern.javaRoutes native compilation through the new full-capture LTS admission.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieCompilationResult.javaUpdates documentation to reflect full-capture native compilation.
reggie-runtime/src/main/java/com/datadoghq/reggie/runtime/ReggieCompilationRejection.javaAdds MISSING_CAPTURE to represent missing numeric capture preservation requirements.
reggie-codegen/src/main/java/com/datadoghq/reggie/codegen/analysis/CaptureProjection.javaAdds fullCaptureLayout to validate a conservative numeric capture layout at the AST level.
doc/plans/logs-backend.mdUpdates migration/adoption planning documentation and clarifies current capabilities/limitations.

💡 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:56

@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:cea7e08975

ℹ️ 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-l1l branch from cea7e08 to e90972aCompareAugust 14, 2026 13:07
@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.97849% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.4%. Comparing base (61206a8) to head (ba547cb).

Files with missing linesPatch %Lines
.../com/datadoghq/reggie/runtime/RuntimeCompiler.java58.0%14 Missing and 38 partials ⚠️
...ghq/reggie/codegen/analysis/CaptureProjection.java68.7%2 Missing and 13 partials ⚠️

❌ Your patch status has failed because the patch coverage (63.9%) is below the target coverage (70.0%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@ Coverage Diff @@## agent/logs-reggie-l1k #121 +/- ##
=========================================================
- Coverage 84.5% 84.4% -0.1% 
Complexity 1 1 =========================================================
Files 156 156 Lines 43277 43460 +183 Branches 5910 5985 +75 =========================================================
+ Hits 36571 36702 +131 - Misses 4913 4917 +4 - Partials 1793 1841 +48 
Files with missing linesCoverage Δ
...om/datadoghq/reggie/codegen/automaton/CharSet.java90.2% <ø> (ø)
...ghq/reggie/runtime/LinearTokenSequenceMatcher.java81.9% <100.0%> (+0.6%)⬆️
...ghq/reggie/runtime/ReggieCompilationRejection.java100.0% <100.0%> (ø)
...adoghq/reggie/runtime/ReggieCompilationResult.java73.3% <ø> (ø)
...om/datadoghq/reggie/runtime/ReggieCompileFlag.java100.0% <ø> (ø)
...atadoghq/reggie/runtime/ReggieCompiledPattern.java100.0% <100.0%> (ø)
...com/datadoghq/reggie/runtime/ReggieMatchState.java100.0% <100.0%> (ø)
...tadoghq/reggie/runtime/ReggieNativeCapability.java100.0% <ø> (ø)
...ghq/reggie/codegen/analysis/CaptureProjection.java63.6% <68.7%> (+3.3%)⬆️
.../com/datadoghq/reggie/runtime/RuntimeCompiler.java84.4% <58.0%> (-3.7%)⬇️

... and 2 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 61206a8...ba547cb. 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-l1l branch from e90972a to 7a80c41CompareAugust 14, 2026 13:40
@jbachorik
jbachorikforce-pushed the agent/logs-reggie-l1l branch from 7a80c41 to ba547cbCompareAugust 14, 2026 13:43
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