feat: harden PR queue reconciliation against stale/conflicting state (#166)
- Add updated_at (list_prs), + merged_at/merge_commit_sha/closed_at/updated_at (view_pr) for staleness detection in tool output and inventory. - Surface updated_at in gitea_review_pr inventory report. - Strengthen gitea-pr-review skill steps, _COMMON_WORKFLOWS, _GUIDE_RULES with explicit live reconciliation checklist, 'do not trust prior handoffs', stop on conflict. - Add dedicated live queue reconciliation runbook section in docs/llm-workflow-runbooks.md. - Add passthrough tests and assertions for new fields. - All gates, redaction, author/reviewer separation untouched. - Tests pass, py_compile clean, diff clean, secret sweep clean. Closes #166
This commit is contained in:
@@ -56,7 +56,8 @@ class TestPRQueueInventory(unittest.TestCase):
|
||||
"mergeable": True,
|
||||
"user": {"login": "jcwalker3"},
|
||||
"labels": [{"name": "bug"}],
|
||||
"body": "Fixes #10"
|
||||
"body": "Fixes #10",
|
||||
"updated_at": "2026-07-05T10:00:00Z"
|
||||
},
|
||||
{
|
||||
"number": 2,
|
||||
@@ -67,7 +68,8 @@ class TestPRQueueInventory(unittest.TestCase):
|
||||
"mergeable": True,
|
||||
"user": {"login": "other_user"},
|
||||
"labels": [],
|
||||
"body": ""
|
||||
"body": "",
|
||||
"updated_at": "2026-07-05T11:00:00Z"
|
||||
}
|
||||
]
|
||||
mock_api.return_value = {"login": "jcwalker3"} # whoami
|
||||
@@ -80,6 +82,8 @@ class TestPRQueueInventory(unittest.TestCase):
|
||||
self.assertIn("Review/merge blocked (Self-author). Requires a genuine non-author reviewer", result["message"])
|
||||
self.assertIn("Review/merge blocked (Current profile is Author)", result["message"])
|
||||
self.assertIn("gitea_activate_profile", result["message"])
|
||||
# updated_at surfaced for reconciliation (#166)
|
||||
self.assertIn("Updated: 2026-07-05T10:00:00Z", result["message"])
|
||||
|
||||
@patch("mcp_server.api_get_all")
|
||||
@patch("mcp_server.api_request")
|
||||
|
||||
Reference in New Issue
Block a user