research(episodes): bind candidates to the v0.6 baseline contract - #117
Merged
Conversation
This was referenced Aug 26, 2026
Owner
Author
|
Final current-head review for
Fresh evidence on this exact head:
|
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
Why
The delayed review of #115 showed that internal oracle cross-references were not enough: a stale baseline or unsupported rule could still produce a valid-looking candidate artifact. This PR extracts the source-binding prerequisite so the larger oracle change stays reviewable and below the repository's substantive-change threshold.
How to validate
Expected: Ruff passes, 10 research tests pass, and all 7 CTest entries pass.
Design decision
Treat the committed baseline as executable evidence, not a trusted count. Candidate v1 is explicitly limited to the sanitized
brute_force/source_ip/ inclusive-window contract. The validator replays v0.6 segment and first-maximum selection semantics, then compares the declared segments, selected window, finding identity, and excluded-event partition.Main risk
The Python replay is a research conformance model, not the production detector. Its first selected finding is locked to the existing v0.6 finding ID, and unsupported rule families fail closed rather than borrowing brute-force scoring.
Compatibility impact
None for
Detector::analyze(),loglens.report.v3, the CLI, configuration, or released behavior. This adds a standard-library-only research helper and tests.Rollback path
Revert the baseline-contract commit set. No runtime state, migration, report consumer, dependency, or release artifact is involved.
Review policy
Merged after the delayed review, the noncanonical scalar-type regression, fresh current-head CI/CodeQL (11/11), and final diff review. #115 and #116 were subsequently retargeted and merged in dependency order.