@rtorcato/repo-tooling 3.37.1 → 3.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtorcato/repo-tooling",
3
- "version": "3.37.1",
3
+ "version": "3.37.2",
4
4
  "description": "One CLI to scaffold, audit and fix your repo's whole toolchain — linting, tests, commits, releases & CI.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -261,6 +261,20 @@ reviewable, and carried forward by `fix lockfile`:
261
261
  Every later use is `${AGENT_USER:+--add-assignee "$AGENT_USER"}`, which expands
262
262
  to nothing when it is empty — so there is one code path, not two.
263
263
 
264
+ **Resolve `HUMAN_USER` too — the person work is handed back to.** Needs no
265
+ config: on a personal repo the owner *is* the person. On an organisation repo
266
+ `.owner.login` is the org, which is not a human, so it resolves to empty and
267
+ every handoff below assigns nobody rather than something meaningless.
268
+
269
+ ```bash
270
+ HUMAN_USER=$(gh api "repos/$OWNER_REPO" --jq 'if .owner.type == "User" then .owner.login else "" end')
271
+ ```
272
+
273
+ Later uses are `${HUMAN_USER:+--add-assignee "$HUMAN_USER"}`, the same shape as
274
+ `AGENT_USER`. **A `gh … edit` whose every expansion is empty has no flags and
275
+ errors — skip the call entirely in that case** rather than letting it fail the
276
+ tick.
277
+
264
278
  **The point is that assignee answers "whose turn is it", which no label does
265
279
  well.** Today an issue an agent is mid-way through and an issue nobody has
266
280
  touched are both assigned to no one, so the *Assigned to you* view is only ever
@@ -274,9 +288,11 @@ half the story:
274
288
  | PR passed both reviews, waiting to merge | the human |
275
289
  | `ai-blocked`, declined, or held | the human |
276
290
 
