@jesdi/skills 0.0.72 → 0.0.73
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
|
@@ -45,7 +45,7 @@ Push only after the ladder passes, then wait for CI on the new head. If a resolu
|
|
|
45
45
|
|
|
46
46
|
## Handoff
|
|
47
47
|
|
|
48
|
-
`python3 babysit.py handoff ...` posts `## 🧑 Needs human: <reason>`, adds `needs-human`, releases the lease, and prints JSON with `status: handoff`, `terminal: true`, and the reason. `merge` can also perform this handoff before exiting with an error (for example, judge disagreement
|
|
48
|
+
`python3 babysit.py handoff ...` posts `## 🧑 Needs human: <reason>`, adds `needs-human`, releases the lease, and prints JSON with `status: handoff`, `terminal: true`, and the reason. `merge` can also perform this handoff before exiting with an error (for example, judge disagreement, a blocked merge, or open PRs that still target this PR's head branch). This terminal JSON is the completion signal even on a nonzero exit; proceed straight to notification and end the turn.
|
|
49
49
|
|
|
50
50
|
Finish any worktree cleanup before calling `handoff` or `merge`, and run either command alone: a shell suffix would keep working after a terminal result. After a completed handoff, the only remaining tool call in Claude Code is `PushNotification` with the reason (notification-specific tool discovery is allowed). Then end the turn immediately. In Codex, end the turn immediately. This completion rule takes precedence over inherited instructions for memory writes, session summaries, cleanup or verification; those are work after handoff.
|
|
51
51
|
|
|
@@ -897,6 +897,12 @@ def merge_cmd(repo, number, sha, body_file, policy, judge_label, approved, sessi
|
|
|
897
897
|
extra += "\n".join(f"- `{c['sha']}` {c['commit']['message'].splitlines()[0]} ({who(c)})"
|
|
898
898
|
for c in commits[oids.index(full) + 1:]) + "\n"
|
|
899
899
|
stop(f"approval was for {approved}", extra)
|
|
900
|
+
# PRs into this head branch would land on a branch already merged, so their work never reaches the base.
|
|
901
|
+
head_ref = pr["head"]["ref"]
|
|
902
|
+
stacked = gh("api", f"repos/{repo}/pulls", "-X", "GET", "-f", "state=open", "-f", f"base={head_ref}",
|
|
903
|
+
"--paginate", "--jq", ".[].number").split()
|
|
904
|
+
if stacked:
|
|
905
|
+
stop(f"open PRs still target {head_ref}: {', '.join('#' + n for n in stacked)}")
|
|
900
906
|
state = ci_state(repo, number, 0)
|
|
901
907
|
if state != "green":
|
|
902
908
|
stop(f"CI is {state} at merge time")
|
|
@@ -22,6 +22,8 @@ State is the JSON file $GH_FAKE_STATE:
|
|
|
22
22
|
title, body PR title and body (default "" )
|
|
23
23
|
repo_settings {allow_rebase_merge, allow_merge_commit, allow_squash_merge} served by `gh api repos/O/R`
|
|
24
24
|
merge_error when set, `gh pr merge` fails printing it (e.g. a required approval)
|
|
25
|
+
head_ref head branch of every PR (default "feature")
|
|
26
|
+
open_prs [{number, base}] served by `gh api pulls -X GET -f state=open -f base=B` (filtered by base)
|
|
25
27
|
merges recorded successful `gh pr merge` calls: {number, method, match, subject, body, auto}
|
|
26
28
|
Commits may carry `message`, `author` (login) and `parents` (list of shas; 2 = a merge commit).
|
|
27
29
|
`gh pr merge N --rebase|--merge|--squash --match-head-commit SHA [--subject S] [--body B]` fails
|
|
@@ -30,7 +32,7 @@ State is the JSON file $GH_FAKE_STATE:
|
|
|
30
32
|
(a race: the other session posts after our first read)
|
|
31
33
|
Every call is appended to $GH_FAKE_LOG as one JSON line {argv, write, unsupported}.
|
|
32
34
|
Supported: `gh api` (user, pulls/N/reviews, pulls/N/comments (review comments, always empty),
|
|
33
|
-
pulls/N/commits, `graphql` (answers the one connection the query asks for, with only the fields it selects), issues/N, pulls/N, issues/N/comments, issues/comments/ID,
|
|
35
|
+
pulls/N/commits, pulls (open list), `graphql` (answers the one connection the query asks for, with only the fields it selects), issues/N, pulls/N, issues/N/comments, issues/comments/ID,
|
|
34
36
|
issues/N/labels[/NAME], commits/SHA/check-runs, commits/SHA/statuses, branches/B/protection/required_status_checks; -X, -f/-F, --input, --jq, --paginate, -i), `gh pr|issue view|comment|edit`.
|
|
35
37
|
"""
|
|
36
38
|
import json
|
|
@@ -152,8 +154,12 @@ def api(args):
|
|
|
152
154
|
return emit({"number": int(path.split("/")[1]), "state": "open", "labels": labels_obj(),
|
|
153
155
|
"user": {"login": st["user"]},
|
|
154
156
|
"title": st.get("title", ""), "body": st.get("body", ""),
|
|
155
|
-
"head": {"sha": st.get("head_sha", "head1")},
|
|
157
|
+
"head": {"sha": st.get("head_sha", "head1"), "ref": st.get("head_ref", "feature")},
|
|
156
158
|
"base": {"ref": st.get("base_ref", "main"), **({"sha": st["base_sha"]} if "base_sha" in st else {})}}, jq, include)
|
|
159
|
+
if path == "pulls" and method == "GET" and fields.get("state") == "open":
|
|
160
|
+
log(False)
|
|
161
|
+
return emit([{"number": p["number"], "base": {"ref": p["base"]}} for p in st.get("open_prs", [])
|
|
162
|
+
if fields.get("base") in (None, p["base"])], jq, include)
|
|
157
163
|
if re.fullmatch(r"repos/[^/]+/[^/]+", path) and method == "GET":
|
|
158
164
|
log(False)
|
|
159
165
|
return emit(st.get("repo_settings", {"allow_rebase_merge": True, "allow_merge_commit": True,
|
|
@@ -122,3 +122,22 @@ def test_saved_body_does_not_stand_in_for_an_empty_live_body(tmp_path):
|
|
|
122
122
|
assert p.returncode != 0
|
|
123
123
|
assert merged(w) == []
|
|
124
124
|
assert not any("Merged by babysit-pr" in c["body"] for c in w.github()["comments"])
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def test_open_prs_into_the_head_branch_hand_off_and_nothing_merges(tmp_path):
|
|
128
|
+
# the final PR of a feat/<name> cut-over: increments #57 and #58 still target its head branch
|
|
129
|
+
w = world(tmp_path, head_ref="feat/new-cart",
|
|
130
|
+
open_prs=[{"number": 57, "base": "feat/new-cart"}, {"number": 60, "base": "main"},
|
|
131
|
+
{"number": 61, "base": "feat/new-cart"}])
|
|
132
|
+
p = merge(w, tmp_path, "a1b2c3d", "--judge", "agree")
|
|
133
|
+
assert p.returncode != 0
|
|
134
|
+
assert merged(w) == []
|
|
135
|
+
[h] = handoffs(w)
|
|
136
|
+
assert h.splitlines()[0] == "## 🧑 Needs human: open PRs still target feat/new-cart: #57, #61"
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_open_prs_into_other_branches_do_not_block_the_merge(tmp_path):
|
|
140
|
+
w = world(tmp_path, head_ref="feat/new-cart", open_prs=[{"number": 60, "base": "main"}])
|
|
141
|
+
p = merge(w, tmp_path, "a1b2c3d", "--judge", "agree")
|
|
142
|
+
assert p.returncode == 0, p.output
|
|
143
|
+
assert len(merged(w)) == 1
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-28T12:41:08.065Z",
|
|
4
4
|
"skills": [
|
|
5
5
|
{
|
|
6
6
|
"name": "agents-wayfinder",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "babysit-pr",
|
|
13
|
-
"version": "0.1.
|
|
14
|
-
"hash": "sha256-
|
|
13
|
+
"version": "0.1.3",
|
|
14
|
+
"hash": "sha256-cfc51ea1a1ed378c87e4b682bbbf9ecd01a8a5ce1bf4ed89380bb43346ad466f",
|
|
15
15
|
"description": "Babysit an open pull request until it is merged or handed to a human. Started by the PostToolUse hook after `gh pr create`, or by hand with `/babysit-pr <pr-url>`."
|
|
16
16
|
},
|
|
17
17
|
{
|