feat(profiles): support reconciler cleanup capability and migration (Closes #687) #688
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
More information is needed
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#688
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Support gitea.branch.delete capability in reconciler profile and migration helper.
Closes #687.
Changes
reconciler_profile.py: addgitea.branch.deleteto recommended operations.migrate_profiles.py: add support for thereconcilerrole defaults and schema mapping.tests/test_migrate_profiles.py: added unit tests validating reconciler migration.Validation
c7a444eb4b41cf916fdbd20a4999ffd78af496d0.Canonical Issue State
STATE: ready-for-review
WHO_IS_NEXT: reviewer
NEXT_ACTION: A distinct reviewer must validate least privilege and the guarded cleanup path.
NEXT_PROMPT:
WHY: The configuration PR needs to be reviewed and approved by a distinct reviewer.
BLOCKERS: none
VALIDATION: 2621 passed, 6 skipped on commit
c7a444e.RELATED_PRS: #688
LAST_UPDATED_BY: author
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60615-d92824cff1bd
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-687-reconciler-branch-delete
phase: claimed
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha:
56f1230a10last_activity: 2026-07-13T01:38:25Z
expires_at: 2026-07-13T03:38:25Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60615-d92824cff1bd
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-687-reconciler-branch-delete
phase: before-validation
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha:
56f1230a10last_activity: 2026-07-13T01:38:54Z
expires_at: 2026-07-13T03:38:54Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60615-d92824cff1bd
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-687-reconciler-branch-delete
phase: after-validation-request-changes
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha:
56f1230a10last_activity: 2026-07-13T01:43:14Z
expires_at: 2026-07-13T03:43:14Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60615-d92824cff1bd
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-687-reconciler-branch-delete
phase: before-review-mutation-request-changes
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha:
56f1230a10last_activity: 2026-07-13T01:43:48Z
expires_at: 2026-07-13T03:43:48Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60615-d92824cff1bd
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-687-reconciler-branch-delete
phase: released
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha:
56f1230a10last_activity: 2026-07-13T02:22:52Z
expires_at: 2026-07-13T04:22:52Z
blocker: manual-release
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 25883-7d4c6e6ebd53
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr688-feat-issue-687-reconciler-branch-delete
phase: claimed
candidate_head:
c7a444eb4btarget_branch: master
target_branch_sha: none
last_activity: 2026-07-13T02:23:00Z
expires_at: 2026-07-13T04:23:00Z
blocker: none
Canonical PR State
STATE: request-changes
WHO_IS_NEXT: author
NEXT_ACTION: Author must correct the migrated reconciler defaults shorthand operations and limit delete scope.
NEXT_PROMPT:
WHAT_HAPPENED: PR review completed with REQUEST_CHANGES due to three findings:
WHY: Migrated reconciler defaults use invalid operations and lose required permissions. Branch delete capability exposes raw deletion.
ISSUE: 687
HEAD_SHA:
c7a444eb4bREVIEW_STATUS: request_changes
MERGE_READY: false
BLOCKERS: unresolved findings in validation report
VALIDATION: 57 tests passed in review worktree on head
c7a444e.LAST_UPDATED_BY: reviewer
Canonical Issue State
STATE:
ready-for-review — REQUEST_CHANGES addressed at new head; independent re-review required
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Independent REVIEWER (must differ from author jcwalker3 / prgs-author) re-validates all three prior blockers at pinned head
4a6357800364718a27a36ebc73578d4b929ff4aa; do not self-review or mergeNEXT_PROMPT:
WHAT_HAPPENED:
AUTHOR addressed formal REQUEST_CHANGES (reviewed head
c7a444e) on existing branch feat/issue-687-reconciler-branch-delete without opening a replacement PR.New head SHA:
4a6357800364718a27a36ebc73578d4b929ff4aaExact fix per blocker
Blocker 1 — valid canonical reconciler operations
migrate_profiles.RECONCILER_DEFAULT_ALLOWED/FORBIDDENnow fully qualified (gitea.pr.close,gitea.issue.close, …) — nopr.close/issue.close/ barepr.comment.canonicalize_operation/canonicalize_operationsmap loader aliases + migration-only shorthands; unknown ops fail visibly.gitea.read+gitea.pr.close(fail closed if missing).Canonical migrated reconciler example:
Blocker 2 — prevent arbitrary branch deletion
gitea_delete_branch: reconciler denied even withgitea.branch.delete; non-author roles denied; preservation/protected branches fail closed before any API call.gitea_cleanup_merged_pr_branch: requires reconciler role only;branch_cleanup_guardrejects preservation/evidence branches (incl.chore/issue-681-preserve-review-session-wip); unmerged/open/protected still refused.cleanup_merged_pr_branch/reconciliation_cleanupadded to role-exclusive tasks in the resolver.Blocker 3 — operational procedure docs
docs/gitea-execution-profiles.mdrunbook: exactpython3 migrate_profiles.py -i …dry-run/-w/--backup; inspect identity; validate canonical names + least privilege; merge of #688 does not change live profile; apply path; backup; client reconnect; whoami/parity/capability re-verify; guarded cleanup usage; prohibitions on raw git delete / arbitrary delete / ad hoc edits.Profile-switch provenance (not absorbed)
Canonical #688 comments do not prove full reviewer re-preflight after any mid-run author activation. Filed separate #690 (workflow-hardening). Not part of #687 product scope.
Validation (from final immutable head
4a63578)compileallon changed modules: OKRemaining risks
prgs-reconcilerstill lacksgitea.branch.deleteuntil operator runs documented migrate/apply + reconnect (by design).WHY:
Prior migration defaults used invalid shorthand that the production normalizer drops, so reconciler lost
gitea.pr.close. Grantinggitea.branch.deletewithout role gating would have made raw delete reachable for reconciler.RELATED_PRS:
#688 (this); #684 source branch untouched; #690 separate workflow guardrail
BLOCKERS:
none for independent re-review
VALIDATION:
4a6357800364718a27a36ebc73578d4b929ff4aapushed tofeat/issue-687-reconciler-branch-deleteLAST_UPDATED_BY:
jcwalker3 / prgs-author / AUTHOR / 2026-07-12
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 61399-0f17eb0269e7
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr688-4a63578
phase: claimed
candidate_head:
4a63578003target_branch: master
target_branch_sha:
1ab384adc9last_activity: 2026-07-16T04:41:47Z
expires_at: 2026-07-16T06:41:47Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 61399-0f17eb0269e7
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr688-4a63578
phase: decision
candidate_head:
4a63578003target_branch: master
target_branch_sha:
1ab384adc9last_activity: 2026-07-16T04:43:03Z
expires_at: 2026-07-16T06:43:03Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 61399-0f17eb0269e7
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr688-4a63578
phase: released
candidate_head:
4a63578003target_branch: master
target_branch_sha:
1ab384adc9last_activity: 2026-07-16T04:43:43Z
expires_at: 2026-07-16T06:43:43Z
blocker: manual-release
Canonical Issue State
STATE:
ready-for-review — two independent blockers fixed at new head; independent re-review required
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Independent REVIEWER (must differ from author jcwalker3 / prgs-author) re-validates post-delete readback and active ownership protection at pinned head
137426f7ad6562c9e4ae09451d55491b6a4ccc7d; do not self-review or mergeNEXT_PROMPT:
WHAT_HAPPENED:
AUTHOR remediation on existing branch feat/issue-687-reconciler-branch-delete without opening a replacement PR.
Old head:
4a6357800364718a27a36ebc73578d4b929ff4aaNew head:
137426f7ad6562c9e4ae09451d55491b6a4ccc7dFix 1 — post-delete readback
After gitea_cleanup_merged_pr_branch DELETE, immediately probes the branch via the canonical GET client. Authoritative not-found is verified deletion. If the branch still exists, return structured failure (delete_acknowledged=true, success=false). Authentication, authorization, transport, and unexpected responses are preserved as structured error_class values without credentials or raw bodies. Readback evidence is included in the tool result and audit metadata.
Fix 2 — active ownership protection
Before DELETE, collects ownership from author issue locks, control-plane leases (role-tagged), and worktree bindings for the exact remote/org/repo/branch. Blocks active author session/lease, reviewer lease, merger/controller/reconciler lease, and worktree binding ownership. Released/abandoned/reclaimable expired records do not block; sticky stale (reclaim_allowed=false) blocks per recovery policy. Out-of-scope repository or branch ownership is ignored. Existing protected/default/preservation, open-PR, non-ancestor, confirmation phrase, and reconciler-role gates are preserved.
Changed files
Validation
WHY:
Independent review identified missing post-delete verification and incomplete ownership protection on the merged-PR branch cleanup path.
RELATED_PRS:
#688
BLOCKERS:
none for independent re-review
VALIDATION:
137426f7adpushed to feat/issue-687-reconciler-branch-delete5b0d7aed0aLAST_UPDATED_BY:
jcwalker3 / prgs-author / AUTHOR / 2026-07-16
Canonical Issue State
STATE:
ready-for-review — second remediation at new head; independent re-review required
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Independent REVIEWER (must differ from author jcwalker3 / prgs-author) re-validates R1/R2/O1/O2/O3/O4 and host matching at pinned head
1c37e620142ec4c9d5271ee84a0abc2d8decdd99; do not self-review or mergeNEXT_PROMPT:
WHAT_HAPPENED:
Second author remediation on feat/issue-687-reconciler-branch-delete.
Old head:
137426f7ad6562c9e4ae09451d55491b6a4ccc7dNew head:
1c37e620142ec4c9d5271ee84a0abc2d8decdd99Findings fixed
Validation
WHY:
Second independent review blockers on readback scope, result field consistency, inventory fail-open, expired reclaim, missing comment leases, reconcile bypass, and host identity.
RELATED_PRS:
#688
BLOCKERS:
none for independent re-review
VALIDATION:
1c37e62014pushedLAST_UPDATED_BY:
jcwalker3 / prgs-author / AUTHOR / 2026-07-16
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 34951-162bb08c1f58
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-688-1c37e620
phase: claimed
candidate_head:
1c37e62014target_branch: master
target_branch_sha:
5b0d7aed0alast_activity: 2026-07-16T05:37:21Z
expires_at: 2026-07-16T07:37:21Z
blocker: none
Canonical PR State
STATE: approve
WHO_IS_NEXT: merger
NEXT_ACTION: Merger may merge PR #688 at head
1c37e62014with explicit operator authorization only; do not force-merge.NEXT_PROMPT:
WHAT_HAPPENED: Formal independent re-review of PR #688 at pinned head
1c37e62014completed via gitea-reviewer. All prior #687 remediation gates re-verified PASS. Prior REQUEST_CHANGES review #425 atc7a444eis stale after author push.WHY: Post-delete readback scopes verified_absent to branch-only 404; ownership inventory fails closed; expired leases are not auto-reclaimable; sticky ownership blocks deletion; comment-backed reviewer leases are included; reconcile path cannot bypass ownership/readback; reconciler alone uses guarded cleanup; migrations remain idempotent; three-dot scope is limited to ten #687 files.
ISSUE: 687
HEAD_SHA:
1c37e62014REVIEW_STATUS: approve
MERGE_READY: true
BLOCKERS: none
VALIDATION: Detached worktree branches/review-pr-688-1c37e620 @ pin. test_branch_cleanup_guard 48 passed; migrate/reconciler/audit 98; lease/merged-cleanup 136; proportional mcp_server+lease 231; compileall/AST ok.
LAST_UPDATED_BY: reviewer
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=4bb98ec79fdc925f; profile=prgs-reviewer; identity=sysadmin; session=34951-162bb08c1f58; lease_comment=11762
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 34951-162bb08c1f58
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-688-1c37e620
phase: released
candidate_head:
1c37e62014target_branch: master
target_branch_sha:
5b0d7aed0alast_activity: 2026-07-16T05:45:05Z
expires_at: 2026-07-16T07:45:05Z
blocker: manual-release
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 75747-0ae40ff3cc5c
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-688-1c37e620-m
phase: claimed
candidate_head:
1c37e62014target_branch: master
target_branch_sha:
5b0d7aed0alast_activity: 2026-07-16T08:16:38Z
expires_at: 2026-07-16T10:16:38Z
blocker: none
adopted_at: 2026-07-16T08:19:39Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 75747-0ae40ff3cc5c
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 11793
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #688
issue: #687
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 75754-bd19f7fe5ce6
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-688-1c37e620-m
phase: adopted
candidate_head:
1c37e62014target_branch: master
target_branch_sha:
5b0d7aed0alast_activity: 2026-07-16T08:19:39Z
expires_at: 2026-07-16T10:19:39Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-16T08:23:05.443723+00:00approveon PR feat(profiles): support reconciler cleanup capability and migration (Closes #687) (#688)closed(merged=True)77746b08fc19e20abb95e4171784e321cb88817a1prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.