Support gitea.branch.delete capability in reconciler profile and migration helper #687

Open
opened 2026-07-12 20:30:40 -05:00 by jcwalker3 · 4 comments
Owner

Provisional local work already exists at commit a6665d2, created before issue ownership, and is classified as unreviewed WIP.

Acceptance Criteria:

  • cleanup_merged_pr_branch remains reconciler-owned;
  • gitea.branch.delete is recommended or required according to the intended policy;
  • author, reviewer, merger, and unrelated profiles cannot use the cleanup path;
  • arbitrary branch deletion remains unavailable;
  • only fully merged PR source branches can be deleted;
  • protected, evidence, preservation, active-worktree, leased, or open-PR branches cannot be deleted;
  • installer/profile validation reports missing reconciler cleanup capability;
  • supported runtime configuration update path is documented and tested;
  • client reload is required after profile updates.
Provisional local work already exists at commit `a6665d2`, created before issue ownership, and is classified as unreviewed WIP. Acceptance Criteria: - `cleanup_merged_pr_branch` remains reconciler-owned; - `gitea.branch.delete` is recommended or required according to the intended policy; - author, reviewer, merger, and unrelated profiles cannot use the cleanup path; - arbitrary branch deletion remains unavailable; - only fully merged PR source branches can be deleted; - protected, evidence, preservation, active-worktree, leased, or open-PR branches cannot be deleted; - installer/profile validation reports missing reconciler cleanup capability; - supported runtime configuration update path is documented and tested; - client reload is required after profile updates.
jcwalker3 added the type:featurestatus:readyworkflow-hardening labels 2026-07-12 20:30:40 -05:00
Author
Owner

Canonical Issue State

STATE: in-progress
WHO_IS_NEXT: author
NEXT_ACTION: Author needs to write tests and run validation suite on branch feat/issue-687-reconciler-branch-delete.
NEXT_PROMPT:

Run the full test suite and verify and then push branch feat/issue-687-reconciler-branch-delete to Gitea.

WHAT_HAPPENED: A provisional pre-issue commit was created under commit a6665d2 on branch branches/issue-tbd-reconciler-branch-delete. This happened because the implementation was begun before an owning Gitea issue had been created to track the change. To repair ownership, issue #687 has been created to cover the work. The task branch has been recreated under the canonical name feat/issue-687-reconciler-branch-delete, and the provisional changes have been cherry-picked onto it as commit 8cac50b2e7.
WHY: Provisional work was committed before issue ownership was established.
RELATED_PRS: none
BLOCKERS: none
VALIDATION: local tests are being run on the canonical worktree.
LAST_UPDATED_BY: author

## Canonical Issue State STATE: in-progress WHO_IS_NEXT: author NEXT_ACTION: Author needs to write tests and run validation suite on branch feat/issue-687-reconciler-branch-delete. NEXT_PROMPT: ```text Run the full test suite and verify and then push branch feat/issue-687-reconciler-branch-delete to Gitea. ``` WHAT_HAPPENED: A provisional pre-issue commit was created under commit a6665d2 on branch branches/issue-tbd-reconciler-branch-delete. This happened because the implementation was begun before an owning Gitea issue had been created to track the change. To repair ownership, issue #687 has been created to cover the work. The task branch has been recreated under the canonical name feat/issue-687-reconciler-branch-delete, and the provisional changes have been cherry-picked onto it as commit 8cac50b2e7e60d3d69c4416010b010a20cb2985a. WHY: Provisional work was committed before issue ownership was established. RELATED_PRS: none BLOCKERS: none VALIDATION: local tests are being run on the canonical worktree. LAST_UPDATED_BY: author
jcwalker3 added status:pr-open and removed status:ready labels 2026-07-12 20:33:07 -05:00
Owner

Canonical Issue 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:

Fix shorthand operations in migrate_profiles.py, limit reconciler delete branch scope, reload profile, and push again.

WHY: PR #688 failed review due to three findings in reconciler profile setup and migrate_profiles.
BLOCKERS: unresolved findings in validation report
VALIDATION: 57 tests passed in review worktree on head c7a444e.
RELATED_PRS: #688
LAST_UPDATED_BY: reviewer

## Canonical Issue 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: ```text Fix shorthand operations in migrate_profiles.py, limit reconciler delete branch scope, reload profile, and push again. ``` WHY: PR #688 failed review due to three findings in reconciler profile setup and migrate_profiles. BLOCKERS: unresolved findings in validation report VALIDATION: 57 tests passed in review worktree on head c7a444e. RELATED_PRS: #688 LAST_UPDATED_BY: reviewer
Author
Owner

