Skip to content

Add preview_correction_impact workflow proposal with explicit rule-based rationale#156

Closed
akgohain wants to merge 1 commit intomainfrom
codex/add-correction-impact-proposal-action-p2m14u
Closed

Add preview_correction_impact workflow proposal with explicit rule-based rationale#156
akgohain wants to merge 1 commit intomainfrom
codex/add-correction-impact-proposal-action-p2m14u

Conversation

@akgohain
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a deterministic, auditable pre-retraining signal that summarizes recent correction activity and export events to guide readiness decisions.
  • Make the recommendation logic transparent and rule-based with an explicit, discoverable threshold constant.
  • Ensure the helper is pure (no direct state mutation) so it can be used safely for previews and automated checks.

Description

  • Added server_api/workflow/correction_preview.py which defines PREVIEW_CORRECTION_IMPACT_PROPOSAL_TYPE, explicit event type sets (RECENT_CORRECTION_EVENT_TYPES, RECENT_EXPORT_EVENT_TYPES) and the constant CORRECTION_RATE_PROCEED_THRESHOLD, plus build_preview_correction_impact_proposal(events) that returns a payload containing summary, recommendation, and a rule-based rationale.
  • The proposal payload includes summary (total events, correction-related events, recent exports, correction_rate), recommendation (proceed or continue_proofreading), and rationale with rule, threshold, computed values, and a human-readable explanation showing the computation.
  • Exposed the helper via server_api/workflow/__init__.py for package-level imports.
  • Added tests/test_workflow_correction_preview.py with two scenarios validating low-correction -> proceed and high-correction -> continue_proofreading, and asserting no mutation of the input events list.

Testing

  • Ran python -m pytest -q tests/test_workflow_correction_preview.py and observed 2 passed (both tests succeeded).
  • Attempted the requested uv run pytest -q tests/test_workflow_correction_preview.py but it failed in this environment due to an unrelated editable dependency packaging issue for pytorch-connectomics (package metadata generation error).
  • Tests validate summary fields, recommendation, rationale structure, threshold inclusion, and that the input events list is not mutated.

Codex Task

@akgohain
Copy link
Copy Markdown
Collaborator Author

Consolidated into draft PR #165 (feat/codex-wave-integration). Closing this source draft to keep review in one place.

@akgohain akgohain closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant