Skip to content

feat(research): evaluate minimum-span threshold cores - #125

Merged
stacknil merged 3 commits into
mainfrom
stacknil/v07-threshold-core-control
Aug 28, 2026
Merged

feat(research): evaluate minimum-span threshold cores#125
stacknil merged 3 commits into
mainfrom
stacknil/v07-threshold-core-control

Conversation

@stacknil

Copy link
Copy Markdown
Owner

Summary

  • derive a deterministic minimum-span, threshold-sized evidence core inside each selected research window
  • gate the abstraction on padding monotonicity, the existing 18x positive, and the 1x uniform negative
  • record the bounded decision, mutation proof, nonclaims, and stopping rule in ADR 0001

Why

Raw mean-gap contrast over maximal selected windows is coupled to coverage padding. This slice tests the smallest alternative evidence abstraction without changing candidate-v1 selection or production behavior.

Design decision

Use the shortest contiguous sequence of exactly threshold events inside each selected maximal window as candidate-v2 density evidence. Equal-span cores use the chronological key. Events excluded from a core still count toward bridge density.

This is accepted only for the three bounded controls. It is not wired into the candidate evaluator, detector, CLI, report, or schema.

How to validate

python -m unittest tests.test_episode_candidate_core
python -m unittest discover -s tests -p 'test_episode*.py'
python -m ruff check scripts tests
cmake --build build --config Debug --target ALL_BUILD -- /m:4 /nr:false /v:q /nologo
ctest --test-dir build -C Debug --output-on-failure
git diff --check origin/main...HEAD
gitleaks git --no-banner --redact --log-opts="origin/main..HEAD"

Expected evidence:

  • padding control: both dense cores remain 120 seconds and pass at 19/2x after padding
  • positive control: continuous-background fixture remains 18x
  • negative control: uniform background remains 1x and is rejected
  • mutation control: replacing minimum-span selection with maximum-span selection fails the padding test
  • 13/13 focused tests, 35/35 episode tests, and 7/7 CTest targets pass locally

Main risk

The abstraction may overfit the three synthetic controls, and the existing 2x contrast remains uncalibrated. Minimum-span evidence may also ignore operationally relevant events that remain part of maximal candidate coverage.

Compatibility impact

None for supported behavior. Detector::analyze(), CLI output, loglens.report.v3, candidate-v1 selection, fixture schema, and evaluator materialization are unchanged. The new functions remain in the bounded research helper.

Rollback path

Revert the three semantic commits in reverse order:

  1. docs(episodes): accept threshold core evidence
  2. test(research): gate threshold core contrast
  3. feat(research): derive threshold-sized cores

Stopping rule and nonclaims

The planned padding, 18x positive, and 1x negative controls all distinguish correctly, so this slice stops without a quantile, trimmed-gap, cadence, position, or ratio sweep. It does not calibrate production thresholds, estimate false-positive rates, or authorize candidate-v2 materialization.

@stacknil

Copy link
Copy Markdown
Owner Author

Final diff review after CI:

  • Design decision: derive density evidence from the shortest contiguous threshold-sized core inside each selected maximal window; retain all excluded events in bridge counting and use chronological tie-breaking.
  • Main risk: the abstraction is supported only by three synthetic controls, while the 2x ratio remains uncalibrated and minimum-span cores may omit operationally relevant evidence from density measurement.
  • Compatibility impact: none for Detector::analyze(), CLI, loglens.report.v3, candidate-v1 selection, evaluator output, or oracle schemas; this remains a bounded research helper.
  • Rollback path: revert abb37d6, 62ae952, and 9291e34 in reverse semantic order.

Post-CI evidence: 11/11 GitHub checks passed; final diff is 3 files with behavior/test/docs commit separation; no review or bot comments are outstanding; origin/main remains f780843. The planned stopping rule is met without a parameter sweep.

@stacknil
stacknil merged commit e26a6c0 into main Aug 28, 2026
11 checks passed
@stacknil
stacknil deleted the stacknil/v07-threshold-core-control branch August 28, 2026 15:38
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