Skip to content

Reopen pair reviews when sampling settings change - #56

Merged
EonHao merged 1 commit into
Juneo-Lab:mainfrom
sunxiuguo:fix/bind-review-sampling-settings
Nov 4, 2026
Merged

EonHao merged 1 commit into
Juneo-Lab:mainfrom
sunxiuguo:fix/bind-review-sampling-settings

Conversation

@sunxiuguo

Copy link
Copy Markdown

Behavior

Follow up on the maintainer's invitation to bind pair reviews to sampling configuration in the current review implementation.

Changing the seed or either pool setting could leave an accepted conflict/override accepted when its overlap and witnesses stayed identical. Accepting only dataset:recipe then permitted a build without renewed pair review.

Opposite-effect item content now includes sampling with the raw seed, variants_per_scenario, and candidate_pool_per_scenario values. This also covers unset pools, overridden variant counts, and exhausted populations. Other recipe fields and same-effect shadowed items retain their existing bindings.

Validation

  • Unchanged-main baseline: 324 passed, 4 optional-backend skips; 87.75% coverage.
  • New regressions on unchanged production code: 20 expected failures from unchanged pair fingerprints; 4 unrelated-recipe controls passed. The matrix covers all three settings, conflicts/overrides, observed/possible overlap, fallback, explicit pool overrides, and population exhaustion.
  • Candidate: 40 focused review tests passed; full suite 348 passed, 4 skips, 87.78% coverage.
  • Real CLI runs reproduce recipe-only acceptance and stale-fingerprint acceptance on the baseline. With the fix, both fail until current pair acceptance; build and typed/decision exports then complete. Legacy history reopens only the pair. Generated episodes and both exports match baseline bytes.
  • Ruff, format check, strict mypy, strict MkDocs, and 0.3.2 sdist/wheel builds pass on Linux/Python 3.12.14. The wheel contains the committed implementation.

Optional LangGraph, Data Designer, and RapidOCR integrations, Harbor Docker, live model/OCR services, and the upstream Linux/macOS Python 3.11/3.12/3.13 matrix were not run.

Compatibility and data

The additive sampling field causes a one-time reopening of existing conflict/override acceptances. Review current items again; accepting only the dataset recipe does not satisfy them. Item IDs, history, observed/possible classification, generation, policy evaluation, provenance, and split behavior are unchanged. Rule, node, and same-effect shadowed approvals are preserved.

All added data and reviewer identities are fictional. This implementation was assisted by Codex; no hosted inference or real customer material was used.

Independent automated review checked the reconstructed source, 20 sampling cases, 20 migration cases, four unrelated-recipe controls, and a multiple-pair case using a fail-closed FileLock import shim; it did not rerun record_review, the full suite, CLI, build, exports, or concurrency checks.

Checklist

  • Behavioral regressions fail without the fix and pass with it.
  • Ruff, formatting, mypy, pytest coverage >=80%, and strict MkDocs pass.
  • Changelog and review documentation describe the change and one-time reopening.
  • Fixtures are fictional and contain no private materials or credentials.

@sunxiuguo
sunxiuguo requested a review from EonHao as a code owner November 3, 2026 18:22
@github-actions github-actions Bot added area/compiler Ingestion, extraction, evidence binding, review gates area/docs Site, README, and reference material labels Nov 3, 2026

@EonHao EonHao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up, @sunxiuguo. This closes the gap cleanly, and I'm approving.

What I checked:

  • The production change only adds sampling to opposite-effect items. Rule, node, and same-effect shadowed items keep their fingerprints, so the one-time reopening is limited to conflict/override reviews.
  • The test matrix covers each sampling setting for conflicts and overrides, with observed and possible overlap. That includes the pool fallback and exhausted-population cases, where the witnesses stay identical but the fingerprint must still change. The unrelated-recipe controls confirm that only dataset:recipe reopens in those cases.
  • The rebuilt episodes and exports matching the original run is a nice confirmation that review binding never touches generated data.
  • The documentation and changelog describe the reopening accurately.

Two optional nits for a later cleanup, not blocking:

  1. tests/test_review.py imports CAP, MANAGER, and write_project from test_review_conflicts. That works because pytest prepends the test directory to sys.path, but moving those helpers into a shared module (or fixtures in conftest.py) would avoid depending on the import mode.
  2. In review_snapshot, the sampling field could be part of the item dict when it is built, for example **({"sampling": {...}} if opposite else {}) in content, instead of mutating items[-1] after the append.

I'll merge once CI is green.

@EonHao
EonHao merged commit aa96184 into Juneo-Lab:main Nov 4, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compiler Ingestion, extraction, evidence binding, review gates area/docs Site, README, and reference material

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants