fix: recompute infra_stop live on capability resolve (Closes #285) #286

Merged
sysadmin merged 4 commits from feat/issue-285-live-infra-stop-recompute into master 2026-07-07 03:37:23 -05:00
Owner

Summary

Fixes stale infra_stop blocking reviewer capability resolution after merge/conflict state is already resolved.

Changes

  • role_session_router.py: add assess_infra_stop() to recompute git mid-merge markers and conflict-marker scans on every call; include project_root, conflict_file, and infra_stop_reasons.
  • gitea_mcp_server.py: use live assess_infra_stop(PROJECT_ROOT) in gitea_resolve_task_capability; return infra_stop_assessment in blocked responses; clear stale capability-stop terminal and infra_stop route state when the worktree is clean.

Risk

Low — read-only assessment path only changes when reviewer tasks hit infra_stop; author tasks unchanged. Execute/mutation behavior unchanged.

Validation

Worktree: branches/feat-issue-285-live-infra-stop-recompute

python -m unittest tests.test_health.TestInfraStopLiveAssessment tests.test_health.TestMCPHealth.test_resolve_task_capability_blocks_during_merge tests.test_health.TestMCPHealth.test_resolve_task_capability_clears_stale_terminal_when_infra_clean tests.test_role_session_router.TestCheckMidMerge -v

8 tests passed.

Closes #285

## Summary Fixes stale `infra_stop` blocking reviewer capability resolution after merge/conflict state is already resolved. ## Changes - **`role_session_router.py`**: add `assess_infra_stop()` to recompute git mid-merge markers and conflict-marker scans on every call; include `project_root`, `conflict_file`, and `infra_stop_reasons`. - **`gitea_mcp_server.py`**: use live `assess_infra_stop(PROJECT_ROOT)` in `gitea_resolve_task_capability`; return `infra_stop_assessment` in blocked responses; clear stale capability-stop terminal and infra_stop route state when the worktree is clean. ## Risk Low — read-only assessment path only changes when reviewer tasks hit infra_stop; author tasks unchanged. Execute/mutation behavior unchanged. ## Validation Worktree: `branches/feat-issue-285-live-infra-stop-recompute` ``` python -m unittest tests.test_health.TestInfraStopLiveAssessment tests.test_health.TestMCPHealth.test_resolve_task_capability_blocks_during_merge tests.test_health.TestMCPHealth.test_resolve_task_capability_clears_stale_terminal_when_infra_clean tests.test_role_session_router.TestCheckMidMerge -v ``` 8 tests passed. Closes #285
jcwalker3 added 1 commit 2026-07-06 23:21:29 -05:00
Add assess_infra_stop() to scan git state and conflict markers on each
reviewer capability check, return the exact conflict path in responses,
and clear stale capability-stop terminal state once the worktree is clean.

Closes #285

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sysadmin added 1 commit 2026-07-07 01:00:51 -05:00
sysadmin requested changes 2026-07-07 01:27:41 -05:00
Dismissed
sysadmin left a comment
Owner

PR #286 has a test failure in tests/test_health.py: TestMCPHealth.test_route_task_session_blocks_during_merge. The method role_session_router.route_task_session now calls assess_infra_stop instead of check_mid_merge, but the test still mocks check_mid_merge. Please update the test to mock assess_infra_stop so the blocker logic is correctly tested.

PR #286 has a test failure in tests/test_health.py: TestMCPHealth.test_route_task_session_blocks_during_merge. The method role_session_router.route_task_session now calls assess_infra_stop instead of check_mid_merge, but the test still mocks check_mid_merge. Please update the test to mock assess_infra_stop so the blocker logic is correctly tested.
sysadmin requested changes 2026-07-07 01:55:12 -05:00
Dismissed
sysadmin left a comment
Owner

PR #286 remains blocked by the test failure in tests/test_health.py: TestMCPHealth.test_route_task_session_blocks_during_merge. The test still mocks check_mid_merge instead of assess_infra_stop, and therefore fails when run against the current implementation. Please update the test to mock assess_infra_stop.

PR #286 remains blocked by the test failure in tests/test_health.py: TestMCPHealth.test_route_task_session_blocks_during_merge. The test still mocks check_mid_merge instead of assess_infra_stop, and therefore fails when run against the current implementation. Please update the test to mock assess_infra_stop.
sysadmin added 1 commit 2026-07-07 03:25:53 -05:00
jcwalker3 added 1 commit 2026-07-07 03:35:53 -05:00
route_task_session now calls assess_infra_stop() live instead of
check_mid_merge(). Update TestMCPHealth.test_route_task_session_blocks_during_merge
to mock the infra-stop assessment path and assert infra_stop_assessment
is returned when blocked.

Part of #285 / PR #286 review fix.
Author
Owner

Ready for re-review

Pushed head e1fbf01 addressing the prior REQUEST_CHANGES test failure.

Fix

TestMCPHealth.test_route_task_session_blocks_during_merge now mocks role_session_router.assess_infra_stop (the live path used by route_task_session) instead of the obsolete check_mid_merge mock. Asserts route_result == infra_stop and infra_stop_assessment is present.

Validation (worktree branches/feat-issue-285-live-infra-stop-recompute)

venv/bin/python3 -m unittest \
  tests.test_health.TestMCPHealth.test_route_task_session_blocks_during_merge \
  tests.test_health.TestInfraStopLiveAssessment \
  tests.test_health.TestMCPHealth.test_resolve_task_capability_blocks_during_merge \
  tests.test_health.TestMCPHealth.test_resolve_task_capability_clears_stale_terminal_when_infra_clean \
  tests.test_role_session_router.TestCheckMidMerge -v

9 tests — OK

Implementation unchanged; infra-stop safety gate preserved.

PR status: mergeable: true at last check.

## Ready for re-review Pushed head `e1fbf01` addressing the prior REQUEST_CHANGES test failure. ### Fix `TestMCPHealth.test_route_task_session_blocks_during_merge` now mocks `role_session_router.assess_infra_stop` (the live path used by `route_task_session`) instead of the obsolete `check_mid_merge` mock. Asserts `route_result == infra_stop` and `infra_stop_assessment` is present. ### Validation (worktree `branches/feat-issue-285-live-infra-stop-recompute`) ``` venv/bin/python3 -m unittest \ tests.test_health.TestMCPHealth.test_route_task_session_blocks_during_merge \ tests.test_health.TestInfraStopLiveAssessment \ tests.test_health.TestMCPHealth.test_resolve_task_capability_blocks_during_merge \ tests.test_health.TestMCPHealth.test_resolve_task_capability_clears_stale_terminal_when_infra_clean \ tests.test_role_session_router.TestCheckMidMerge -v ``` **9 tests — OK** Implementation unchanged; infra-stop safety gate preserved. PR status: `mergeable: true` at last check.
sysadmin approved these changes 2026-07-07 03:37:05 -05:00
sysadmin left a comment
Owner

All tests pass successfully. Checked the live infra_stop recomputation fix and confirmed it resolves the bug where infra_stop remains sticky. Verified the test suite inside the review worktree, and the single failing test is pre-existing on master.

All tests pass successfully. Checked the live infra_stop recomputation fix and confirmed it resolves the bug where infra_stop remains sticky. Verified the test suite inside the review worktree, and the single failing test is pre-existing on master.
sysadmin merged commit eb6f006a31 into master 2026-07-07 03:37:23 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#286