@davidbyoung/software-factory 0.1.12 → 0.1.13
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/dist/board.d.mts +3 -1
- package/dist/board.mjs +12 -6
- package/dist/commands.mjs +1 -1
- package/dist/config.d.mts +7 -0
- package/dist/config.mjs +68 -5
- package/dist/explain.mjs +6 -0
- package/dist/guard-commit.d.mts +3 -3
- package/dist/guard-commit.mjs +31 -6
- package/dist/guard-ticket-text.d.mts +3 -2
- package/dist/guard-ticket-text.mjs +7 -4
- package/dist/labels.d.mts +28 -0
- package/dist/labels.mjs +36 -0
- package/dist/lib/refined-check.d.mts +1 -1
- package/dist/lib/refined-check.mjs +3 -5
- package/dist/lib/work-status.d.mts +6 -4
- package/dist/lib/work-status.mjs +17 -7
- package/dist/merge-policy.d.mts +9 -7
- package/dist/merge-policy.mjs +13 -11
- package/dist/poller.d.mts +3 -1
- package/dist/poller.mjs +10 -4
- package/dist/pr.d.mts +4 -0
- package/dist/pr.mjs +6 -3
- package/dist/remove.mjs +16 -9
- package/dist/review-verdict.d.mts +6 -1
- package/dist/review-verdict.mjs +15 -9
- package/dist/status.d.mts +2 -0
- package/dist/status.mjs +6 -3
- package/dist/sync.d.mts +4 -0
- package/dist/sync.mjs +17 -1
- package/dist/ticket-fields.d.mts +4 -2
- package/dist/ticket-fields.mjs +10 -3
- package/dist/ticket.d.mts +2 -1
- package/dist/ticket.mjs +30 -15
- package/dist/tickets/index.d.mts +2 -1
- package/dist/tickets/index.mjs +5 -4
- package/dist/tool-names.d.mts +7 -0
- package/dist/tool-names.mjs +1 -0
- package/dist/tools.d.mts +4 -1
- package/dist/tools.mjs +5 -0
- package/docs/cli.md +1 -1
- package/docs/configuration.md +178 -8
- package/docs/developing.md +1 -1
- package/docs/github/by-hand.md +2 -2
- package/docs/github/reference.md +21 -21
- package/docs/workflow.md +8 -6
- package/package.json +1 -1
- package/rules.md +7 -2
- package/settings.schema.json +45 -0
- package/skills/factory-address-review/SKILL.md +3 -3
- package/skills/factory-build/SKILL.md +3 -3
- package/skills/factory-resolve-conflicts/SKILL.md +1 -1
- package/workflows/factory-conflicts.yml +1 -1
- package/workflows/factory-merge-policy.yml +8 -7
- package/workflows/factory-review-verdict.yml +1 -1
- package/workflows/factory-review.yml +1 -1
package/rules.md
CHANGED
|
@@ -9,6 +9,11 @@ Tickets are read and written only through `npx --no-install factory ticket`,
|
|
|
9
9
|
and a pull request's conversation comments and labels through
|
|
10
10
|
`factory pr`, so the rules and skills hold whatever the ticket system.
|
|
11
11
|
|
|
12
|
+
A label is named here by its key under `tickets.labels` or
|
|
13
|
+
`code-host.labels`, such as `spec` or `verdict-override`, and those
|
|
14
|
+
commands take the key; `factory ticket view` shows the key beside a label
|
|
15
|
+
the repository renamed, as `needs-spec (spec)`.
|
|
16
|
+
|
|
12
17
|
## Small changes
|
|
13
18
|
|
|
14
19
|
A change is small when it changes under about 30 lines outside tests,
|
|
@@ -155,11 +160,11 @@ discovering it at push time.
|
|
|
155
160
|
## What merges without the owner
|
|
156
161
|
|
|
157
162
|
A pull request merges itself only when the merge-policy workflow labels it
|
|
158
|
-
`merge
|
|
163
|
+
`merge-automatic` and every gate passes on its newest commit,
|
|
159
164
|
`Review verdict` included. The agents' own rules always wait for the
|
|
160
165
|
owner. Its `Who merges` status in the checks list says which, and why.
|
|
161
166
|
|
|
162
|
-
Agents never merge, enable auto-merge, or add the `verdict
|
|
167
|
+
Agents never merge, enable auto-merge, or add the `verdict-override`
|
|
163
168
|
label, the owner's pass of the verdict for one commit; `factory pr label`
|
|
164
169
|
and `factory ticket label` refuse it, and the guard hook stops the ordinary
|
|
165
170
|
ways of adding it around them. Both workflows run from the default branch's copy,
|
package/settings.schema.json
CHANGED
|
@@ -109,6 +109,26 @@
|
|
|
109
109
|
},
|
|
110
110
|
"fields": {
|
|
111
111
|
"$ref": "#/definitions/tickets.fields"
|
|
112
|
+
},
|
|
113
|
+
"labels": {
|
|
114
|
+
"$ref": "#/definitions/tickets.labels"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"tickets.labels": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"description": "Your own names for the labels the factory puts on tickets. A key left out keeps its default name.",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"properties": {
|
|
123
|
+
"spec": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"minLength": 1,
|
|
126
|
+
"description": "The label on a change your users will see, which refinement writes a Spec into. Default: spec."
|
|
127
|
+
},
|
|
128
|
+
"follow-up": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"minLength": 1,
|
|
131
|
+
"description": "The label on the one follow-ups ticket. Default: follow-up."
|
|
112
132
|
}
|
|
113
133
|
}
|
|
114
134
|
},
|
|
@@ -271,6 +291,31 @@
|
|
|
271
291
|
"type": "string",
|
|
272
292
|
"minLength": 1,
|
|
273
293
|
"description": "The pattern a build names its branch by: {ticket}, the ticket's number, which it must have, and {user}, the code host account the build runs as. Quote it, as \"{ticket}\" or \"feature/{user}/{ticket}\". No default: factory init asks for it."
|
|
294
|
+
},
|
|
295
|
+
"labels": {
|
|
296
|
+
"$ref": "#/definitions/code-host.labels"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"code-host.labels": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"description": "Your own names for the labels on pull requests. A key left out keeps its default name.",
|
|
303
|
+
"additionalProperties": false,
|
|
304
|
+
"properties": {
|
|
305
|
+
"merge-automatic": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"minLength": 1,
|
|
308
|
+
"description": "The merge policy's label on a pull request that merges itself once every check passes. Default: merge-automatic."
|
|
309
|
+
},
|
|
310
|
+
"merge-manual": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"minLength": 1,
|
|
313
|
+
"description": "The merge policy's label on a pull request that waits for a person to merge it. Default: merge-manual."
|
|
314
|
+
},
|
|
315
|
+
"verdict-override": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"minLength": 1,
|
|
318
|
+
"description": "The label a person adds to pass the automated review's verdict for the newest commit. Sessions never add it. Default: verdict-override."
|
|
274
319
|
}
|
|
275
320
|
}
|
|
276
321
|
},
|
|
@@ -19,7 +19,7 @@ when the review said ready. A push starts the next commit without one. When
|
|
|
19
19
|
a round ends with rejections only and nothing to push, the verdict stays at
|
|
20
20
|
the last review's failure, so ask for a fresh read of the same commit
|
|
21
21
|
(`npx --no-install factory pr review-again N`); the reviewer
|
|
22
|
-
reads your replies and posts a new verdict. Never add the `verdict
|
|
22
|
+
reads your replies and posts a new verdict. Never add the `verdict-override`
|
|
23
23
|
label, never enable auto-merge, and never merge: the override is the
|
|
24
24
|
owner's alone, and the merge-policy workflow decides auto-merge.
|
|
25
25
|
|
|
@@ -194,7 +194,7 @@ If the gate or the push fails, reply on the affected threads with the
|
|
|
194
194
|
error and leave them open.
|
|
195
195
|
|
|
196
196
|
This run never merges, enables auto-merge, marks a draft ready, or adds the
|
|
197
|
-
`verdict
|
|
197
|
+
`verdict-override` label, and it pushes only to the pull request's
|
|
198
198
|
branch.
|
|
199
199
|
|
|
200
200
|
**Outside a run started by a review,** as in a local session working the
|
|
@@ -536,7 +536,7 @@ Escalate sooner, at any round, when:
|
|
|
536
536
|
To escalate, leave the threads open and give the user, for each one, the
|
|
537
537
|
reviewer's position, yours, and the evidence on both sides. The pull request
|
|
538
538
|
cannot merge until they decide, which is the point. If they side with you,
|
|
539
|
-
the `verdict
|
|
539
|
+
the `verdict-override` label is how they pass the verdict for this commit, and
|
|
540
540
|
resolving the escalated threads is theirs too.
|
|
541
541
|
|
|
542
542
|
## 7. Three strikes on one unit
|
|
@@ -480,10 +480,10 @@ can wake later, waits for the review with
|
|
|
480
480
|
`npx --no-install factory pr state PR --wait` instead, and does not start
|
|
481
481
|
`factory pr watch`. Work the review with the `factory-address-review` skill.
|
|
482
482
|
|
|
483
|
-
The merge-policy workflow labels the pull request `merge
|
|
484
|
-
the files it changes, and turns auto-merge on for `merge
|
|
483
|
+
The merge-policy workflow labels the pull request `merge-automatic` or `merge-manual` from
|
|
484
|
+
the files it changes, and turns auto-merge on for `merge-automatic` ones, which
|
|
485
485
|
then merge themselves once every gate passes. Never enable auto-merge,
|
|
486
|
-
merge, or add the `verdict
|
|
486
|
+
merge, or add the `verdict-override` label yourself. In the report, say which
|
|
487
487
|
label the pull request got, so the owner knows whether it waits for them.
|
|
488
488
|
|
|
489
489
|
## 7. Report
|
|
@@ -125,7 +125,7 @@ another branch would not fix it.
|
|
|
125
125
|
|
|
126
126
|
This run merges the default branch into the branch. It never rebases, never force
|
|
127
127
|
pushes, never merges the pull request, approves it, turns on auto-merge,
|
|
128
|
-
marks a draft ready, or adds the `verdict
|
|
128
|
+
marks a draft ready, or adds the `verdict-override` label. Its push
|
|
129
129
|
removes an existing override, as any push does.
|
|
130
130
|
|
|
131
131
|
**First, the stop marker.** If the pull request carries a stop comment
|
|
@@ -64,6 +64,6 @@ jobs:
|
|
|
64
64
|
|
|
65
65
|
How: read `.claude/skills/factory-resolve-conflicts/SKILL.md` from this checkout and follow its section "The conflict sweep" exactly, reading `.claude/skills/factory-address-review/SKILL.md` from this checkout where that section sends you to it. Run `export DO_NOT_TRACK=1`, and `git fetch --unshallow origin` if `git rev-parse --is-shallow-repository` prints `true`, since a shallow clone cannot merge. Read `CLAUDE.md`, and `AGENTS.md` where there is one, before changing code. This is a run nobody can wake later, so where a skill waits for a review, wait with `npx --no-install factory pr state PR --wait`.
|
|
66
66
|
|
|
67
|
-
Git: push only to the pull request's own branch, never to the default branch. Never force push or rebase. Never merge, approve, enable auto-merge, mark a draft ready, or add the `verdict
|
|
67
|
+
Git: push only to the pull request's own branch, never to the default branch. Never force push or rebase. Never merge, approve, enable auto-merge, mark a draft ready, or add the `verdict-override` label. Open an issue only as the skill says.
|
|
68
68
|
|
|
69
69
|
End with the skill's report as your final message. Say in it that this run was in GitHub Actions and that nothing watches the pull requests once it ends. Do not send a notification. Use American English and the Oxford comma.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
name: Factory merge policy
|
|
2
2
|
|
|
3
|
-
# Labels each pull request
|
|
4
|
-
# files it changes, posts the reason as
|
|
5
|
-
# turns auto-merge on only for
|
|
6
|
-
# `factory merge-policy` holds the
|
|
7
|
-
# files, and reads the auto-merge lists
|
|
3
|
+
# Labels each pull request merge-automatic or merge-manual, by the names
|
|
4
|
+
# code-host.labels gives them, from the files it changes, posts the reason as
|
|
5
|
+
# the non-blocking "Who merges" status, and turns auto-merge on only for
|
|
6
|
+
# merge-automatic ones that are not drafts. `factory merge-policy` holds the
|
|
7
|
+
# factory's own files, and reads the label names and the auto-merge lists
|
|
8
|
+
# from the settings. It reads
|
|
8
9
|
# the pull request as it is now, and the steps use its commit and draft
|
|
9
10
|
# state: an event sent just after a push can carry the previous commit.
|
|
10
11
|
#
|
|
@@ -62,7 +63,7 @@ jobs:
|
|
|
62
63
|
run: |
|
|
63
64
|
result=$(npx --no-install factory merge-policy "$PR")
|
|
64
65
|
{
|
|
65
|
-
echo "label=$(jq -r .
|
|
66
|
+
echo "label=$(jq -r .label <<<"$result")"
|
|
66
67
|
echo "other=$(jq -r .other <<<"$result")"
|
|
67
68
|
echo "automatic=$(jq -r .automatic <<<"$result")"
|
|
68
69
|
echo "status=$(jq -r .status <<<"$result")"
|
|
@@ -70,7 +71,7 @@ jobs:
|
|
|
70
71
|
echo "draft=$(jq -r .draft <<<"$result")"
|
|
71
72
|
} >> "$GITHUB_OUTPUT"
|
|
72
73
|
{
|
|
73
|
-
echo "### $(jq -r .
|
|
74
|
+
echo "### $(jq -r .label <<<"$result")"
|
|
74
75
|
jq -r '.reasons[] | "- \(.)"' <<<"$result"
|
|
75
76
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
76
77
|
|
|
@@ -30,7 +30,7 @@ jobs:
|
|
|
30
30
|
github.event.workflow_run.event == 'pull_request') ||
|
|
31
31
|
(github.event_name == 'pull_request_target' &&
|
|
32
32
|
((github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
|
|
33
|
-
github.event.label.name == 'verdict
|
|
33
|
+
github.event.label.name == 'verdict-override'))
|
|
34
34
|
runs-on: ubuntu-latest
|
|
35
35
|
timeout-minutes: 5
|
|
36
36
|
steps:
|
|
@@ -70,6 +70,6 @@ jobs:
|
|
|
70
70
|
|
|
71
71
|
How: use the Skill tool to invoke `factory-address-review` with "the owner's review ${{ github.event.review.id || inputs.review }} on #${{ github.event.pull_request.number || inputs.pr }}". If the Skill tool is unavailable, read `.claude/skills/factory-address-review/SKILL.md` and follow its section "A run started by the owner's review" exactly. Read `CLAUDE.md`, and `AGENTS.md` where there is one, before changing code. Most runs are started by the skill's own thread replies and stop at that section's step 3 without changing anything; that is expected. This is a run nobody can wake later, so where the skill waits for a review, wait with `npx --no-install factory pr state PR --wait`.
|
|
72
72
|
|
|
73
|
-
Git: push only to the pull request's own branch, never to the default branch. Never force push. Never merge, approve, enable auto-merge, mark a draft ready, or add the `verdict
|
|
73
|
+
Git: push only to the pull request's own branch, never to the default branch. Never force push. Never merge, approve, enable auto-merge, mark a draft ready, or add the `verdict-override` label. Do not open pull requests. Open an issue only as the skill says.
|
|
74
74
|
|
|
75
75
|
End with the skill's report as your final message. Say in it that this run was in GitHub Actions and that nothing watches the pull request once it ends. Do not send a notification; the thread replies are the record. Use American English and the Oxford comma.
|