mandrel 1.91.0 → 1.92.0
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/.agents/README.md +5 -5
- package/.agents/docs/SDLC.md +75 -107
- package/.agents/docs/configuration.md +1 -1
- package/.agents/docs/quality-gates.md +8 -7
- package/.agents/docs/workflows.md +4 -10
- package/.agents/instructions.md +2 -2
- package/.agents/schemas/agentrc.schema.json +1 -1
- package/.agents/schemas/lifecycle/README.md +2 -1
- package/.agents/schemas/lifecycle/ledger-record.schema.json +1 -1
- package/.agents/schemas/risk-verdict.schema.json +14 -1
- package/.agents/scripts/README.md +0 -46
- package/.agents/scripts/analyze-execution.js +76 -1
- package/.agents/scripts/check-doc-links.js +3 -0
- package/.agents/scripts/check-workflow-cli-lint.js +208 -0
- package/.agents/scripts/epic-audit-recheck.js +1 -1
- package/.agents/scripts/epic-plan-clarity.js +16 -6
- package/.agents/scripts/epic-plan-decompose.js +37 -59
- package/.agents/scripts/epic-plan-healthcheck.js +39 -6
- package/.agents/scripts/epic-plan-spec.js +41 -168
- package/.agents/scripts/epic-reconcile.js +7 -1
- package/.agents/scripts/lib/Logger.js +4 -4
- package/.agents/scripts/lib/audit-suite/index.js +4 -5
- package/.agents/scripts/lib/audit-suite/runner.js +6 -4
- package/.agents/scripts/lib/audit-suite/selector.js +2 -3
- package/.agents/scripts/lib/bdd-runner-detect.js +1 -1
- package/.agents/scripts/lib/command-header.js +20 -0
- package/.agents/scripts/lib/config/github.js +1 -3
- package/.agents/scripts/lib/config-settings-schema.js +4 -3
- package/.agents/scripts/lib/degraded-mode.js +1 -1
- package/.agents/scripts/lib/label-constants.js +18 -3
- package/.agents/scripts/lib/label-taxonomy.js +14 -3
- package/.agents/scripts/lib/mutation/baseline-snapshot.js +7 -6
- package/.agents/scripts/lib/orchestration/consolidation-precondition.js +18 -8
- package/.agents/scripts/lib/orchestration/context-hydration-engine.js +3 -4
- package/.agents/scripts/lib/orchestration/docs-digest.js +2 -2
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist-helpers.js +4 -0
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist.js +22 -12
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/authoring-context.js +6 -1
- package/.agents/scripts/lib/orchestration/epic-spec-reconciler-diff.js +18 -2
- package/.agents/scripts/{lifecycle-diff.js → lib/orchestration/lifecycle/ledger-diff.js} +10 -76
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/acceptance-reconciler.js +1 -1
- package/.agents/scripts/lib/orchestration/plan-context.js +510 -0
- package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +177 -0
- package/.agents/scripts/lib/orchestration/plan-metrics.js +445 -0
- package/.agents/scripts/lib/orchestration/plan-persist/amend.js +359 -0
- package/.agents/scripts/lib/orchestration/plan-persist/delivery-mode.js +127 -0
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +978 -0
- package/.agents/scripts/lib/orchestration/plan-persist/summary.js +191 -0
- package/.agents/scripts/lib/orchestration/plan-reachability.js +160 -0
- package/.agents/scripts/lib/orchestration/plan-runner/worktree-sweep.js +3 -3
- package/.agents/scripts/lib/orchestration/planning-risk.js +1 -1
- package/.agents/scripts/lib/orchestration/spec-freshness.js +1 -1
- package/.agents/scripts/lib/orchestration/ticketing/bulk.js +1 -1
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +11 -2
- package/.agents/scripts/lib/plan-phase-cleanup.js +16 -0
- package/.agents/scripts/lib/presentation/manifest-persistence.js +2 -3
- package/.agents/scripts/lib/templates/spec-author-prompts.js +74 -0
- package/.agents/scripts/plan-context.js +186 -0
- package/.agents/scripts/plan-critics.js +227 -0
- package/.agents/scripts/plan-persist.js +383 -0
- package/.agents/scripts/pr-watch-with-update.js +8 -7
- package/.agents/scripts/run-lint.js +10 -11
- package/.agents/scripts/story-plan.js +19 -7
- package/.agents/scripts/sync-claude-commands.js +10 -5
- package/.agents/skills/core/knowledge-transfer/SKILL.md +11 -7
- package/.agents/workflows/audit-documentation.md +5 -7
- package/.agents/workflows/audit-lighthouse.md +1 -0
- package/.agents/workflows/audit-security.md +1 -0
- package/.agents/workflows/audit-to-stories.md +16 -5
- package/.agents/workflows/git-deliver.md +76 -243
- package/.agents/workflows/helpers/_merge-conflict-template.md +1 -1
- package/.agents/workflows/helpers/code-review.md +7 -6
- package/.agents/workflows/helpers/deliver-epic.md +5 -4
- package/.agents/workflows/helpers/plan-epic-reference.md +109 -96
- package/.agents/workflows/helpers/plan-epic.md +246 -999
- package/.agents/workflows/helpers/plan-story.md +14 -14
- package/.agents/workflows/helpers/scope-triage-gate.md +6 -4
- package/.agents/workflows/helpers/single-story-deliver.md +5 -4
- package/.agents/workflows/helpers/worktree-lifecycle.md +9 -7
- package/.agents/workflows/mandrel-update.md +144 -466
- package/.agents/workflows/plan.md +73 -143
- package/docs/CHANGELOG.md +13 -0
- package/lib/cli/registry.js +21 -3
- package/package.json +1 -1
- package/.agents/schemas/loop-unit.schema.json +0 -70
- package/.agents/scripts/assert-branch.js +0 -81
- package/.agents/scripts/check-loop-units.js +0 -204
- package/.agents/scripts/detect-merges.js +0 -111
- package/.agents/scripts/git-pr-quality-gate.js +0 -205
- package/.agents/scripts/git-rebase-and-resolve.js +0 -234
- package/.agents/scripts/hierarchy-gate.js +0 -192
- package/.agents/scripts/hydrate-context.js +0 -179
- package/.agents/scripts/lib/loop-units/validate-loop-unit.js +0 -197
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/cli.js +0 -167
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/cli-args.js +0 -69
- package/.agents/scripts/lib/orchestration/plan-runner/plan-router.js +0 -86
- package/.agents/scripts/loc-delta.js +0 -205
- package/.agents/scripts/render-manifest.js +0 -143
- package/.agents/scripts/run-audit-suite.js +0 -97
- package/.agents/scripts/select-audits.js +0 -155
- package/.agents/scripts/update-mutation-baseline.js +0 -189
- package/.agents/workflows/explain.md +0 -118
- package/.agents/workflows/git-merge-pr.md +0 -377
- package/.agents/workflows/helpers/epic-plan-decompose.md +0 -22
- package/.agents/workflows/helpers/epic-plan-spec.md +0 -22
- package/.agents/workflows/loops/README.md +0 -65
- package/.agents/workflows/loops/fix-failing-tests.md +0 -74
- package/.agents/workflows/loops/nightly-audit.md +0 -81
- package/.agents/workflows/loops/watch-ci.md +0 -68
|
@@ -9,18 +9,15 @@ description: >-
|
|
|
9
9
|
|
|
10
10
|
# /git-deliver [Message] [--no-push] [--pr] [--draft] [--no-auto-merge] [--branch <name>] [--base <branch>]
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
pipeline
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
terminal step. Flags pin any level explicitly; the interactive choice prompt
|
|
22
|
-
fires **only** when the detected state is genuinely ambiguous, so the common
|
|
23
|
-
path stays non-interactive and scriptable.
|
|
12
|
+
The **single source of truth** for getting outstanding working-tree changes
|
|
13
|
+
out the door when they do not belong to a planned Epic (typo fixes, doc
|
|
14
|
+
tweaks, dependency bumps, operator housekeeping, benchmark result commits
|
|
15
|
+
from mandrel-bench's `/benchmark` Step 4). It is the ad-hoc counterpart to
|
|
16
|
+
the heavyweight `/deliver` pipeline: one command that **detects the git
|
|
17
|
+
setup** and escalates to the correct terminal step. Flags pin any level
|
|
18
|
+
explicitly; the interactive choice prompt fires **only** when the detected
|
|
19
|
+
state is genuinely ambiguous, so the common path stays non-interactive and
|
|
20
|
+
scriptable.
|
|
24
21
|
|
|
25
22
|
> **Persona**: `devops-engineer` · **Skills**:
|
|
26
23
|
> `core/git-workflow-and-versioning`
|
|
@@ -47,35 +44,30 @@ it is about to run** before it acts.
|
|
|
47
44
|
/git-deliver [Message] [--no-push] [--pr] [--draft] [--no-auto-merge] [--branch <name>] [--base <branch>]
|
|
48
45
|
```
|
|
49
46
|
|
|
50
|
-
- `Message` —
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fallback (`chore: ad-hoc changes <ISO 8601>`) is used so the commit is never
|
|
47
|
+
- `Message` — commit subject (and, at the **pr** level, the PR title); text
|
|
48
|
+
after the first blank line becomes the commit/PR body. When omitted, fall
|
|
49
|
+
back to `chore: ad-hoc changes <ISO 8601>` so the commit is never
|
|
54
50
|
unmessageable.
|
|
55
|
-
- `--no-push` — force the **commit** level
|
|
56
|
-
|
|
57
|
-
- `--pr` — force the **pr** level even from a feature branch where a plain
|
|
58
|
-
push would otherwise be the default.
|
|
51
|
+
- `--no-push` — force the **commit** level.
|
|
52
|
+
- `--pr` — force the **pr** level even from a feature branch.
|
|
59
53
|
- `--draft` — (pr level) open the PR in draft state and skip arming
|
|
60
|
-
auto-merge.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
GitHub's native auto-merge queue. The operator merges through the UI.
|
|
64
|
-
Default at the pr level is `gh pr merge --auto --squash --delete-branch`.
|
|
54
|
+
auto-merge.
|
|
55
|
+
- `--no-auto-merge` — (pr level) open a normal PR but do not enable native
|
|
56
|
+
auto-merge; the operator merges through the UI.
|
|
65
57
|
- `--branch <name>` — (pr level) override the auto-generated feature branch
|
|
66
|
-
name.
|
|
67
|
-
- `--base <branch>` — override the base branch used for detection and as the
|
|
68
|
-
merge target.
|
|
69
|
-
(
|
|
58
|
+
name.
|
|
59
|
+
- `--base <branch>` — override the base branch used for detection and as the
|
|
60
|
+
PR merge target. Default: `project.baseBranch` from `.agentrc.json`
|
|
61
|
+
(fallback `main`).
|
|
70
62
|
|
|
71
63
|
---
|
|
72
64
|
|
|
73
65
|
## Boot sweep
|
|
74
66
|
|
|
75
|
-
Before detecting the git setup, run the **protected boot sweep** so
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
Before detecting the git setup, run the **protected boot sweep** so the run
|
|
68
|
+
starts from a tidy local checkout — a feature branch this command opened on a
|
|
69
|
+
prior run, once its PR has merged, is reaped here rather than left to
|
|
70
|
+
accumulate:
|
|
79
71
|
|
|
80
72
|
```bash
|
|
81
73
|
node .agents/scripts/boot-sweep.js \
|
|
@@ -84,240 +76,81 @@ node .agents/scripts/boot-sweep.js \
|
|
|
84
76
|
--current "$(git rev-parse --abbrev-ref HEAD)"
|
|
85
77
|
```
|
|
86
78
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
still-open parent ticket; `--current` always excludes the branch you are on.
|
|
93
|
-
The sweep is **silent on a no-op** — nothing merged, `main` already current →
|
|
94
|
-
one summary line (`[boot-sweep] reaped 0 local + 0 remote; protected 0.`). Its
|
|
95
|
-
exit code is always `0`; a failed sweep is reported in that summary, never
|
|
96
|
-
allowed to fail the delivery run.
|
|
79
|
+
The safe subset of the `/git-cleanup` phases: fast-forwards the base branch,
|
|
80
|
+
prunes stale remote-tracking refs, and reaps merged branches. It never
|
|
81
|
+
touches the stash, never reaps a candidate with unpushed work / dirty
|
|
82
|
+
worktree / open parent ticket, and always exits `0` — a failed sweep is
|
|
83
|
+
reported in its summary line, never allowed to fail the delivery run.
|
|
97
84
|
|
|
98
85
|
---
|
|
99
86
|
|
|
100
87
|
## Step 0 — Detect Git Setup & Resolve Level
|
|
101
88
|
|
|
102
|
-
1. Resolve `[BASE_BRANCH]`
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
3.
|
|
106
|
-
`git status --porcelain`. If the output is empty: **STOP** and tell the
|
|
107
|
-
operator there is nothing to deliver.
|
|
108
|
-
4. Detect whether a remote is configured: `git remote`.
|
|
109
|
-
5. Resolve the **terminal level** from flags + state:
|
|
89
|
+
1. Resolve `[BASE_BRANCH]` (`--base` → `.agentrc.json` → `main`).
|
|
90
|
+
2. Read the current branch; verify `git status --porcelain` shows outstanding
|
|
91
|
+
changes — if empty, **STOP**: nothing to deliver.
|
|
92
|
+
3. Resolve the **terminal level** from flags + state:
|
|
110
93
|
- `--no-push` set → **commit**.
|
|
111
94
|
- No remote configured → **commit** (warn there is nowhere to push).
|
|
112
95
|
- `--pr` set → **pr**.
|
|
113
96
|
- Current branch equals `[BASE_BRANCH]` → **pr** (a direct push to the
|
|
114
|
-
protected base would be rejected
|
|
115
|
-
- Otherwise (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
non-ambiguous case, do **not** prompt — announce the detected level and
|
|
122
|
-
continue.
|
|
123
|
-
7. Echo a one-line plan to the operator before acting, e.g.
|
|
97
|
+
protected base would be rejected).
|
|
98
|
+
- Otherwise (feature branch with a remote) → **push**.
|
|
99
|
+
4. **Ambiguity gate.** Prompt the operator **only** when state is genuinely
|
|
100
|
+
under-determined — e.g. a detached HEAD, or a feature branch with a remote
|
|
101
|
+
but no upstream tracking ref (push `-u` vs. open a PR). In every
|
|
102
|
+
non-ambiguous case, do **not** prompt.
|
|
103
|
+
5. Echo a one-line plan before acting, e.g.
|
|
124
104
|
`detected: on feature branch 'fix/foo' with upstream → level: push`.
|
|
125
105
|
|
|
126
106
|
---
|
|
127
107
|
|
|
128
|
-
##
|
|
129
|
-
|
|
130
|
-
If the operator passed `[Message]`, use it verbatim. Otherwise fall back to
|
|
131
|
-
`chore: ad-hoc changes <ISO 8601 timestamp>`.
|
|
132
|
-
|
|
133
|
-
Split the message on the first blank line:
|
|
134
|
-
|
|
135
|
-
- **Subject** — the first line; commit subject and (pr level) PR title.
|
|
136
|
-
- **Body** — everything after the first blank line; commit body and (pr level)
|
|
137
|
-
PR body. May be empty.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Step 2 — Stage + Commit (all levels)
|
|
142
|
-
|
|
143
|
-
Stage all outstanding changes:
|
|
144
|
-
|
|
145
|
-
```powershell
|
|
146
|
-
git add -A
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Commit:
|
|
150
|
-
|
|
151
|
-
```powershell
|
|
152
|
-
git commit -m "<subject>" -m "<body>"
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
If the body is empty, omit the second `-m`. If the pre-commit hook fails:
|
|
156
|
-
|
|
157
|
-
1. Read the failure output.
|
|
158
|
-
2. Fix the issue (run `npm run format`, fix lint errors, etc.).
|
|
159
|
-
3. `git add -A` again.
|
|
160
|
-
4. Re-run `git commit` — do **not** pass `--no-verify`.
|
|
161
|
-
|
|
162
|
-
**If the level is `commit`, stop here** and print the commit summary.
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## Step 3 — Cut Feature Branch (pr level, from-base only)
|
|
167
|
-
|
|
168
|
-
Only when the level is **pr** *and* the current branch equals `[BASE_BRANCH]`.
|
|
169
|
-
Skip when already on a feature branch.
|
|
170
|
-
|
|
171
|
-
When `--branch <name>` is set, use it verbatim. Otherwise generate a branch
|
|
172
|
-
slug from the commit subject:
|
|
173
|
-
|
|
174
|
-
1. Detect the Conventional Commit type prefix (`<type>(<scope>): …`). If
|
|
175
|
-
matched, use `<type>` as the branch namespace. Allowed types: `feat`,
|
|
176
|
-
`fix`, `chore`, `docs`, `refactor`, `test`, `build`, `ci`, `perf`,
|
|
177
|
-
`style`. Anything else (or no prefix) → `chore`.
|
|
178
|
-
2. Strip the type prefix and any leading punctuation from the subject.
|
|
179
|
-
3. Lowercase, replace non-alphanumeric runs with `-`, collapse repeated
|
|
180
|
-
hyphens, trim leading/trailing hyphens.
|
|
181
|
-
4. Truncate to 50 chars on a word boundary.
|
|
182
|
-
5. Combine: `<type>/<slug>`. Example: `"Delete unused files"` →
|
|
183
|
-
`chore/delete-unused-files`.
|
|
184
|
-
|
|
185
|
-
Cut and check out the branch **before committing** — that is, when this step
|
|
186
|
-
applies, run it ahead of Step 2's commit so the commit lands on the feature
|
|
187
|
-
branch, never on the base branch:
|
|
188
|
-
|
|
189
|
-
```powershell
|
|
190
|
-
git checkout -b <branch-name>
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
If a local branch with that name already exists, append `-2` (then `-3`, …)
|
|
194
|
-
until `git rev-parse --verify` returns non-zero, and check that out instead.
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Step 4 — Push (push and pr levels)
|
|
199
|
-
|
|
200
|
-
Push the current branch. At the **push** level, push to the existing upstream:
|
|
201
|
-
|
|
202
|
-
```powershell
|
|
203
|
-
git push
|
|
204
|
-
```
|
|
108
|
+
## Steps 1–6 — Deliver at the resolved level
|
|
205
109
|
|
|
206
|
-
|
|
110
|
+
Commit, push, and PR mechanics are host-native git/`gh` competency; run them
|
|
111
|
+
directly, honoring these contracts:
|
|
207
112
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
## Step 5 — Open PR (pr level)
|
|
228
|
-
|
|
229
|
-
```powershell
|
|
230
|
-
gh pr create --base <BASE_BRANCH> --head <branch-name> \
|
|
231
|
-
--title "<subject>" --body "<body-or-default>"
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
When the body would otherwise be empty, fall back to a single line:
|
|
235
|
-
`Opened via /git-deliver`. Pass `--draft` to `gh pr create` when the operator
|
|
236
|
-
set `--draft`. Capture the PR URL from stdout for the summary.
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Step 6 — Arm Auto-Merge (pr level, default)
|
|
241
|
-
|
|
242
|
-
Skip when `--draft` or `--no-auto-merge` is set.
|
|
243
|
-
|
|
244
|
-
```powershell
|
|
245
|
-
gh pr merge <PR_NUMBER> --auto --squash --delete-branch
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
This queues the PR to merge as soon as required checks turn green and schedules
|
|
249
|
-
head-branch deletion on merge. Auto-merge requires `allow_auto_merge: true` on
|
|
250
|
-
the repo. If `gh pr merge --auto` fails (missing repo feature, insufficient
|
|
251
|
-
token scope), log the failure and surface it — the PR stays open and mergeable
|
|
252
|
-
through the GitHub UI.
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## Step 7 — Summary
|
|
257
|
-
|
|
258
|
-
Print a single block matched to the level that ran:
|
|
259
|
-
|
|
260
|
-
```text
|
|
261
|
-
# commit level
|
|
262
|
-
✅ Committed on <branch>: <subject>
|
|
263
|
-
|
|
264
|
-
# push level
|
|
265
|
-
✅ Committed + pushed <branch> → origin: <subject>
|
|
266
|
-
|
|
267
|
-
# pr level
|
|
268
|
-
✅ Opened PR #<PR_NUMBER>: <subject>
|
|
269
|
-
<PR_URL>
|
|
270
|
-
branch: <branch-name> → <BASE_BRANCH>
|
|
271
|
-
auto-merge: <enabled | draft | disabled>
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
Do **not** poll CI. That is the `/deliver` Phase 7 job and is overkill for
|
|
275
|
-
ad-hoc changes. The operator (or GitHub's email notification) is the next
|
|
276
|
-
watcher.
|
|
277
|
-
|
|
278
|
-
> **Local ref left behind — reaped at the next boot.** At the **pr** level
|
|
279
|
-
> this command leaves a local feature branch behind after the PR merges; it
|
|
280
|
-
> does **not** reap it inline (the merge happens later, out of band). You do
|
|
281
|
-
> not need to run `/git-cleanup` by hand: the next time `/git-deliver` (or
|
|
282
|
-
> `/plan`) runs, its **Boot sweep** step reaps that merged ad-hoc branch and
|
|
283
|
-
> fast-forwards `main` automatically. The delivering flow owns tidying its own
|
|
284
|
-
> refs on the next boot — see
|
|
285
|
-
> [`.agents/rules/git-conventions.md` § Local checkout hygiene](../rules/git-conventions.md).
|
|
286
|
-
|
|
287
|
-
---
|
|
113
|
+
- **Branch cut (pr level, from-base only).** Cut the feature branch **before
|
|
114
|
+
committing** so the commit never lands on the base branch. Branch name:
|
|
115
|
+
`--branch` verbatim, else `<type>/<slug>` — Conventional Commit type from
|
|
116
|
+
the subject (unrecognized/absent → `chore`), subject slugged to lowercase
|
|
117
|
+
hyphenated ≤50 chars. Name collision → append `-2`/`-3`/….
|
|
118
|
+
- **Stage + commit.** `git add -A`, then commit with the composed
|
|
119
|
+
subject/body.
|
|
120
|
+
- **Push.** `git push` (existing upstream) or `git push -u origin <branch>`.
|
|
121
|
+
Rejected because the remote is ahead → `git pull --rebase`, resolve, push
|
|
122
|
+
again.
|
|
123
|
+
- **Hook failures (commit or push).** Read the output, fix the underlying
|
|
124
|
+
issue, re-stage, and (for an already-pushed commit) add a **new follow-up
|
|
125
|
+
commit** rather than amending. **Never** `--no-verify`.
|
|
126
|
+
- **PR + auto-merge (pr level).** `gh pr create --base [BASE_BRANCH]`
|
|
127
|
+
with the subject/body (empty body → `Opened via /git-deliver`; pass
|
|
128
|
+
`--draft` through). Then, unless `--draft`/`--no-auto-merge`:
|
|
129
|
+
`gh pr merge --auto --squash --delete-branch`. If arming fails (repo
|
|
130
|
+
feature missing, token scope), log and surface it — the PR stays open and
|
|
131
|
+
mergeable through the UI.
|
|
288
132
|
|
|
289
|
-
|
|
133
|
+
Stop at the resolved level and print a one-block summary naming the branch,
|
|
134
|
+
subject, and (pr level) PR URL + auto-merge state.
|
|
290
135
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
- **Branch already exists locally**: appended `-2`/`-3` per Step 3; pass
|
|
296
|
-
`--branch <name>` for a specific name.
|
|
297
|
-
- **`gh pr create` fails with "no commits between branches"**: the push did not
|
|
298
|
-
move the branch (e.g. it was already at the same SHA as `[BASE_BRANCH]`).
|
|
299
|
-
Verify `git log <BASE_BRANCH>..HEAD` shows commits before re-running.
|
|
300
|
-
- **PR template wins over `--body`**: if `.github/pull_request_template.md`
|
|
301
|
-
exists, `gh pr create --body` overrides it. For ad-hoc PRs the explicit body
|
|
302
|
-
is the right default.
|
|
303
|
-
- **Auto-merge does not fire after CI green**: confirm the PR's required checks
|
|
304
|
-
match the auto-merge requirements. The framework's quality gate
|
|
305
|
-
(`Validate and Test`) is the canonical required check.
|
|
136
|
+
Do **not** poll CI — that is the `/deliver` Phase 7 job and is overkill for
|
|
137
|
+
ad-hoc changes. The local feature branch left behind at the pr level is
|
|
138
|
+
reaped by the next run's Boot sweep — see
|
|
139
|
+
[`.agents/rules/git-conventions.md` § Local checkout hygiene](../rules/git-conventions.md).
|
|
306
140
|
|
|
307
141
|
---
|
|
308
142
|
|
|
309
143
|
## Constraint
|
|
310
144
|
|
|
311
|
-
- **Never** push directly to `[BASE_BRANCH]`.
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
- **Never** pass `--no-verify` to `git commit` or `git push
|
|
315
|
-
|
|
145
|
+
- **Never** push directly to `[BASE_BRANCH]`. The from-base branch cut is
|
|
146
|
+
mandatory; remove it and the workflow becomes a silent bypass of the
|
|
147
|
+
PR-required policy.
|
|
148
|
+
- **Never** pass `--no-verify` to `git commit` or `git push`. Fix the failure
|
|
149
|
+
at the source.
|
|
316
150
|
- **Never** force-push from `/git-deliver`. This workflow opens new PRs, it
|
|
317
|
-
does not rewrite history.
|
|
318
|
-
`--force-with-lease` after a rebase) and `/deliver` Phase 7.
|
|
151
|
+
does not rewrite history.
|
|
319
152
|
- **Always** prefer `--auto --squash --delete-branch` at the pr level unless
|
|
320
|
-
the operator opts out, so `main`'s
|
|
153
|
+
the operator opts out, so `main`'s history stays uniform across the
|
|
321
154
|
`/git-deliver` and `/deliver` surfaces.
|
|
322
155
|
|
|
323
156
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Merge Conflict Resolution — Shared Procedure
|
|
2
2
|
|
|
3
3
|
Canonical, workflow-agnostic procedure for resolving merge / rebase conflicts.
|
|
4
|
-
Referenced by `
|
|
4
|
+
Referenced by `deliver-stories.md` and `deliver-epic.md`.
|
|
5
5
|
|
|
6
6
|
## Procedure
|
|
7
7
|
|
|
@@ -427,8 +427,8 @@ in-place.
|
|
|
427
427
|
1. **Apply a focused fix on `[HEAD_REF]`.** Permitted only when the
|
|
428
428
|
finding is unambiguously *fixable* (clean remediation, no scope
|
|
429
429
|
creep, no spec deviation, no secret exposure):
|
|
430
|
-
-
|
|
431
|
-
|
|
430
|
+
- Confirm `git branch --show-current` reports `[HEAD_REF]` before
|
|
431
|
+
touching the working tree; if it does not, STOP and re-checkout.
|
|
432
432
|
- Stage explicit paths only (never `git add .`).
|
|
433
433
|
- Make one focused conventional commit per finding
|
|
434
434
|
(`fix(<scope>): <description> (review finding)`).
|
|
@@ -461,9 +461,9 @@ ceremony above:
|
|
|
461
461
|
1. Group the fixable Mediums by owning lens (the pillar or audit family
|
|
462
462
|
that produced them). A Medium is fixable on the same terms as a 🟠; a
|
|
463
463
|
Medium in any escalation class stays on the comment exactly like a 🟠.
|
|
464
|
-
2. For each lens,
|
|
465
|
-
explicit paths only, and make **one focused
|
|
466
|
-
lens** (`fix(<scope>): <description> (review findings batch)`).
|
|
464
|
+
2. For each lens, confirm `git branch --show-current` reports
|
|
465
|
+
`[HEAD_REF]`, stage explicit paths only, and make **one focused
|
|
466
|
+
conventional commit per lens** (`fix(<scope>): <description> (review findings batch)`).
|
|
467
467
|
3. Bounded-attempt semantics extend to the batch: each finding gets **at
|
|
468
468
|
most one** attempt, and a lens's batch commit that would exceed
|
|
469
469
|
`delivery.codeReview.maxFixScopeFiles` routes that lens's findings to
|
|
@@ -549,7 +549,8 @@ If the operator instructs you to fix any findings:
|
|
|
549
549
|
|
|
550
550
|
```powershell
|
|
551
551
|
# Guard: confirm we're on the correct branch before committing.
|
|
552
|
-
|
|
552
|
+
# ([HEAD_REF] mismatch -> STOP and re-checkout before any commit.)
|
|
553
|
+
git branch --show-current
|
|
553
554
|
|
|
554
555
|
# Stage explicit paths — never `git add .` on a shared tree.
|
|
555
556
|
git add <path/one> <path/two>
|
|
@@ -769,14 +769,15 @@ run. Passing `--epic <epicId>` scopes the red-path failure digest to
|
|
|
769
769
|
`gh run view --log-failed` tail, coarse classification) and surfaces
|
|
770
770
|
the fix-loop handoff. Remediate on `epic/<epicId>` and re-run the
|
|
771
771
|
helper (auto-merge stays armed across retries). If the same failure
|
|
772
|
-
class recurs, hand the convergence off to
|
|
773
|
-
`/loop
|
|
772
|
+
class recurs, hand the convergence off to a self-paced host loop
|
|
773
|
+
(`/loop`) that re-runs the failing check and applies the smallest fix
|
|
774
|
+
until it exits green.
|
|
774
775
|
- **Exit 2** — **still-running** (slow CI, not red): the poll cap fired
|
|
775
776
|
with checks still pending and the watcher exhausted its
|
|
776
777
|
`delivery.ci.watch.maxResumes` re-arm budget with nothing red. This is
|
|
777
778
|
**never** a failure and **never** `timed_out`. Hand the wait off to the
|
|
778
|
-
host's interval loop rather than blocking the delivery turn:
|
|
779
|
-
|
|
779
|
+
host's interval loop rather than blocking the delivery turn: `/loop 5m`
|
|
780
|
+
polling `gh pr checks` until the checks settle.
|
|
780
781
|
|
|
781
782
|
> **Triage authority.** How to classify and remediate a red (or repeatedly
|
|
782
783
|
> slow) check — the root-cause-only decision tree for infra/transient and
|