[P0] Break the author worktree bootstrap deadlock #892

Closed
opened 2026-07-24 21:36:47 -05:00 by jcwalker3 · 1 comment
Owner

Parent epic: #887
Priority: P0

Problem

gitea_bootstrap_author_issue_worktree raises Durable author worktree resolution blocked (#618): workspace is the stable control checkout on every clean issue pick, with and without an explicit worktree_path, in dry-run and live, reproduced across at least five daemon generations and on clean picks #662–#666. The wall is inside the tool, not in the capability gate — the gate returns allowed and the tool then refuses.

Every documented substitute is also closed:

  1. gitea_bootstrap_author_issue_worktree -> RuntimeError (#618).
  2. scripts/worktree-start -> No session issue lock is bound.
  3. gitea_lock_issue -> #274 worktree path does not exist.
  4. git worktree add -> denied by the harness.

Doors 2 and 3 form a literal cycle: the script demands a bound lock, and locking demands an existing worktree. That cycle is independent of #618.

A partial bypass exists and should inform the fix, not substitute for it: gitea_lock_issue against an already existing, clean, master-equivalent branches/* worktree succeeds, because lock_issue is not walled the way bootstrap is. That only works when such a worktree happens to exist.

Prerequisites

This issue is strictly upstream of the atomic author finalization child — a branch that cannot be bootstrapped cannot be finalized.

Acceptance criteria

  • An author session starting from the stable control checkout can obtain a usable issue worktree through a sanctioned MCP path, with no shell git worktree add and no pre-existing branches/* directory.
  • The lock<->worktree cycle is broken: at least one of the two operations can bootstrap the other's precondition.
  • The bootstrap refusal, where it remains correct, reports which precondition is missing and the exact sanctioned call that satisfies it — not a bare RuntimeError.
  • Regression: from a clean control checkout with an empty branches/, a full allocate -> worktree -> lock sequence completes.
  • Regression: the #274 worktree path does not exist branch is distinguished from "does not belong", since the two need different recovery.

Duplicate verdict

NOT a duplicate. Related to #618 / #850 (referenced by the error text itself) and #274. Filed because the four-door shape — every documented recovery path also closed — is not captured by any single open issue.

Parent epic: #887 Priority: P0 ## Problem `gitea_bootstrap_author_issue_worktree` raises `Durable author worktree resolution blocked (#618): workspace is the stable control checkout` on every clean issue pick, with and without an explicit `worktree_path`, in dry-run and live, reproduced across at least five daemon generations and on clean picks #662–#666. The wall is inside the tool, not in the capability gate — the gate returns allowed and the tool then refuses. Every documented substitute is also closed: 1. `gitea_bootstrap_author_issue_worktree` -> `RuntimeError` (#618). 2. `scripts/worktree-start` -> `No session issue lock is bound`. 3. `gitea_lock_issue` -> #274 `worktree path does not exist`. 4. `git worktree add` -> denied by the harness. Doors 2 and 3 form a literal cycle: the script demands a bound lock, and locking demands an existing worktree. That cycle is independent of #618. A partial bypass exists and should inform the fix, not substitute for it: `gitea_lock_issue` against an *already existing*, clean, master-equivalent `branches/*` worktree succeeds, because `lock_issue` is not walled the way bootstrap is. That only works when such a worktree happens to exist. ## Prerequisites This issue is strictly upstream of the atomic author finalization child — a branch that cannot be bootstrapped cannot be finalized. ## Acceptance criteria - An author session starting from the stable control checkout can obtain a usable issue worktree through a sanctioned MCP path, with no shell `git worktree add` and no pre-existing `branches/*` directory. - The lock<->worktree cycle is broken: at least one of the two operations can bootstrap the other's precondition. - The bootstrap refusal, where it remains correct, reports which precondition is missing and the exact sanctioned call that satisfies it — not a bare `RuntimeError`. - Regression: from a clean control checkout with an empty `branches/`, a full allocate -> worktree -> lock sequence completes. - Regression: the #274 `worktree path does not exist` branch is distinguished from "does not belong", since the two need different recovery. ## Duplicate verdict NOT a duplicate. Related to #618 / #850 (referenced by the error text itself) and #274. Filed because the *four-door* shape — every documented recovery path also closed — is not captured by any single open issue.
jcwalker3 added the status:readyworkflow-hardeningsafetystale-runtimetype:bug labels 2026-07-24 21:36:47 -05:00
jcwalker3 added status:pr-open and removed status:ready labels 2026-07-25 18:27:49 -05:00
Author
Owner

Canonical Issue State

STATE:
ready-for-review

WHO_IS_NEXT:
reviewer

NEXT_ACTION:
Independent review of PR #926 at head 2066623986 against #892 acceptance criteria; approve or request-changes; do not self-merge from author.

NEXT_PROMPT:

Role: REVIEWER
Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools
PR: #926 (Closes #892)
Head: 2066623986df9a05c0f24bb760d7c0abb5bf0d9e

1. Native MCP prgs-reviewer only; gitea_whoami + gitea_resolve_task_capability(task=review_pr).
2. Acquire reviewer lease on PR #926 pinned to live head.
3. Verify: assess_author_issue_bootstrap emits task_scope=author_issue_bootstrap with empty reasons when allowed; bootstrap_permits_control_checkout accepts that scope for bootstrap tasks only; create_issue scope remains isolated; tests/test_issue_892_author_bootstrap_deadlock.py + bootstrap suite pass.
4. Approve or request-changes; hand off to merger only after independent approval.

WHAT_HAPPENED:
Implemented #892 fix and opened PR #926. Root cause was assess_author_issue_bootstrap returning allowed/proven for clean control while bootstrap_permits_control_checkout only accepted create_issue assessments. Aligned author assessment field shape (task_scope, empty reasons when allowed, base tip proof, binding paths) and expanded the shared predicate to accept task_scope=author_issue_bootstrap for author bootstrap tasks. Used documented partial bypass (pre-created clean branches/ worktree + gitea_lock_issue) to land the fix because the bug under fix blocked gitea_bootstrap_author_issue_worktree from control.

WHY:
Every author path that needs a new branches/ worktree was deadlocked: bootstrap refused control (#618), lock demanded an existing worktree (#274), worktree-start demanded a lock. #892 is strictly upstream of normal author finalization and of unblocking work such as #708.

RELATED_PRS:
PR #926 (open, mergeable=true, head 2066623986, Closes #892). Related prior context: #850 bootstrap tool, #618 durable worktree resolution, #749/#757 create_issue bootstrap predicate.

BLOCKERS:
None for this PR. Downstream: #708 remains blocked until #892 merges and author bootstrap works from clean control without shell worktree add.

VALIDATION:
PYTHONPATH=. venv/bin/python -m pytest tests/test_issue_892_author_bootstrap_deadlock.py tests/test_create_issue_bootstrap.py tests/test_issue_757_bootstrap_guard_agreement.py tests/test_author_issue_bootstrap.py -q → 105 passed, 31 subtests passed. gitea_commit_files head 2066623986. PR #926 mergeable=true. Control checkout remains clean master.

LAST_UPDATED_BY:
prgs-author (jcwalker3), session prgs-author-45653-8d3e6dc0, worktree branches/fix-issue-892-author-bootstrap-deadlock

## Canonical Issue State STATE: ready-for-review WHO_IS_NEXT: reviewer NEXT_ACTION: Independent review of PR #926 at head 2066623986df9a05c0f24bb760d7c0abb5bf0d9e against #892 acceptance criteria; approve or request-changes; do not self-merge from author. NEXT_PROMPT: ```text Role: REVIEWER Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools PR: #926 (Closes #892) Head: 2066623986df9a05c0f24bb760d7c0abb5bf0d9e 1. Native MCP prgs-reviewer only; gitea_whoami + gitea_resolve_task_capability(task=review_pr). 2. Acquire reviewer lease on PR #926 pinned to live head. 3. Verify: assess_author_issue_bootstrap emits task_scope=author_issue_bootstrap with empty reasons when allowed; bootstrap_permits_control_checkout accepts that scope for bootstrap tasks only; create_issue scope remains isolated; tests/test_issue_892_author_bootstrap_deadlock.py + bootstrap suite pass. 4. Approve or request-changes; hand off to merger only after independent approval. ``` WHAT_HAPPENED: Implemented #892 fix and opened PR #926. Root cause was assess_author_issue_bootstrap returning allowed/proven for clean control while bootstrap_permits_control_checkout only accepted create_issue assessments. Aligned author assessment field shape (task_scope, empty reasons when allowed, base tip proof, binding paths) and expanded the shared predicate to accept task_scope=author_issue_bootstrap for author bootstrap tasks. Used documented partial bypass (pre-created clean branches/ worktree + gitea_lock_issue) to land the fix because the bug under fix blocked gitea_bootstrap_author_issue_worktree from control. WHY: Every author path that needs a new branches/ worktree was deadlocked: bootstrap refused control (#618), lock demanded an existing worktree (#274), worktree-start demanded a lock. #892 is strictly upstream of normal author finalization and of unblocking work such as #708. RELATED_PRS: PR #926 (open, mergeable=true, head 2066623986df9a05c0f24bb760d7c0abb5bf0d9e, Closes #892). Related prior context: #850 bootstrap tool, #618 durable worktree resolution, #749/#757 create_issue bootstrap predicate. BLOCKERS: None for this PR. Downstream: #708 remains blocked until #892 merges and author bootstrap works from clean control without shell worktree add. VALIDATION: PYTHONPATH=. venv/bin/python -m pytest tests/test_issue_892_author_bootstrap_deadlock.py tests/test_create_issue_bootstrap.py tests/test_issue_757_bootstrap_guard_agreement.py tests/test_author_issue_bootstrap.py -q → 105 passed, 31 subtests passed. gitea_commit_files head 2066623986df9a05c0f24bb760d7c0abb5bf0d9e. PR #926 mergeable=true. Control checkout remains clean master. LAST_UPDATED_BY: prgs-author (jcwalker3), session prgs-author-45653-8d3e6dc0, worktree branches/fix-issue-892-author-bootstrap-deadlock
sysadmin removed the status:pr-open label 2026-07-26 03:25:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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