Fix clone owner issues in folder-to-repo projects
Found while diagnosing Task 12902: Yumapos "Marketing RU" (project 50) dispatched nothing for ~1h after its repo URL was added to what had been a folder project. The pool clone ran as the node attachment's creator (roman@gmind.tech / GitHub ruzhukov, no access to the repo), not as the task's starter, and every launch was refused with "Repository not found".
Requirements (each a small, independent fix):
1. When a repo is added to a folder project, ask who should be the clone owner on each attached node, or warn when the current declarer's GitHub connection cannot reach the repo (the git-reach check already exists for the caller).
2. The board's wait reason must name a clone refusal ("Clone failed as <person>: Repository not found") instead of "Waiting: no free worktree" while the project's slots are held by refused launches.
3. The "Checkout failed" question must name the GitHub account the clone used (the clone owner, per `git_access.resolve_for_worktree_clone`) and link to Change clone owner, because "Check the project's Git access credential" points at the task starter, whose token is not the one used.
4. Change clone owner must invalidate the node broker's cached clone login (`apps/jaahd/cred_broker.py`, 5-minute `_GIT_CREDENTIAL_TTL_S`, keyed `system:<project>`). A 404 does not trigger git's `erase`, so the first Retry after the change still clones with the old login and fails.
5. Retry on "Checkout failed" should run a reach preflight first and refuse at once with the reason, instead of re-dispatching into five identical node refusals.
Out of scope: changing who a task's own runner pushes as (the starter rule in `apps/api/app/git_access.py`); GitHub App install management.
Done means:
- A folder project gaining a repo whose clone owner cannot reach it shows a visible warning naming that person, with a fix link.
- A task blocked by a clone refusal shows that cause on the board row, not "no free worktree".
- After Change clone owner, the very next launch uses the new owner's token (a test of the broker cache drop).
- Changed-area tests green.
Outcome
Clone-owner fixes: the project page warns when a node's clone owner can't read the repo, the board reads "clone failed as X: Repository not found", and the Checkout failed question names the credential and links Change clone owner. Broker cache-drop test added. Quick gate and changed-area tests green; PR #7798 queued to the merge lane. Visual check done: warning readable at desktop and phone widths. Memory: used mem-35812; proposed 0.
Artifacts
Activity
- Created
- Run
- Runner started
- Runner ended (done)