research(episodes): materialize window-separated candidate oracle - #115
Merged
Conversation
Owner
Author
|
Post-CI diff review completed at
Evidence: clean detached-tree 8/8 candidate tests, exact oracle regeneration, Draft 2020-12 validation, MSVC This PR remains draft for the required delayed report/schema review. Stacked validation gate: #116. |
Owner
Author
|
Final current-head review for
Fresh evidence on this exact head:
The delayed review's four semantic blockers and repeated membership-scan finding are closed. No review or bot comment requires action. |
stacknil
marked this pull request as ready for review
August 27, 2026 03:15
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 - consume the fail-closed v0.6 baseline contract from #117 before oracle generation - materialize a canonical candidate oracle whose full derived state must match fixture recomputation - use one event-to-candidate membership index for overlap, decision, and validation cross-references ## Why The first delayed review found four merge blockers: source-inconsistent oracle fields were accepted, unsupported rule families could borrow brute-force scoring, equivalent timestamp offsets changed finding identity, and baseline drift beyond episode count was ignored. It also found repeated membership scans that took about 32.7 seconds at the legal 990-candidate boundary. #117 owns rule/baseline/UTC identity binding. This PR stays focused on oracle materialization and exact source-derived validation, keeping its evaluator plus tests at 485 nonblank lines. ## Measured result - baseline: 1 episode - candidate: 2 episodes - included evidence: 10 dense-peak events, each consumed once - excluded evidence: 5 bridge-background events, retained as explicit decisions - deterministic finding IDs:
finding:brute_force:584fd14b544a7959andfinding:brute_force:a885dcb623777120- reversed input and equivalent timezone offsets: identical ordered oracle - legal 200-event / 990-candidate local benchmark: 0.658 seconds for build plus cross-reference validation after indexing ## How to validatetext python -m ruff check scripts/episode_baseline_contract.py scripts/episode_candidate_core.py scripts/evaluate_episode_candidate.py tests/test_episode_candidate_baseline_contract.py tests/test_episode_candidate_core.py tests/test_episode_candidate.py python -B -m unittest discover -s tests -p "test_episode_candidate*.py" -v python scripts/evaluate_episode_candidate.py --fixture tests/fixtures/episode_semantics_v0.7/continuous_background_two_peaks/fixture.json --baseline tests/fixtures/episode_semantics_v0.7/continuous_background_two_peaks/baseline.expected.json --check tests/fixtures/episode_semantics_v0.7/continuous_background_two_peaks/candidate.window-separated-v1.expected.json cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTING=ON -D LOGLENS_WARNINGS_AS_ERRORS=ON cmake --build build --config Release ctest --test-dir build --build-config Release --output-on-failureExpected: Ruff passes, 16 research tests pass, the oracle is byte-stable, and all 7 CTest entries pass. ## Design decision #117 is authoritative for fixture-to-baseline compatibility. This layer builds candidate state from that validated context, checks local evidence ownership, then requires an audited oracle to equal a complete canonical recomputation. Membership is indexed once per segment rather than repeatedly scanning all candidates. ## Main risk This proves one bounded synthetic fixture only. The remaining ADR fixture matrix and a production complexity design still block runtime adoption. ## Compatibility impact None forDetector::analyze(),loglens.report.v3, CLI output, configuration, or release behavior. The JSON remains a research-only fixture artifact. ## Rollback path Revert the oracle commits after removing this stacked layer. The baseline contract and selection core remain independently useful; no runtime state or consumer migration is involved. ## Review policyMerged after the delayed review's four semantic findings and performance finding were resolved, the exact head completed fresh checks (11/11), and final diff review found no remaining issue. #116 was subsequently retargeted to
main.