fix(mcp): forward explicit org/repo through author mutation preflight (Closes #735) #737

Merged
sysadmin merged 1 commits from fix/issue-735-author-org-repo-forwarding into master 2026-07-17 22:50:29 -05:00
Owner

Closes #735

Summary

Author mutations targeting Gitea-Tools failed anti-stomp preflight because explicit org/repo coordinates were not consistently forwarded. Preflight fell back to the prgs default repository, Timesheet, and rejected the Gitea-Tools checkout with wrong_repo.

Changes

  • Forwards explicit org/repo through author mutation preflight call sites.
  • Uses workspace-derived repository coordinates for session-bound mutations when coordinates are omitted.
  • Covers create_issue, lock/mark/comment issue, create_pr, commit_files, labels, cleanup, and related author paths.
  • Leaves REMOTES["prgs"]["repo"] unchanged.
  • Preserves fail-closed behavior for missing, conflicting, substituted, or unauthorized repository coordinates.

Tests

  • 100 focused tests passed
  • 41 subtests passed
  • New coverage: tests/test_preflight_workspace_repo_forwarding.py

Bootstrap note

This PR was opened manually because the live pre-#735 server blocks native gitea_create_pr with the exact wrong_repo defect corrected here.

Closes #735 ## Summary Author mutations targeting Gitea-Tools failed anti-stomp preflight because explicit org/repo coordinates were not consistently forwarded. Preflight fell back to the prgs default repository, Timesheet, and rejected the Gitea-Tools checkout with wrong_repo. ## Changes - Forwards explicit org/repo through author mutation preflight call sites. - Uses workspace-derived repository coordinates for session-bound mutations when coordinates are omitted. - Covers create_issue, lock/mark/comment issue, create_pr, commit_files, labels, cleanup, and related author paths. - Leaves REMOTES["prgs"]["repo"] unchanged. - Preserves fail-closed behavior for missing, conflicting, substituted, or unauthorized repository coordinates. ## Tests - 100 focused tests passed - 41 subtests passed - New coverage: tests/test_preflight_workspace_repo_forwarding.py ## Bootstrap note This PR was opened manually because the live pre-#735 server blocks native gitea_create_pr with the exact wrong_repo defect corrected here.
jcwalker3 added 1 commit 2026-07-17 22:47:39 -05:00
Session-bound author mutations (create_issue, lock_issue, create_pr, etc.)
called verify_preflight_purity without org/repo, so anti-stomp filled the
remote-wide REMOTES default (prgs → Timesheet) and false-positived wrong_repo
against a Gitea-Tools checkout even when callers passed explicit coordinates.

Mirror _resolve: prefer workspace-derived identity for omitted coordinates on
session-bound tasks; keep delete_branch's explicit-target contract (#733).
Also forward org/repo at author mutation call sites. Add cross-repo regression
coverage. Do not change REMOTES["prgs"]["repo"].
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #737
issue: #735
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 87934-f00b3730fdae
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-737-issue-735
phase: claimed
candidate_head: 8d8d2d8f81
target_branch: master
target_branch_sha: 11d1d2e99f
last_activity: 2026-07-18T03:48:49Z
expires_at: 2026-07-18T05:48:49Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #737 issue: #735 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 87934-f00b3730fdae worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-737-issue-735 phase: claimed candidate_head: 8d8d2d8f814c012e47a02a64e8146a90c8896022 target_branch: master target_branch_sha: 11d1d2e99fe890c1d8ca07a7de93473c12d85255 last_activity: 2026-07-18T03:48:49Z expires_at: 2026-07-18T05:48:49Z blocker: none
sysadmin approved these changes 2026-07-17 22:50:02 -05:00
sysadmin left a comment
Owner

Canonical PR State

STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: adopt reviewer lease and merge PR 737 at pinned head with confirmation MERGE PR 737
NEXT_PROMPT:

Merge PR #737 at expected_head_sha 8d8d2d8f814c012e47a02a64e8146a90c8896022 using prgs-merger (remote=prgs org=Scaled-Tech-Consulting repo=Gitea-Tools). Do not touch PR #736. After merge restart MCP and prove native create_issue for the held pytest-runner issue.

WHAT_HAPPENED: Independent native MCP approval of PR #737 implementing #735 org/repo preflight forwarding.
WHY: Fixes wrong_repo false-positive on Gitea-Tools author mutations without changing REMOTES defaults.
ISSUE: #735
HEAD_SHA: 8d8d2d8f81
REVIEW_STATUS: approved
MERGE_READY: true
BLOCKERS: none
VALIDATION: 100 passed + 41 subtests in branches/review-pr-737-issue-735; git diff --check clean; lease 87934-f00b3730fdae
LAST_UPDATED_BY: sysadmin
NATIVE_REVIEW_PROOF: transport=native_mcp; tool=gitea_submit_pr_review; profile=prgs-reviewer; identity=sysadmin; pr=737; head=8d8d2d8f814c012e47a02a64e8146a90c8896022; action=approve

CTH: Reviewer Handoff

## Canonical PR State STATE: approved WHO_IS_NEXT: merger NEXT_ACTION: adopt reviewer lease and merge PR 737 at pinned head with confirmation MERGE PR 737 NEXT_PROMPT: ```text Merge PR #737 at expected_head_sha 8d8d2d8f814c012e47a02a64e8146a90c8896022 using prgs-merger (remote=prgs org=Scaled-Tech-Consulting repo=Gitea-Tools). Do not touch PR #736. After merge restart MCP and prove native create_issue for the held pytest-runner issue. ``` WHAT_HAPPENED: Independent native MCP approval of PR #737 implementing #735 org/repo preflight forwarding. WHY: Fixes wrong_repo false-positive on Gitea-Tools author mutations without changing REMOTES defaults. ISSUE: #735 HEAD_SHA: 8d8d2d8f814c012e47a02a64e8146a90c8896022 REVIEW_STATUS: approved MERGE_READY: true BLOCKERS: none VALIDATION: 100 passed + 41 subtests in branches/review-pr-737-issue-735; git diff --check clean; lease 87934-f00b3730fdae LAST_UPDATED_BY: sysadmin NATIVE_REVIEW_PROOF: transport=native_mcp; tool=gitea_submit_pr_review; profile=prgs-reviewer; identity=sysadmin; pr=737; head=8d8d2d8f814c012e47a02a64e8146a90c8896022; action=approve CTH: Reviewer Handoff
Owner

adopted_at: 2026-07-18T03:50:19Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 87934-f00b3730fdae
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 12247
adoption_reason: merger-handoff-approved-head

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #737
issue: #735
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 87927-89ba096da2c5
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-737-issue-735
phase: adopted
candidate_head: 8d8d2d8f81
target_branch: master
target_branch_sha: 11d1d2e99f
last_activity: 2026-07-18T03:50:19Z
expires_at: 2026-07-18T05:50:19Z
blocker: none

<!-- mcp-review-lease-adoption:v1 --> adopted_at: 2026-07-18T03:50:19Z adopted_by_identity: sysadmin adopted_by_profile: prgs-merger adopted_from_session_id: 87934-f00b3730fdae adopted_from_profile: prgs-reviewer adopted_from_reviewer_identity: sysadmin adopted_from_comment_id: 12247 adoption_reason: merger-handoff-approved-head <!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #737 issue: #735 reviewer_identity: sysadmin profile: prgs-merger session_id: 87927-89ba096da2c5 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-737-issue-735 phase: adopted candidate_head: 8d8d2d8f814c012e47a02a64e8146a90c8896022 target_branch: master target_branch_sha: 11d1d2e99fe890c1d8ca07a7de93473c12d85255 last_activity: 2026-07-18T03:50:19Z expires_at: 2026-07-18T05:50:19Z blocker: none
sysadmin merged commit 29d96c8946 into master 2026-07-17 22:50:29 -05:00
Owner

Stale #332 review-decision lock cleanup (#594)

Status: APPLIED

Manual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.

## Stale #332 review-decision lock cleanup (#594) Status: **APPLIED** - actor: `sysadmin` - profile: `prgs-merger` - timestamp: `2026-07-18T03:50:31.207894+00:00` - last terminal: `approve` on PR #737 - PR state: `closed` (merged=True) - merge_commit_sha: `29d96c8946689be2fc9a55d296e4383a3aa03c4f` - prior live_mutations_count: `1` - prior profile_identity: `prgs-reviewer` Manual deletion of session-state files is **not** the workflow. This path only clears a lock when the referenced PR is merged/closed.
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#737