@jesdi/skills 0.0.95 → 0.0.96
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 +1 -1
- package/skills/implement-spec/ARCHITECTURE.md +1 -1
- package/skills/implement-spec/README.md +1 -0
- package/skills/implement-spec/driver_agents.py +5 -2
- package/skills/implement-spec/driver_final.py +7 -6
- package/skills/implement-spec/driver_merge.py +34 -10
- package/skills/implement-spec/driver_tidy.py +1 -1
- package/skills/implement-spec/tests/test_driver.py +3 -0
- package/skills/implement-spec/tests/test_merge.py +27 -3
- package/skills/implement-spec/tests/test_tidy.py +24 -1
- package/skills-manifest.json +3 -3
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@ and do not know about the run, except `driver_run.py`, which the deciding module
|
|
|
104
104
|
- The end of run rewrites the branch one time, before the first final review, and never after a review. A history
|
|
105
105
|
that origin has is never rewritten. `refs/implement-spec/<key>/recovery` holds the tip before the rewrite.
|
|
106
106
|
- A rewrite never changes a file: the driver compares trees (`driver_tidy.same_tree`) before it moves the branch.
|
|
107
|
-
- The push sends the reviewed commit, not the branch name, with no force.
|
|
107
|
+
- The push sends the reviewed commit, not the branch name, with no force. It refuses a commit that `origin` lacks with no good signature (when `commit.gpgsign` is on) or with a `Co-authored-by` trailer (`driver_merge.unpushable`).
|
|
108
108
|
|
|
109
109
|
### Work is never dropped
|
|
110
110
|
|
|
@@ -163,6 +163,7 @@ History rules:
|
|
|
163
163
|
- A history that `origin` already has is never rewritten. When `origin` has the PR branch or one of its commits, the driver does no tidy and no rebase. The full gate, the final review and a fast-forward push still run.
|
|
164
164
|
- The push happens only when the branch tip is the reviewed tip and that tip has a green full gate record.
|
|
165
165
|
- With `commit.gpgsign` on, the driver signs every commit it makes (ticket merges, tidied and renamed commits) with the configured key. The push happens only when every commit that `origin` lacks has a good signature (`%G?` is `G`); otherwise the end of run is BLOCKED and nothing is pushed.
|
|
166
|
+
- No pushed commit has a `Co-authored-by` trailer. `claude` agents run with Claude Code's commit attribution off, every commit the driver makes (merges, tidied and renamed commits) drops the trailer, and the push is BLOCKED when a commit that `origin` lacks still has one, for example in a history that `origin` already has. Reword it, then run with `--push` again.
|
|
166
167
|
|
|
167
168
|
A repository with no `origin` remote skips only step 2 and step 6. The tidied commits stay on the commit that the PR branch had when the run started, and the review range starts there. One ledger sentence says that the rebase and the push were skipped. The driver prints the two tips and ends with exit 0. When you add `origin` after such an end of run, `--push` does not push: the branch is on no base of that remote, so the end of run is BLOCKED.
|
|
168
169
|
|
|
@@ -238,9 +238,12 @@ def command(role: str, entry: str, report: str) -> list[str]:
|
|
|
238
238
|
"--sandbox", "danger-full-access"]
|
|
239
239
|
# --json: the log carries the token usage of each turn, which prices the run.
|
|
240
240
|
return ["codex", "exec", "--json", "--model", model, "-c", f'model_reasoning_effort="{effort}"', *tail]
|
|
241
|
-
# stream-json keeps tool output in the log and ends with a result that has total_cost_usd.
|
|
241
|
+
# stream-json keeps tool output in the log and ends with a result that has total_cost_usd. The empty
|
|
242
|
+
# attribution keeps Claude Code's Co-authored-by trailer off the agent's commits (includeCoAuthoredBy on a
|
|
243
|
+
# CLI older than attribution): the push refuses it.
|
|
242
244
|
return ["claude", "-p", "--model", model, "--effort", effort, "--permission-mode", "auto",
|
|
243
|
-
"--output-format", "stream-json", "--verbose"
|
|
245
|
+
"--output-format", "stream-json", "--verbose",
|
|
246
|
+
"--settings", json.dumps({"attribution": {"commit": "", "pr": ""}, "includeCoAuthoredBy": False})]
|
|
244
247
|
|
|
245
248
|
|
|
246
249
|
def last_message(report: str | Path) -> str:
|
|
@@ -695,11 +695,12 @@ def _open_pr(run: Run, final: dict, tickets: list[Ticket]) -> str:
|
|
|
695
695
|
return url
|
|
696
696
|
|
|
697
697
|
|
|
698
|
-
def
|
|
699
|
-
"""Block the push when
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
698
|
+
def _require_pushable(run: Run, tip: str) -> None:
|
|
699
|
+
"""Block the push when a commit that origin lacks has no good signature with commit.gpgsign on, or has a
|
|
700
|
+
Co-authored-by trailer."""
|
|
701
|
+
if bad := driver_merge.unpushable(tip):
|
|
702
|
+
raise Blocked(f"commits of {run.pr} may not be pushed: {'; '.join(bad)}: nothing is pushed; sign or reword "
|
|
703
|
+
"them, then run with --push again")
|
|
703
704
|
|
|
704
705
|
|
|
705
706
|
def _push(run: Run, final: dict, tickets: list[Ticket]) -> list[str]:
|
|
@@ -715,7 +716,7 @@ def _push(run: Run, final: dict, tickets: list[Ticket]) -> list[str]:
|
|
|
715
716
|
if not shutil.which("gh"):
|
|
716
717
|
raise Blocked("gh is not on PATH: nothing is pushed")
|
|
717
718
|
if final["pushed"] != tip:
|
|
718
|
-
|
|
719
|
+
_require_pushable(run, tip)
|
|
719
720
|
# The commit, not the branch name: what leaves the machine is the tip the review covered.
|
|
720
721
|
sent = git(".", "push", "-q", "origin", f"{tip}:refs/heads/{run.pr}")
|
|
721
722
|
if sent.returncode:
|
|
@@ -4,6 +4,7 @@ gets a tree: `begin` opens it in the ticket's own slot for the conflict agent. T
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
6
|
import os
|
|
7
|
+
import re
|
|
7
8
|
import subprocess
|
|
8
9
|
|
|
9
10
|
from driver_slots import ancestor, git
|
|
@@ -22,18 +23,41 @@ def signs() -> bool:
|
|
|
22
23
|
return git(".", "config", "--type=bool", "commit.gpgsign").stdout.strip() == "true"
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
CO_AUTHOR = re.compile(r"co-authored-by\s*:", re.IGNORECASE)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def without_co_authors(message: str) -> str:
|
|
30
|
+
"""`message` without the Co-authored-by trailers of its last paragraph, folded lines included: git reads
|
|
31
|
+
trailers only there, and the push refuses them."""
|
|
32
|
+
head, gap, last = message.strip().rpartition("\n\n")
|
|
33
|
+
kept, dropping = [], False
|
|
34
|
+
for line in last.splitlines():
|
|
35
|
+
dropping = bool(CO_AUTHOR.match(line)) or (dropping and line[:1].isspace())
|
|
36
|
+
if not dropping:
|
|
37
|
+
kept.append(line)
|
|
38
|
+
return f"{head}{gap}{chr(10).join(kept)}".strip() + "\n"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def commit_tree(args: list[str], message: str, env: dict[str, str]) -> subprocess.CompletedProcess:
|
|
42
|
+
"""`git commit-tree` with `env` on top of os.environ: signed when commit.gpgsign is on, which commit-tree
|
|
43
|
+
ignores, and with no Co-authored-by trailer, so every commit the driver makes is one the push takes."""
|
|
27
44
|
sign = ["-S"] if signs() else []
|
|
28
|
-
return subprocess.run(["git", "commit-tree", *sign, *args
|
|
45
|
+
return subprocess.run(["git", "commit-tree", *sign, *args, "-m", without_co_authors(message)], capture_output=True,
|
|
46
|
+
text=True, env={**os.environ, **env})
|
|
29
47
|
|
|
30
48
|
|
|
31
|
-
def
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
def unpushable(tip: str) -> list[str]:
|
|
50
|
+
"""Why each commit of `tip` that origin does not have may not be pushed: no good signature when commit.gpgsign
|
|
51
|
+
is on, or a Co-authored-by trailer."""
|
|
52
|
+
sign, found = signs(), []
|
|
53
|
+
log = git(".", "log", "-z", "--format=%h%x00%G?%x00%(trailers:key=Co-authored-by,valueonly,unfold,separator=;)",
|
|
54
|
+
tip, "--not", "--remotes=origin").stdout.split("\0")
|
|
55
|
+
for sha, status, co_author in zip(log[::3], log[1::3], log[2::3]):
|
|
56
|
+
if sign and status != "G":
|
|
57
|
+
found.append(f"{sha} has no good signature")
|
|
58
|
+
if co_author:
|
|
59
|
+
found.append(f"{sha} has a Co-authored-by trailer")
|
|
60
|
+
return found
|
|
37
61
|
|
|
38
62
|
|
|
39
63
|
def commit(pr_tip: str, tip: str, message: str) -> tuple[str, str]:
|
|
@@ -47,7 +71,7 @@ def commit(pr_tip: str, tip: str, message: str) -> tuple[str, str]:
|
|
|
47
71
|
if tree.returncode:
|
|
48
72
|
files = ", ".join(tree.stdout.splitlines()[1:]) or tree.stderr.strip()
|
|
49
73
|
return "", f"the merge into the PR branch conflicts in {files}"
|
|
50
|
-
made = commit_tree([tree.stdout.strip(), "-p", pr_tip, "-p", tip,
|
|
74
|
+
made = commit_tree([tree.stdout.strip(), "-p", pr_tip, "-p", tip], message, identity(tip))
|
|
51
75
|
return (made.stdout.strip(), "") if made.returncode == 0 else ("", f"git commit-tree failed: {made.stderr.strip()}")
|
|
52
76
|
|
|
53
77
|
|
|
@@ -29,7 +29,7 @@ def _commit(source: str, parent: str, words: str) -> str:
|
|
|
29
29
|
"""A commit on `parent` with the tree and the author of `source` and the message `words`; "" when git fails."""
|
|
30
30
|
name, email, date = git(".", "log", "-1", "--format=%an%n%ae%n%aI", source).stdout.splitlines() or [""] * 3
|
|
31
31
|
env = {**driver_merge.identity(source), "GIT_AUTHOR_NAME": name, "GIT_AUTHOR_EMAIL": email, "GIT_AUTHOR_DATE": date}
|
|
32
|
-
return driver_merge.commit_tree([f"{source}^{{tree}}", "-p", parent,
|
|
32
|
+
return driver_merge.commit_tree([f"{source}^{{tree}}", "-p", parent], words, env).stdout.strip()
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def rewrite(parent: str, steps: list[tuple[str, str]]) -> list[str]:
|
|
@@ -412,6 +412,9 @@ def test_command_lines_per_provider():
|
|
|
412
412
|
"--sandbox", "read-only", "-o", "r.json.last"]
|
|
413
413
|
assert driver_agents.command("reviewer", "opus@low", "r.json")[:6] == [
|
|
414
414
|
"claude", "-p", "--model", "opus", "--effort", "low"]
|
|
415
|
+
claude = driver_agents.command("implementer", "opus@low", "r.json")
|
|
416
|
+
# No Co-authored-by trailer on the agent's commits: the push refuses one.
|
|
417
|
+
assert claude[claude.index("--settings") + 1] == '{"attribution": {"commit": "", "pr": ""}, "includeCoAuthoredBy": false}'
|
|
415
418
|
|
|
416
419
|
|
|
417
420
|
@pytest.mark.parametrize("role", driver.ONLY)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Plumbing merges: fast-forward, merge commit, conflict, the guarded ref move and the guarded branch delete."""
|
|
2
2
|
import subprocess
|
|
3
3
|
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
4
6
|
import driver_merge
|
|
5
7
|
from conftest import GIT
|
|
6
8
|
|
|
@@ -101,9 +103,31 @@ def test_begin_opens_the_conflicting_merge_on_a_machine_with_no_git_identity(rep
|
|
|
101
103
|
assert driver_merge.begin(".", pr_tip) == ["a.txt"]
|
|
102
104
|
|
|
103
105
|
|
|
104
|
-
def
|
|
106
|
+
def test_unpushable_names_the_commits_origin_lacks_with_no_good_signature_when_commit_gpgsign_is_on(repo, monkeypatch):
|
|
105
107
|
repo()
|
|
106
108
|
tip = sh("git", "rev-parse", "--short", "HEAD")
|
|
107
|
-
assert driver_merge.
|
|
109
|
+
assert driver_merge.unpushable("HEAD") == []
|
|
108
110
|
monkeypatch.setenv("GIT_CONFIG_VALUE_2", "true") # the fixture's commit.gpgsign
|
|
109
|
-
assert driver_merge.
|
|
111
|
+
assert driver_merge.unpushable("HEAD") == [f"{tip} has no good signature"]
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@pytest.mark.parametrize("trailer", ["Co-Authored-By: C <c@x>", "co-authored-by: C <c@x>", "Co-authored-by : C <c@x>",
|
|
115
|
+
"Co-authored-by: C\n <c@x> folded\n x"])
|
|
116
|
+
def test_unpushable_names_a_commit_whose_trailers_hold_a_co_author_in_any_form_git_reads(repo, monkeypatch, trailer):
|
|
117
|
+
repo()
|
|
118
|
+
monkeypatch.setenv("GIT_CONFIG_VALUE_2", "true")
|
|
119
|
+
sh(*GIT, "commit", "-q", "--allow-empty", "-m", f"fix\n\n{trailer}")
|
|
120
|
+
co, base = sh("git", "rev-parse", "--short", "HEAD"), sh("git", "rev-parse", "--short", "HEAD~1")
|
|
121
|
+
assert driver_merge.unpushable("HEAD") == [f"{co} has no good signature", f"{co} has a Co-authored-by trailer",
|
|
122
|
+
f"{base} has no good signature"]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def test_a_commit_the_driver_makes_has_no_co_author_trailer_and_keeps_a_body_line_that_only_names_one(repo):
|
|
126
|
+
repo()
|
|
127
|
+
base = sh("git", "rev-parse", "HEAD")
|
|
128
|
+
message = ("fix: x\n\nCo-authored-by: is a trailer only at the end.\n\nWhy.\nSigned-off-by: A <a@x>\n"
|
|
129
|
+
"Co-Authored-By: C <c@x>\nco-authored-by : D\n <d@x>\n")
|
|
130
|
+
made = driver_merge.commit_tree([f"{base}^{{tree}}", "-p", base], message, {}).stdout.strip()
|
|
131
|
+
assert sh("git", "log", "-1", "--format=%B", made) == (
|
|
132
|
+
"fix: x\n\nCo-authored-by: is a trailer only at the end.\n\nWhy.\nSigned-off-by: A <a@x>")
|
|
133
|
+
assert driver_merge.unpushable(made) == []
|
|
@@ -211,6 +211,14 @@ def test_a_ticket_whose_merge_left_the_tree_as_it_was_gets_the_commit_before_it(
|
|
|
211
211
|
assert git(rig.repo, "log", "-1", "--format=%an %ae", commits["02"]) == "t t@example.com\n"
|
|
212
212
|
|
|
213
213
|
|
|
214
|
+
def test_a_rewritten_commit_drops_its_co_author_trailers_and_keeps_the_rest_of_its_message(repo):
|
|
215
|
+
repo()
|
|
216
|
+
git(".", "commit", "-q", "--allow-empty", "-m",
|
|
217
|
+
"fix(01): quote commas\n\nWhy.\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nco-authored-by: B <b@x>\n")
|
|
218
|
+
(made,) = driver_tidy.rewrite("HEAD~1", [("HEAD", driver_tidy.text("HEAD"))])
|
|
219
|
+
assert driver_tidy.text(made) == "fix(01): quote commas\n\nWhy.\n\n" # %B ends in a blank line
|
|
220
|
+
|
|
221
|
+
|
|
214
222
|
# ---------------------------------------------------------------- the fix batch and its report
|
|
215
223
|
|
|
216
224
|
def test_a_fix_batch_is_named_per_commit_and_a_commit_with_no_owner_is_a_violation(tmp_path):
|
|
@@ -249,7 +257,9 @@ def test_a_fix_batch_is_named_per_commit_and_a_commit_with_no_owner_is_a_violati
|
|
|
249
257
|
assert rig.led("End of run: BLOCKED at the tip", f"is not a tip the driver made: only {reviewed[:7]} gets a review")
|
|
250
258
|
|
|
251
259
|
git(rig.repo, "reset", "-q", "--hard", reviewed)
|
|
252
|
-
|
|
260
|
+
# The fixer's Co-authored-by trailer would block the push: the fix(NN) commit drops it.
|
|
261
|
+
trailer = "quote commas\n\nCo-Authored-By: Claude <noreply@anthropic.com>"
|
|
262
|
+
rig.run(plan(**{"final/fixer": [{}, {}, fixer(fn("02"), trailer)]}), "--push")
|
|
253
263
|
assert rig.code == 0 and [r["subject"] for r in rig.commits(reviewed)] == ["fix(02): quote commas"], rig.out
|
|
254
264
|
assert rig.pushes() == [f"refs/heads/feat/csv {rig.branch()}"] and rig.final()["batch"] == rig.branch()
|
|
255
265
|
|
|
@@ -567,6 +577,19 @@ def test_a_history_that_origin_already_has_is_not_rebased_and_not_tidied(tmp_pat
|
|
|
567
577
|
assert f"- 01: {rig.branch()[:7]} Export rows" in rig.prs()[0]["body"] and stage(rig)["status"] == "done"
|
|
568
578
|
|
|
569
579
|
|
|
580
|
+
def test_a_co_authored_commit_in_a_history_that_origin_already_has_blocks_the_push(tmp_path):
|
|
581
|
+
rig = Inside(tmp_path, ONE)
|
|
582
|
+
stray(rig, "published before the run")
|
|
583
|
+
published = rig.branch()
|
|
584
|
+
git(rig.repo, "push", "-q", "origin", "feat/csv")
|
|
585
|
+
stray(rig, "by hand\n\nCo-Authored-By: C <c@x>") # kept as it is: the history is not tidied
|
|
586
|
+
co_authored = rig.branch()[:7]
|
|
587
|
+
rig.run(plan(), *UNATTENDED)
|
|
588
|
+
assert rig.code == 1 and ref(rig.origin, "refs/heads/feat/csv") == published, rig.out
|
|
589
|
+
assert rig.led(f"End of run: BLOCKED at commits of feat/csv may not be pushed: {co_authored} has a Co-authored-by "
|
|
590
|
+
"trailer: nothing is pushed; sign or reword them, then run with --push again")
|
|
591
|
+
|
|
592
|
+
|
|
570
593
|
def weak(nn="01"):
|
|
571
594
|
return {f"tests/test_{nn}.py": "def test_x():\n assert True\n"}
|
|
572
595
|
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-09T17:40:37.516Z",
|
|
4
4
|
"skills": [
|
|
5
5
|
{
|
|
6
6
|
"name": "agents-wayfinder",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "implement-spec",
|
|
61
|
-
"version": "0.1.
|
|
62
|
-
"hash": "sha256-
|
|
61
|
+
"version": "0.1.58",
|
|
62
|
+
"hash": "sha256-39e2112bd7fac98fc3e510821f6cb2d1ca4265b08853d8eada8a40441d8eeafe",
|
|
63
63
|
"description": "Implement a specification in code."
|
|
64
64
|
},
|
|
65
65
|
{
|