Skip to content

Add prioritize_failure_hotspots workflow proposal action#157

Closed
akgohain wants to merge 1 commit into
mainfrom
codex/add-workflow-agent-proposal-for-hotspots
Closed

Add prioritize_failure_hotspots workflow proposal action#157
akgohain wants to merge 1 commit into
mainfrom
codex/add-workflow-agent-proposal-for-hotspots

Conversation

@akgohain
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a read-only, approval-gated workflow-agent proposal that surfaces proofreading/inference failure hotspots so reviewers can prioritize manual inspection and rework.
  • Use simple, explainable heuristics over recent event history (no ML or state mutation) to keep recommendations transparent and safe.

Description

  • Add server_api/workflow/proposals.py which implements PRIORITIZE_FAILURE_HOTSPOTS and propose_failure_hotspots(events, *, top_k=3) using heuristic scoring of failure-linked proofreading/inference events.
  • Heuristics normalize event types, derive candidate keys from common ID fields or locations, and compute a weighted score from signals like fail/error/reject/undo, severity, requires_rework, and whether the event touched proofreading or inference flows.
  • Return a proposal payload with proposal_type, requires_approval=True, mutates_state=False, action: "review_ranked_hotspots", and an explanation containing ranked candidates and human-readable reason strings.
  • Export the API via server_api/workflow/__init__.py and add focused unit tests at tests/test_workflow_hotspot_proposal.py covering ranking, fallback behavior, and approval/mutation flags.

Testing

  • Ran unit tests with PYTHONPATH=. pytest -q tests/test_workflow_hotspot_proposal.py which passed: 3 passed.
  • Attempted uv run pytest -q tests/test_workflow_hotspot_proposal.py which fails in this environment due to editable package metadata for pytorch_connectomics (missing pyproject.toml/setup.py) and is unrelated to the new logic.
  • Tests assert the proposal is approval-gated and non-mutating, returns ranked candidates with reasons, and provides a fallback recommendation when events are insufficient.

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