Skip to content

Review allow/deny overlaps in generated dimension states - #44

Closed
sunxiuguo wants to merge 1 commit into
Juneo-Lab:mainfrom
sunxiuguo:fix/review-dimension-overlaps
Closed

sunxiuguo wants to merge 1 commit into
Juneo-Lab:mainfrom
sunxiuguo:fix/review-dimension-overlaps

Conversation

@sunxiuguo

Copy link
Copy Markdown

Behavior

Closes #36. Review previously checked opposite-effect rules only against scenario seeds, so an allow/deny overlap introduced by a dimension could reach training data without its own review item.

Review now searches the deterministic pool emitted by generate_family, including candidate attribute dimensions. Each scenario is generated at most once per snapshot for all opposite-effect pairs, and its verdicts retain outranked matching rules. Existing seed witnesses remain available; each pair gains at most one generated witness with its episode ID and dimension interventions.

Conflict/override fingerprints also bind the sampling seed and both pool-size settings. Changing the sample reopens review even when the first witness stays the same.

Validation

  • Four dimension-only regressions (state/nested candidate attributes, equal/unequal priority) fail on unchanged main and pass with the fix. Tests also cover retained seed witnesses, same-candidate matching, newly sampled overlaps, stale approvals, one generation per scenario across rule pairs, and generation population limits.
  • Review tests: 21 passed. Full suite on Linux/Python 3.12.14: 289 passed, 4 skipped; 84.99% statement coverage. Optional LangGraph, Data Designer, and RapidOCR tests skipped because those extras are not installed.
  • Ruff, Ruff format check, mypy src, strict MkDocs, and sdist/wheel builds pass.
  • A core-only wheel installation passes version/example validation. The fictional example builds 336 accepted episodes and exports both typed and decision datasets.
  • Serialized generated episodes match unchanged main exactly for both synthetic reproduction fixtures.

Checks ran in an isolated cloud environment on candidate 594e3f7b5c2ab90ea95f2434d5a42e8c6129d1d8, based on 1e756c9927e42933c6107953e67fc88b67261edd. Published commit 402dfc9beaab75eed153f7e87fd1150a2a08ff7e has the exact same verified Git tree (6bfc74a7120f4d01732973ac68f8e58765a71a98). Subsequent upstream changes at 3add88804acf792e0645a34135a1bc5cc36ce9d2 affect only the two README files. The macOS/Python-version CI matrix, Harbor Docker runs, optional runtime integrations, and live inference were not run.

Compatibility and data

Policy evaluation, episode/export contracts, item IDs, provenance, and split assignment are unchanged. Review content adds generated_witnesses and generation for opposite-effect pairs; existing conflict/override decisions need renewed acceptance. Other review-item bindings remain unchanged. The documentation describes this transition and the existing 10,000-sample/10^12-population limits.

The analysis covers deterministic generated episodes before filtering; it does not claim to enumerate arbitrary states or model-written synthesis. This implementation was assisted by Codex. All added fixtures are fictional; no credentials, customer materials, hosted model calls, or production systems were used.

Checklist

  • A behavioral test fails without this change and passes with it.
  • Ruff, format, mypy, pytest coverage >=80%, and strict MkDocs pass.
  • Changelog and review documentation describe the user-visible change.
  • Examples remain fictional and contain no private material or credentials.

Reuse the bounded deterministic generation pool and bind conflict reviews to sampling settings. Add synthetic regressions and document renewed acceptance.

Implementation assisted by Codex.
@sunxiuguo
sunxiuguo requested a review from EonHao as a code owner November 1, 2026 09:04
@github-actions github-actions Bot added area/compiler Ingestion, extraction, evidence binding, review gates area/docs Site, README, and reference material labels Nov 1, 2026
@EonHao EonHao mentioned this pull request Nov 3, 2026
@EonHao

EonHao commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for this careful fix, @sunxiuguo, and for the dimension-only regressions that fail on the old code. That is exactly the evidence a fix like this needs.

I'm sorry for the overlap. We missed that this PR was already open and merged #48 for the same issue (#36) shortly afterwards. #48 takes a similar route: the review gate searches the situations generate_family samples (now shared through family_variants). It also adds a conservative conditions_disjoint check, so an allow/deny pair that no generated state exercises yet is still queued as a "possible" overlap, since synthesis can reach new states. Because both PRs change the same code, this one now conflicts with main, so I'm closing it as superseded. You are credited in CHANGELOG.md for the report and fix.

One idea here is not in main: binding the sampling seed and both pool-size settings into the conflict item fingerprint, so a different sample reopens the conflict review itself. Today a seed change reopens the dataset:recipe item, but not the conflict items. If you'd like to send that as a small follow-up against main, building on review.py's overlap/witnesses content, I'd be glad to review it.

Thanks again for contributing.

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.

Review gate misses allow/deny overrides that only occur at dimension values

2 participants