Skip to content

feat(episodes): materialize opt-in candidate v2 oracle - #126

Merged
stacknil merged 5 commits into
mainfrom
stacknil/v07-candidate-v2-materialization
Aug 29, 2026
Merged

feat(episodes): materialize opt-in candidate v2 oracle#126
stacknil merged 5 commits into
mainfrom
stacknil/v07-candidate-v2-materialization

Conversation

@stacknil

Copy link
Copy Markdown
Owner

Summary

  • add an explicit window-separated-core-contrast-v2 evaluator path while preserving the default candidate-v1 writer byte for byte
  • materialize exact minimum-span threshold-core admission evidence without hiding rejected selections
  • version the research oracle schema, add a committed v2 golden, and lock positive, negative, cross-version, and permutation-compatible behavior

Contract change

  • Affected producer: scripts/evaluate_episode_candidate.py research artifact only
  • Migration: additive and opt-in through --algorithm window-separated-core-contrast-v2
  • Backfill: none; existing v1 artifacts are not rewritten
  • Compatibility: default and explicit v1 output match both committed v1 goldens byte for byte; Detector::analyze(), CLI findings, and loglens.report.v3 are unchanged

Review decision record

  • Design decision: retain candidate-v1 selection as the evidence layer and materialize candidate-v2 admission as a separate, auditable policy projection
  • Main risk: consumers could misinterpret the fixed 2x research ratio as production calibration
  • Compatibility impact: none for v1 consumers; v2 is a new format bound to a distinct algorithm ID/version and required admission shape
  • Rollback path: remove the v2 algorithm branch, v2 schema definitions, and v2 golden; the unchanged v1 writer and artifacts require no migration

Validation

  • python -m unittest tests.test_episode_candidate_compatibility - 2 passed
  • python -m unittest discover -s tests -p 'test_episode*.py' - 43 passed
  • python -m ruff check . - passed
  • v1 continuous, v1 isolated, and v2 continuous CLI golden replay - passed
  • cmake --build build --config Debug - passed
  • ctest --test-dir build -C Debug --output-on-failure - 7/7 passed
  • gitleaks git --log-opts="origin/main..HEAD" --redact --no-banner - no leaks
  • final diff review - 9 files; no runtime, public report, or build-contract files changed

Merge gate

Draft because this is a report/schema behavior change and the diff exceeds 500 lines including the committed golden. Keep open for delayed review; after CI passes, perform another diff review before marking ready.

@stacknil

Copy link
Copy Markdown
Owner Author

Delayed diff review completed after 14.25 hours.

The review found one schema permissiveness issue: candidate-v2 is defined around a fixed 2x admission ratio, but the schema previously accepted any positive rational. Commit 519ab1a pins the contract to {numerator: 2, denominator: 1} and adds a negative compatibility test.

Post-fix evidence:

  • independent v1 byte compatibility: 2/2 passed
  • episode test suite: 43/43 passed
  • CTest: 7/7 passed
  • Ruff and git diff --check: passed
  • gitleaks: no leaks across 5 commits
  • GitHub CI, Windows/Linux, CodeQL, Repo Sentinel, and fuzz smoke: all passed
  • final diff review: no remaining findings; no src/, include/, CMake, CLI finding, or loglens.report.v3 changes

Design decision: candidate-v1 selection remains visible evidence; opt-in candidate-v2 admission is a separate policy projection.
Main risk: the fixed 2x research ratio could be mistaken for production calibration.
Compatibility impact: default and explicit v1 remain byte-for-byte stable; v2 is additive and strictly version-bound.
Rollback path: remove the v2 evaluator branch, v2 schema definitions, and v2 golden; v1 requires no migration.

@stacknil
stacknil marked this pull request as ready for review August 29, 2026 06:50
@stacknil
stacknil merged commit 84aeaf4 into main Aug 29, 2026
11 checks passed
@stacknil
stacknil deleted the stacknil/v07-candidate-v2-materialization branch August 29, 2026 06:50
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