277
- `@me` cannot express this: it resolves to whichever token is running, and the
278
- agents authenticate as the owner, so `@me` is *always* the human. That is why
279
- this is a separate name rather than a reuse.
291
+ `@me` cannot express either end: it resolves to whichever token is running, and
292
+ the identity check above *requires* that token to be `AGENT_USER` whenever an
293
+ agent account is declared — so `@me` is the agent precisely where the last two
294
+ rows want the human (#606). Both are therefore named explicitly, and `@me`
295
+ appears nowhere in this skill.
280
296
 
281
297
  Note the web UI's assignee picker can show a stale list that omits a
282
298
  freshly-added collaborator; `repos/{repo}/assignees` is the authority.
@@ -538,7 +554,7 @@ makes `merge-ready` assert more than the `ai-ok-*` pair ever did: reviews passed
538
554
  *and* GitHub will accept the merge.
539
555
 
540
556
  ```bash
541
- gh pr edit <N> --add-assignee @me --add-label merge-ready \
557
+ gh pr edit <N> ${HUMAN_USER:+--add-assignee "$HUMAN_USER"} --add-label merge-ready \
542
558
  --remove-label ai-review --remove-label ai-ok-code --remove-label ai-ok-sec \
543
559
  ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
544
560
  ```
@@ -633,7 +649,12 @@ the label landed, in no *Assigned to you* view at all. A legacy sweep, cheap to
633
649
  keep and self-retiring once the last one is handled:
634
650
 
635
651
  ```bash
636
- gh pr edit <N> --add-assignee @me ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
652
+ # Both empty (org repo, no agentUser) would leave `gh pr edit <N>` with no flags,
653
+ # which errors — so guard the call rather than trusting the reader to skip it.
654
+ if [ -n "$HUMAN_USER" ] || [ -n "$AGENT_USER" ]; then
655
+ gh pr edit <N> ${HUMAN_USER:+--add-assignee "$HUMAN_USER"} \
656
+ ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
657
+ fi
637
658
  ```
638
659
 
639
660
  Count it as `rev`. Idempotent, so it also picks up ones an earlier tick stranded.
@@ -779,8 +800,8 @@ git -C "$ROOT" worktree remove --force "$WT_DIR" # the path found above, not a
779
800
  git -C "$ROOT" branch -D "$BRANCH" 2>/dev/null
780
801
  gh issue edit <N> --remove-label ai-wip ${AGENT_USER:+--remove-assignee "$AGENT_USER"} 2>/dev/null
781
802
  # Still OPEN means the PR said only `Refs #N`; a `Closes #N` issue is already closed.
782
- if [ "$(gh issue view <N> --json state -q .state)" = OPEN ]; then
783
- gh issue edit <N> --add-assignee @me
803
+ if [ -n "$HUMAN_USER" ] && [ "$(gh issue view <N> --json state -q .state)" = OPEN ]; then
804
+ gh issue edit <N> --add-assignee "$HUMAN_USER"
784
805
  fi
785
806
  ```
786
807
 
@@ -811,7 +832,7 @@ work must never be reaped out from under itself.
811
832
 
812
833
  | Stalled | Condition | Do |
813
834
  |---|---|---|
814
- | Implementer died | issue `ai-wip` ≥45min, **and no PR exists** for `ai-<N>-<slug>` | `gh issue edit <N> --add-label ai-blocked --remove-label ai-wip --add-assignee @me ${AGENT_USER:+--remove-assignee "$AGENT_USER"}`, comment, remove the worktree (and set `REMOVED=1`) |
835
+ | Implementer died | issue `ai-wip` ≥45min, **and no PR exists** for `ai-<N>-<slug>` | `gh issue edit <N> --add-label ai-blocked --remove-label ai-wip ${HUMAN_USER:+--add-assignee "$HUMAN_USER"} ${AGENT_USER:+--remove-assignee "$AGENT_USER"}`, comment, remove the worktree (and set `REMOVED=1`) |
815
836
  | Reviewer died | PR `ai-reviewing-code` (or `ai-reviewing-sec`) ≥45min with no matching `ai-ok-*` and no `ai-changes` | `gh pr edit <N> --remove-label <the claim that stalled>` — drop **that** label, not a fixed one; a stalled `ai-reviewing-sec` cleared as `ai-reviewing-code` leaves the dead claim in place and the reviewer never re-spawns. Dropping the claim is what lets Pass 3 re-spawn it, and they're cheap and diff-scoped. If that claim has been applied ≥3 times, `ai-blocked` instead |
816
837
  | Fix implementer died | PR `ai-fixing` ≥45min and still `ai-changes` — it never got as far as relabelling to `ai-review` | `gh pr edit <N> --remove-label ai-fixing`, which is what lets Pass 3 dispatch the round again. If `ai-fixing` has been applied ≥3 times, `ai-blocked` on the linked issue instead — a round that dies every time is not one more spawn away from working. Leave the worktree: it holds whatever the dead implementer committed |
817
838
  | Orphan worktree | `"$WT_ROOT"/ai-<N>-*` whose issue is not `ai-wip` and has no open PR | remove the worktree and branch (and set `REMOVED=1`) |
@@ -1218,10 +1239,10 @@ and a blank line — naming what each round changed and why the reviewer kept ob
1218
1239
  then:
1219
1240
 
1220
1241
  ```bash
1221
- gh issue edit <M> --add-label ai-blocked --remove-label ai-wip --add-assignee @me \
1222
- ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
1223
- gh pr edit <N> --add-assignee @me --remove-label ai-review \
1224
- ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
1242
+ gh issue edit <M> --add-label ai-blocked --remove-label ai-wip \
1243
+ ${HUMAN_USER:+--add-assignee "$HUMAN_USER"} ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
1244
+ gh pr edit <N> --remove-label ai-review \
1245
+ ${HUMAN_USER:+--add-assignee "$HUMAN_USER"} ${AGENT_USER:+--remove-assignee "$AGENT_USER"}
1225
1246
  ```
1226
1247
 
1227
1248
  Leave the worktree and PR in place for the human; a ping-pong stall is the case where
@@ -1567,8 +1588,9 @@ Then spawn a background implementer agent:
1567
1588
  > If you cannot finish, hand it back so a human can see it:
1568
1589
  >
1569
1590
  > ```bash
1570
- > gh issue edit <N> --add-label ai-blocked --remove-label ai-wip --add-assignee @me \
1571
- > <the orchestrator substitutes `--remove-assignee <AGENT_USER>` here, or nothing>
1591
+ > gh issue edit <N> --add-label ai-blocked --remove-label ai-wip \
1592
+ > <the orchestrator substitutes `--add-assignee <HUMAN_USER>` and
1593
+ > `--remove-assignee <AGENT_USER>` here, either or both possibly nothing>
1572
1594
  > ```
1573
1595
  >
1574
1596
  > Handing back means the issue stops being the agent's: the human must end up the