Skip to content

[MC-465] Guard manual cognate partitions#658

Merged
TrueNorth49 merged 1 commit into
mainfrom
fix/cognate-partition-guard
Jun 15, 2026
Merged

[MC-465] Guard manual cognate partitions#658
TrueNorth49 merged 1 commit into
mainfrom
fix/cognate-partition-guard

Conversation

@TarahAssistant

Copy link
Copy Markdown
Collaborator

MC Task: MC-465 — Cognate-partition integrity guard / Lane MC-465-A

Summary

  • Adds find_cognate_partition_violations() for reusable manual cognate partition validation.
  • Rejects /api/enrichments writes after the final deep merge when any speaker appears in multiple manual cognate groups for the same concept.
  • Guards the cognate recompute write path so an existing malformed manual_overrides.cognate_sets cannot be re-persisted during auto recompute.

Validation

  • RED first: PYTHONPATH=python python3 -m pytest python/test_compare_enrichments_manual_overrides.py::test_post_enrichments_rejects_duplicate_manual_cognate_membership_after_merge -q initially failed with DID NOT RAISE <class 'server.ApiError'>.
  • Reject-case GREEN: PYTHONPATH=python python3 -m pytest python/test_compare_enrichments_manual_overrides.py::test_post_enrichments_rejects_duplicate_manual_cognate_membership_after_merge -q -> 1 passed, 1 warning in 0.06s.
  • Focused suite: PYTHONPATH=python python3 -m pytest python/test_compare_enrichments_manual_overrides.py -q -> 10 passed, 1 warning in 0.10s.
  • Handoff backend selector: PYTHONPATH=python python3 -m pytest python/ -q -k 'not test_ortho_section_defaults_cascade_guard and not test_ortho_explicit_override_beats_defaults' -> 1927 passed, 6 skipped, 2 deselected, 1 warning, 3 subtests passed in 37.14s.
  • Full backend sweep: PYTHONPATH=python python3 -m pytest python/ -q -> 1929 passed, 6 skipped, 1 warning, 3 subtests passed in 29.39s.
  • Ruff: uvx ruff check python/ --select E9,F63,F7,F82 -> All checks passed!.
  • git diff --check -> clean.

Notes

  • No live workspace, browser, parse-run, or npm/dev-server checks were run per handoff ban.

@TarahAssistant TarahAssistant added safeguard Safety guardrail MC-465 Mission Control MC-465 labels Jun 15, 2026
@TrueNorth49 TrueNorth49 merged commit 5213766 into main Jun 15, 2026
4 checks passed
@TrueNorth49 TrueNorth49 deleted the fix/cognate-partition-guard branch June 15, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MC-465 Mission Control MC-465 safeguard Safety guardrail

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants