Add preview_correction_impact workflow proposal with explicit rule-based rationale#156
Closed
Add preview_correction_impact workflow proposal with explicit rule-based rationale#156
Conversation
Collaborator
Author
|
Consolidated into draft PR #165 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
server_api/workflow/correction_preview.pywhich definesPREVIEW_CORRECTION_IMPACT_PROPOSAL_TYPE, explicit event type sets (RECENT_CORRECTION_EVENT_TYPES,RECENT_EXPORT_EVENT_TYPES) and the constantCORRECTION_RATE_PROCEED_THRESHOLD, plusbuild_preview_correction_impact_proposal(events)that returns a payload containing summary, recommendation, and a rule-based rationale.summary(total events, correction-related events, recent exports, correction_rate),recommendation(proceedorcontinue_proofreading), andrationalewithrule,threshold,computedvalues, and a human-readableexplanationshowing the computation.server_api/workflow/__init__.pyfor package-level imports.tests/test_workflow_correction_preview.pywith two scenarios validating low-correction ->proceedand high-correction ->continue_proofreading, and asserting no mutation of the input events list.Testing
python -m pytest -q tests/test_workflow_correction_preview.pyand observed2 passed(both tests succeeded).uv run pytest -q tests/test_workflow_correction_preview.pybut it failed in this environment due to an unrelated editable dependency packaging issue forpytorch-connectomics(package metadata generation error).eventslist is not mutated.Codex Task