Canonical Issue State

STATE:
author-complete — REQUEST_CHANGES fixes pushed on PR #688; waiting independent re-review

WHO_IS_NEXT:
reviewer

NEXT_ACTION:
Independent REVIEWER re-validates PR #688 at head 4a6357800364718a27a36ebc73578d4b929ff4aa against all three blockers; do not self-review or merge

NEXT_PROMPT:

Role: REVIEWER (must differ from author jcwalker3 / prgs-author)
Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools
PR: #688 | Issue: #687 | Head: 4a6357800364718a27a36ebc73578d4b929ff4aa
See PR #688 comment 10767 for full re-review checklist and validation proof.

WHAT_HAPPENED:
Author continued on existing PR #688 branch (no replacement PR). Addressed formal REQUEST_CHANGES from head c7a444e.

New head: 4a6357800364718a27a36ebc73578d4b929ff4aa

Blocker Fix
1 Canonical ops migrate_profiles emits gitea.pr.close etc.; canonicalize + fail if reconciler loses required ops
2 Raw delete reconciler cannot gitea_delete_branch; only guarded gitea_cleanup_merged_pr_branch; preserve branch blocked
3 Docs docs/gitea-execution-profiles.md full migrate/apply/reconnect/cleanup runbook

Canonical reconciler allowed ops after migration:
gitea.read, gitea.pr.close, gitea.pr.comment, gitea.issue.comment, gitea.issue.close, gitea.branch.delete

Not done (by design): live profile not updated; PR #684 source branch not deleted; #689 not modified except cross-link.

Separate work: #690 filed for mid-review profile-switch isolation (not absorbed into #687).

WHY:
Reviewer findings were correct: shorthand ops drop under the normalizer; branch.delete without role gates exposes raw delete.

RELATED_PRS:
PR #688 @ 4a63578; related #690; preserve evidence #681 branch untouched

BLOCKERS:
none for re-review

VALIDATION:

  • Full suite 2632 passed, 6 skipped at 4a6357800364718a27a36ebc73578d4b929ff4aa
  • Focused migration/cleanup/reconciler/op-normalization suites passed
  • compileall OK

LAST_UPDATED_BY:
jcwalker3 / prgs-author / AUTHOR / 2026-07-12

## Canonical Issue State STATE: author-complete — REQUEST_CHANGES fixes pushed on PR #688; waiting independent re-review WHO_IS_NEXT: reviewer NEXT_ACTION: Independent REVIEWER re-validates PR #688 at head `4a6357800364718a27a36ebc73578d4b929ff4aa` against all three blockers; do not self-review or merge NEXT_PROMPT: ```text Role: REVIEWER (must differ from author jcwalker3 / prgs-author) Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools PR: #688 | Issue: #687 | Head: 4a6357800364718a27a36ebc73578d4b929ff4aa See PR #688 comment 10767 for full re-review checklist and validation proof. ``` WHAT_HAPPENED: Author continued on existing PR #688 branch (no replacement PR). Addressed formal REQUEST_CHANGES from head c7a444e. **New head:** `4a6357800364718a27a36ebc73578d4b929ff4aa` | Blocker | Fix | |---------|-----| | 1 Canonical ops | migrate_profiles emits `gitea.pr.close` etc.; canonicalize + fail if reconciler loses required ops | | 2 Raw delete | reconciler cannot `gitea_delete_branch`; only guarded `gitea_cleanup_merged_pr_branch`; preserve branch blocked | | 3 Docs | `docs/gitea-execution-profiles.md` full migrate/apply/reconnect/cleanup runbook | Canonical reconciler allowed ops after migration: `gitea.read`, `gitea.pr.close`, `gitea.pr.comment`, `gitea.issue.comment`, `gitea.issue.close`, `gitea.branch.delete` **Not done (by design):** live profile not updated; PR #684 source branch not deleted; #689 not modified except cross-link. **Separate work:** #690 filed for mid-review profile-switch isolation (not absorbed into #687). WHY: Reviewer findings were correct: shorthand ops drop under the normalizer; branch.delete without role gates exposes raw delete. RELATED_PRS: PR #688 @ 4a63578; related #690; preserve evidence #681 branch untouched BLOCKERS: none for re-review VALIDATION: - Full suite **2632 passed, 6 skipped** at `4a6357800364718a27a36ebc73578d4b929ff4aa` - Focused migration/cleanup/reconciler/op-normalization suites passed - compileall OK LAST_UPDATED_BY: jcwalker3 / prgs-author / AUTHOR / 2026-07-12
Author
Owner

