Skip to content

research(episodes): add bounded window-separated candidate core - #114

Merged
stacknil merged 3 commits into
mainfrom
stacknil/v07-window-separated-candidate
Aug 25, 2026
Merged

research(episodes): add bounded window-separated candidate core#114
stacknil merged 3 commits into
mainfrom
stacknil/v07-window-separated-candidate

Conversation

@stacknil

Copy link
Copy Markdown
Owner

Summary

  • add a bounded, deterministic core that enumerates inclusive threshold windows and selects a window-separated evidence set
  • lock threshold, cooldown, maximal-window, permutation, and hard-limit behavior with Python unit tests registered in CTest
  • document the candidate objective and keep the oracle/materialization layer as a separate follow-up

Why

The committed v0.7 fixture proves that adjacent-gap segmentation can keep two dense peaks in one activity segment. This PR isolates the candidate selection policy before any oracle or runtime integration, keeping the first review slice independently verifiable.

How to validate

py -3 -B tests\test_episode_candidate_core.py
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-failure

Expected: 4 Python tests and 7 CTest entries pass.

Design decision

Use exhaustive contiguous-window enumeration plus deterministic weighted interval selection only as a bounded research core. Compatibility requires a gap strictly greater than one rule window; ties resolve by covered events, compactness, episode count, then chronological key.

Main risk

Worst-case candidate materialization and predecessor scanning are super-quadratic. The core therefore fails closed above 200 fixture events or 1,000 candidates per segment and is not production-ready.

Compatibility impact

None for Detector::analyze(), loglens.report.v3, CLI output, configuration, or release behavior. Python is used only for research tests; C++ consumers without Python continue to build with that optional test skipped.

Rollback path

Revert the three commits in this PR. No migration, schema transition, or generated artifact cleanup is required.

Follow-up

A separate PR will bind this core to the committed baseline, materialize the candidate oracle, validate cross-references and JSON Schema, and record the measured fixture outcome.

@stacknil

Copy link
Copy Markdown
Owner Author

Post-CI diff review completed at 689fb6607fd604b3e90015fd6efe8865a54ae9d4.

  • Design decision: keep exhaustive window enumeration plus deterministic weighted interval selection in a bounded research-only core; materialization remains a separate PR.
  • Main risk: worst-case cost is super-quadratic. The fail-closed 200-event / 1,000-candidate limits remain visible in code, tests, and ADR.
  • Compatibility impact: no detector, report schema, CLI, configuration, or release behavior changes.
  • Rollback path: revert the three semantic commits; there is no migration or generated state.

Final evidence: clean detached-tree MSVC /WX build and 7/7 CTest, 4/4 focused core tests, 296-case exhaustive-subset cross-check against the DP, git diff --check, and Gitleaks with no findings. All GitHub checks are successful; no review or bot comment requires action.

@stacknil
stacknil merged commit d11e3bc into main Aug 25, 2026
11 checks passed
@stacknil
stacknil deleted the stacknil/v07-window-separated-candidate branch August 25, 2026 03:09
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.

1 participant