[THREAD STATE LEDGER]

what is true now

  • Server-side decision state: PR #688 remains in open state at live head 4a6357800364718a27a36ebc73578d4b929ff4aa; the latest formal review verdict is REQUEST_CHANGES recorded via the review API at superseded head c7a444eb4b41cf916fdbd20a4999ffd78af496d0; reviewer lease comment 10749 (session 25883-7d4c6e6ebd53, profile prgs-reviewer) is phase: claimed, pinned to c7a444e…, freshness active, expires_at: 2026-07-13T04:23:00Z.
  • Local verdict/state: controller session ran read-only lease recovery; no lease mutation, no takeover, no adoption, no repoint; lease worktree branches/review-pr688-feat-issue-687-reconciler-branch-delete is clean at c7a444e and was never advanced; control root clean on master @ 56f1230.

what changed

  • Live re-diagnosis via gitea_diagnose_reviewer_pr_lease_handoff (02:52Z): classification foreign_active, next_action: wait (earlier controller run classified instructed_lease_missing_with_replacement, also prescribing wait).
  • Non-owner recovery inventory completed; every canonical path is inapplicable: gitea_release_reviewer_pr_lease is owner-session only; gitea_cleanup_post_merge_moot_lease requires a landed/closed PR; control-plane expire/reclaim/abandon tools have no lease_id for comment lease 10749 and foreign-abandon proof is unsatisfiable (owner PID alive, worktree present, PR open, no operator authorization). PID equality with a live mcp_server.py process was NOT treated as ownership.
  • Durable defect issue #691 filed: completed reviewer lease pinned to a superseded head with no canonical non-owner cleanup path; cross-linked to #601, #599, #407, #515, #620, #690, #628.

what is blocked

  • Independent re-review of head 4a63578… waits on lease 10749 owner release or expiry at 2026-07-13T04:23:00Z. No bypass performed.
  • Blocker classification: queue/lease blocker

who/what acts next

  • Next actor: reviewer
  • Required action: after lease 10749 reaches expires_at (2026-07-13T04:23:00Z) or its owner session releases it, start a fresh prgs-reviewer run: full preflight (whoami, load_review_workflow, resolve review_pr), confirm live head is still exactly 4a6357800364718a27a36ebc73578d4b929ff4aa, acquire a new reviewer lease bound to a NEW detached worktree, perform the complete independent re-review per PR #688 comment 10767, and record the formal head-scoped verdict.
  • Do not do: do not steal, adopt, repoint, or manually delete lease 10749 or its worktree; do not infer lease ownership from PID equality; do not reuse or inherit any validation from the c7a444e lease for the new head; do not merge.

Canonical Issue State

STATE:
waiting-lease-expiry — REQUEST_CHANGES fixes at new head await independent re-review; foreign reviewer lease pinned to superseded head must expire or be released by its owner first

CANONICAL_ITEM:
PR #688 at live head 4a6357800364718a27a36ebc73578d4b929ff4aa — the sole review target; defect tracking for the lease-cleanup gap is issue #691

SUPERSEDED_ITEM:
PR #688 head c7a444eb4b41cf916fdbd20a4999ffd78af496d0 — carries the recorded REQUEST_CHANGES verdict and remains the pin of reviewer lease comment 10749 (session 25883-7d4c6e6ebd53); its validation must not be reused for the new head

WHO_IS_NEXT:
reviewer

NEXT_ACTION:
After 2026-07-13T04:23:00Z (or owner release of PR #688 lease comment 10749), fresh prgs-reviewer session re-validates PR #688 at pinned head 4a6357800364718a27a36ebc73578d4b929ff4aa per the checklist in PR #688 comment 10767

NEXT_PROMPT:

Role: REVIEWER (must differ from author jcwalker3 / prgs-author)
Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools
PR: #688 | Issue: #687 | Head: 4a6357800364718a27a36ebc73578d4b929ff4aa

Precondition: PR #688 lease comment 10749 (session 25883-7d4c6e6ebd53, pinned c7a444e) has expired (expires_at 2026-07-13T04:23:00Z) or was released by its owner. Verify with gitea_assess_reviewer_pr_lease before acquiring.

1. gitea_whoami + gitea_load_review_workflow + gitea_resolve_task_capability(review_pr) on prgs-reviewer only.
2. Confirm live head is exactly 4a6357800364718a27a36ebc73578d4b929ff4aa; stop if it moved.
3. Acquire a NEW reviewer lease bound to a NEW detached worktree under branches/ — do not reuse or adopt lease 10749 or worktree review-pr688-feat-issue-687-reconciler-branch-delete.
4. Perform the complete independent re-review per PR #688 comment 10767 (all three prior blockers), run focused + full suite from the new worktree.
5. Record the formal head-scoped verdict through the normal workflow. Do not merge.

WHAT_HAPPENED:
CONTROLLER ran review-lease recovery for PR #688. Confirmed: formal REQUEST_CHANGES complete at c7a444e; author push superseded it with 4a63578; lease comment 10749 (foreign session 25883-7d4c6e6ebd53) remains active and pinned to the superseded head with its worktree untouched. Searched all canonical release/expire/moot/abandon paths — none applies to a comment lease on an open PR without owner participation. Filed defect issue #691 with acceptance criteria for guarded superseded-head lease cleanup. Performed no lease mutation and no takeover; prescribed action is wait.

WHY:
Diagnostic prescribes wait and forbids foreign-lease steal; no supported non-owner cleanup exists for a provably obsolete comment lease on an open PR (defect tracked in #691).

RELATED_PRS:
#688 (awaiting re-review at 4a63578); defect issue #691; prior verdict thread PR #688 comments 10731–10767

BLOCKERS:
queue/lease blocker — foreign reviewer lease (PR #688 comment 10749) active until 2026-07-13T04:23:00Z

VALIDATION:
Read-only evidence this session: gitea_get_pr_review_feedback (verdict + stale flags), gitea_assess_reviewer_pr_lease + gitea_diagnose_reviewer_pr_lease_handoff (foreign_active / wait), gitea_list_workflow_leases (no DB lease for PR #688), lease worktree clean at c7a444e, control root clean at master 56f1230, master parity in-parity. Gitea mutations this session: issue #691 creation and this comment only.

LAST_UPDATED_BY:
jcwalker3 / prgs-author / CONTROLLER / 2026-07-12

[THREAD STATE LEDGER] ### what is true now - Server-side decision state: PR #688 remains in open state at live head `4a6357800364718a27a36ebc73578d4b929ff4aa`; the latest formal review verdict is REQUEST_CHANGES recorded via the review API at superseded head `c7a444eb4b41cf916fdbd20a4999ffd78af496d0`; reviewer lease comment 10749 (session `25883-7d4c6e6ebd53`, profile `prgs-reviewer`) is `phase: claimed`, pinned to `c7a444e…`, freshness `active`, `expires_at: 2026-07-13T04:23:00Z`. - Local verdict/state: controller session ran read-only lease recovery; no lease mutation, no takeover, no adoption, no repoint; lease worktree `branches/review-pr688-feat-issue-687-reconciler-branch-delete` is clean at `c7a444e` and was never advanced; control root clean on `master` @ `56f1230`. ### what changed - Live re-diagnosis via `gitea_diagnose_reviewer_pr_lease_handoff` (02:52Z): classification `foreign_active`, `next_action: wait` (earlier controller run classified `instructed_lease_missing_with_replacement`, also prescribing `wait`). - Non-owner recovery inventory completed; every canonical path is inapplicable: `gitea_release_reviewer_pr_lease` is owner-session only; `gitea_cleanup_post_merge_moot_lease` requires a landed/closed PR; control-plane `expire`/`reclaim`/`abandon` tools have no `lease_id` for comment lease 10749 and foreign-abandon proof is unsatisfiable (owner PID alive, worktree present, PR open, no operator authorization). PID equality with a live `mcp_server.py` process was NOT treated as ownership. - Durable defect issue **#691** filed: completed reviewer lease pinned to a superseded head with no canonical non-owner cleanup path; cross-linked to #601, #599, #407, #515, #620, #690, #628. ### what is blocked - Independent re-review of head `4a63578…` waits on lease 10749 owner release or expiry at `2026-07-13T04:23:00Z`. No bypass performed. - Blocker classification: queue/lease blocker ### who/what acts next - Next actor: reviewer - Required action: after lease 10749 reaches `expires_at` (2026-07-13T04:23:00Z) or its owner session releases it, start a fresh `prgs-reviewer` run: full preflight (whoami, load_review_workflow, resolve review_pr), confirm live head is still exactly `4a6357800364718a27a36ebc73578d4b929ff4aa`, acquire a new reviewer lease bound to a NEW detached worktree, perform the complete independent re-review per PR #688 comment 10767, and record the formal head-scoped verdict. - Do not do: do not steal, adopt, repoint, or manually delete lease 10749 or its worktree; do not infer lease ownership from PID equality; do not reuse or inherit any validation from the `c7a444e` lease for the new head; do not merge. ## Canonical Issue State STATE: waiting-lease-expiry — REQUEST_CHANGES fixes at new head await independent re-review; foreign reviewer lease pinned to superseded head must expire or be released by its owner first CANONICAL_ITEM: PR #688 at live head `4a6357800364718a27a36ebc73578d4b929ff4aa` — the sole review target; defect tracking for the lease-cleanup gap is issue #691 SUPERSEDED_ITEM: PR #688 head `c7a444eb4b41cf916fdbd20a4999ffd78af496d0` — carries the recorded REQUEST_CHANGES verdict and remains the pin of reviewer lease comment 10749 (session `25883-7d4c6e6ebd53`); its validation must not be reused for the new head WHO_IS_NEXT: reviewer NEXT_ACTION: After 2026-07-13T04:23:00Z (or owner release of PR #688 lease comment 10749), fresh `prgs-reviewer` session re-validates PR #688 at pinned head `4a6357800364718a27a36ebc73578d4b929ff4aa` per the checklist in PR #688 comment 10767 NEXT_PROMPT: ```text Role: REVIEWER (must differ from author jcwalker3 / prgs-author) Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools PR: #688 | Issue: #687 | Head: 4a6357800364718a27a36ebc73578d4b929ff4aa Precondition: PR #688 lease comment 10749 (session 25883-7d4c6e6ebd53, pinned c7a444e) has expired (expires_at 2026-07-13T04:23:00Z) or was released by its owner. Verify with gitea_assess_reviewer_pr_lease before acquiring. 1. gitea_whoami + gitea_load_review_workflow + gitea_resolve_task_capability(review_pr) on prgs-reviewer only. 2. Confirm live head is exactly 4a6357800364718a27a36ebc73578d4b929ff4aa; stop if it moved. 3. Acquire a NEW reviewer lease bound to a NEW detached worktree under branches/ — do not reuse or adopt lease 10749 or worktree review-pr688-feat-issue-687-reconciler-branch-delete. 4. Perform the complete independent re-review per PR #688 comment 10767 (all three prior blockers), run focused + full suite from the new worktree. 5. Record the formal head-scoped verdict through the normal workflow. Do not merge. ``` WHAT_HAPPENED: CONTROLLER ran review-lease recovery for PR #688. Confirmed: formal REQUEST_CHANGES complete at `c7a444e`; author push superseded it with `4a63578`; lease comment 10749 (foreign session `25883-7d4c6e6ebd53`) remains active and pinned to the superseded head with its worktree untouched. Searched all canonical release/expire/moot/abandon paths — none applies to a comment lease on an open PR without owner participation. Filed defect issue #691 with acceptance criteria for guarded superseded-head lease cleanup. Performed no lease mutation and no takeover; prescribed action is `wait`. WHY: Diagnostic prescribes `wait` and forbids foreign-lease steal; no supported non-owner cleanup exists for a provably obsolete comment lease on an open PR (defect tracked in #691). RELATED_PRS: #688 (awaiting re-review at 4a63578); defect issue #691; prior verdict thread PR #688 comments 10731–10767 BLOCKERS: queue/lease blocker — foreign reviewer lease (PR #688 comment 10749) active until 2026-07-13T04:23:00Z VALIDATION: Read-only evidence this session: gitea_get_pr_review_feedback (verdict + stale flags), gitea_assess_reviewer_pr_lease + gitea_diagnose_reviewer_pr_lease_handoff (foreign_active / wait), gitea_list_workflow_leases (no DB lease for PR #688), lease worktree clean at c7a444e, control root clean at master 56f1230, master parity in-parity. Gitea mutations this session: issue #691 creation and this comment only. LAST_UPDATED_BY: jcwalker3 / prgs-author / CONTROLLER / 2026-07-12
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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