Skip to content

Commit 534894c

Browse files
fix(gh-aw): restore hosted E2E and migrate package identity (#2410)
* fix(gh-aw): restore hosted E2E and migrate package identity - The hosted E2E guard keys on the repository ID instead of the owner name, so it runs again and fails loudly after any future rename - github/squad/workflows becomes the canonical package identity; existing bradygaster/squad/workflows installs still verify (exact allowlist), and mixed or duplicate ownership records fail with guidance - Install and upgrade docs check the revision's manifest before gh aw add - uses: github/squad/.github/actions/squad-init (same pinned SHA); the action's default release repository is github/squad - Package regenerated with squad-install-verifier --write-source Closes #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(gh-aw): guard legacy-identity upgrade cleanup and migration warnings Address two Copilot review findings on #2410. Stop the upgrade before any cleanup when the forced reinstall fails. The upgrade block in the gh-aw-enlistment skill, its four mirrors and the gh-aw guide deleted the legacy .github/aw/packages/bradygaster-squad-workflows-3632054824e8.json ownership record even when `gh aw add --force` failed, leaving the previous installation without its verification metadata. The block now stops with a STOP message before removing anything. The verifier prints its recovery and legacy-move commands as one && chain, so a failed reinstall stops them too, and its staged-tree message says to delete the legacy record only after the reinstall succeeds. Allow the four squad-init replacement warnings only during the legacy-identity migration. gh-aw v0.91.5 compares safe updates against the locks committed at HEAD. While legacy locks are committed, every strict compile, even after --approve, reports the bradygaster/squad -> github/squad squad-init owner change once each in squad.md, squad-implement-worker.md, squad-deps-worker.md and squad-retro.md (8 succeeded, 6 warnings), so the two-warning gate stopped a valid migration before it could be committed. The skill and the guide now allowlist exactly those four diagnostics and their exact change list during that migration only. Any other warning, change, duplicate or summary still stops the flow. Tests run each upgrade block and the verifier's printed commands with a failing and a succeeding stubbed `gh aw add`, and apply each document's warning gate to real gh-aw v0.91.5 output from a repository with committed legacy locks: with --approve, without it, and after the upgrade commit. Mutation tests reject a widened migration allowlist. Regenerate the package manifest and bootstrap verifier digest, and extend the changeset. Refs #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(gh-aw): pin squad-init downloads and harden upgrade recovery Address four Copilot review findings on #2410. Pass `repository: 'github/squad'` to the pinned squad-init action. At 5c662ba its `repository` input still defaults to bradygaster/squad, the source of the release archive, its SHA256SUMS checksum and the latest-release lookup. The new `uses:` owner did not change that, and the old path is now a fork with no releases, so whoever controls it would supply both the archive and its checksum. Regenerate the four package workflows and the integrity manifest. Stop the guide's Upgrading block and the README install block on a SQUAD_SHA that is not a 40-character lowercase commit SHA, before the manifest contents API call, with the guard and message the other guide blocks already use. The contents API accepts branch names, so `dev` passed the identity check: the upgrade reinstalled and deleted the legacy ownership record before --source-revision rejected it, and the README block installed and pushed the moving ref. The skill and its mirrors were already guarded. Reject an exact ownership record next to a case-variant one. Reinstalling GitHub/Squad/workflows as github/squad/workflows leaves both records, because gh-aw names each by a digest of the identity as typed, and the verifier used the exact one while ignoring the other. The error names both records and the one to delete. Run --materialize-runtime before `gh aw compile --strict` in the printed recovery chain, as the documented install and upgrade sequences do. `gh aw add --force` rewrites only the package-owned runtime copies, so a stale or missing materialized file, such as .github/workflows/shared/squad.md, failed verification again after a successful reinstall. Tests resolve the activation step's squad-init inputs into the pinned-action download harness, run every block that reads the manifest with SQUAD_SHA=dev, verify an install with both records, and run the printed recovery against a stale and a missing materialized file. Each fails with its fix reverted. Refs #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(gh-aw): drop legacy install fallback, verify staged case variants Revisions that declare only bradygaster/squad/workflows install the Squad CLI through squad-init without a repository input, so activation downloads the CLI and its checksum from bradygaster/squad. That repository is now a separately controlled fork with no releases. Stop sending users there: - The identity-gate STOP hint in the skill and its four mirrors, the guide and the README now says to use a revision whose manifest declares github/squad/workflows, or to ask the Squad maintainers for one, and says why older revisions are not an option. - Remove the instructions to install an older revision under the legacy identity or stay on one from the skill, the guide, the README, .github/agents.md and workflows/README.md, and the step-4 and anti-pattern allowance for the legacy squad-init action name outside the migration. - The verifier still accepts existing bradygaster/squad/workflows installs through its exact allowlist, and the documented legacy-to-canonical upgrade is unchanged. Its notice now says the legacy identity is accepted only so installations can move. --verify-staged-install also missed a case-variant ownership record, such as one for GitHub/Squad/workflows, that was deleted only from the working tree. The index still held it, so a clean checkout of the commit failed --verify-install. The staged check now lists .github/aw/packages/ one level deep and rejects any staged record whose package is a case variant of an accepted identity, naming its path. The step-7 deletion gate in the skill, its mirrors and both guide gates admits exactly that deletion: a .github/aw/packages/*.json record whose package at HEAD is a case variant. Regenerate the integrity manifest and bootstrap digests for the verifier and skill changes. Add a contract test that names file:line for any install hint or STOP message that falls back to the legacy identity, gate cases for the case-variant allowance, and a staged-verifier regression test that also verifies a clean checkout. Refs #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(gh-aw): pass repository in squad-init examples, move ownership hints Pinned squad-init revisions from before the action's default changed, such as 5c662ba, still download the Squad CLI and its checksum from bradygaster/squad, now a separately controlled fork. Changing the action owner in a usage example does not change that default. Pass repository: github/squad in the standalone-install example and in the action.yml usage comment, the two examples that lacked it; the package workflows already pass it. A new test scans every squad-init step in tracked Markdown and YAML, including YAML comments, and names the file:line of any that does not pass repository: github/squad. The verifier's ownership diagnostics could steer users back to the legacy identity. With an exact record beside a case-variant record, it said to reinstall as the exact record's identity, which may be bradygaster/squad/workflows. It now always recommends github/squad/workflows and lists a legacy exact record for deletion together with the case variants; a canonical exact record is kept. With both exact identities present, it no longer offers to keep whichever record matches the installed source bindings, which keeps the legacy record while those bindings are still legacy. Regenerate the integrity manifest and bootstrap digests for the verifier change. The case-variant test now covers both the canonical and the legacy exact record. Refs #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(gh-aw): one cleanup rule for extra Squad ownership records When canonical, legacy and case-variant ownership records coexisted, the verifier's advice left out the case variant, so following it still failed verification. A duplicate exact-identity record at a path gh-aw does not write got the computed legacy path instead of its own. findOwnershipRecord now applies one rule whenever more than one Squad record is found: it lists every record with its path and package, then says to delete every listed path except .github/aw/packages/github-squad-workflows-23a7638f599e.json after reinstalling as github/squad/workflows, because that reinstall writes exactly that record. The case-only hint uses the same rule, and records are read in sorted order so the advice is stable on every platform. The staging gate matches the advice. The skill's step-7 gate, its four mirrors and both guide gates replace the separate legacy-path allowance and the case-variant predicate with one rule. A staged deletion of .github/aw/packages/<name>.json passes only if it is not the canonical destination, its HEAD content is JSON, and its package, lowercased, is github/squad/workflows or bradygaster/squad/workflows. The router allowance is unchanged. --verify-staged-install now rejects any still-indexed Squad record other than the verified one, not only case variants. Regenerate the integrity manifest and bootstrap verifier digests. Refs #2403 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9c6fb7c commit 534894c

34 files changed

Lines changed: 3158 additions & 283 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@bradygaster/squad-cli': patch
3+
'@bradygaster/squad-sdk': patch
4+
---
5+
6+
Update the shipped gh-aw-enlistment skill for the repository's new home, `github/squad`. It now installs the gh-aw package as `github/squad/workflows`, links to the docs guide's new address, and allowlists the `github/squad/.github/actions/squad-init` action. Before installing or upgrading, it checks that the chosen Squad revision declares `github/squad/workflows` in its package manifest, and stops otherwise. It no longer suggests installing an older revision as `bradygaster/squad/workflows`, because such revisions download the Squad CLI from the separately controlled `bradygaster/squad` fork. It also explains how to move an installation off that legacy identity, which the install verifier accepts only so that existing installations can move. That upgrade stops before removing anything if the forced reinstall fails, and until it is committed, its strict compile gate accepts only the four expected squad-init owner-replacement warnings. Its staging gate also permits deleting any other Squad ownership record the install verifier tells you to delete, such as a duplicate or case-variant record, but never the `github/squad/workflows` record that gh-aw writes.

‎.github/actions/squad-init/action.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
# and the RFC in #1593).
1010
#
1111
# Usage:
12-
# - uses: bradygaster/squad/.github/actions/squad-init@<sha>
12+
# - uses: github/squad/.github/actions/squad-init@<sha>
1313
# with:
1414
# version: 'v0.11.0' # default: latest release
1515
# preset: 'default' # default: default
1616
# state-backend: 'local' # default: local
17+
# repository: 'github/squad' # older pins default to the bradygaster/squad fork
1718
#
1819
# Every input is optional; the defaults match what the gh-aw shared component
1920
# runs today.
@@ -41,7 +42,7 @@ inputs:
4142
repository:
4243
description: 'Repository to download release assets from. Point this at an internal mirror when github.com is unreachable.'
4344
required: false
44-
default: 'bradygaster/squad'
45+
default: 'github/squad'
4546
skip-init:
4647
description: 'Install the CLI but do not run squad init'
4748
required: false

‎.github/agents.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,19 @@ The quick start installs this workflow set:
4949

5050
```bash
5151
SQUAD_SHA="<40-character-commit-sha>" # explicit, maintainer-approved; never `commits/dev`
52-
gh aw add "bradygaster/squad/workflows@${SQUAD_SHA}"
52+
gh aw add "github/squad/workflows@${SQUAD_SHA}"
5353
rm -f .github/skills/agentic-workflows/SKILL.md
5454
```
5555

56+
`github/squad/workflows` verifies only at Squad revisions whose
57+
`workflows/squad-workflows.manifest.json` declares
58+
`"package": "github/squad/workflows"`; the quick start's identity check stops
59+
on any other revision. Do not install an older revision as
60+
`bradygaster/squad/workflows` instead: its activation downloads the Squad CLI
61+
from the separately controlled `bradygaster/squad` fork, which has no releases.
62+
Use a revision whose manifest declares `github/squad/workflows`, or ask the
63+
Squad maintainers for one.
64+
5665
The removal is intentional: gh-aw v0.91.5 generates that generic tool-owned
5766
router, which loads mutable prompts from the current `github/gh-aw` repository.
5867
It is not Squad-owned or bound to `SQUAD_SHA`. Keep the exact

‎.github/workflows/squad-gh-aw-hosted-e2e.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ concurrency:
2323
jobs:
2424
hosted-e2e:
2525
name: Install, merge, bootstrap, and probe
26+
# Bound to the immutable repository ID of github/squad rather than its name, so a
27+
# rename or transfer reaches source-preflight and fails loudly instead of skipping.
2628
if: >-
27-
github.repository == 'bradygaster/squad'
29+
github.repository_id == '1151205052'
2830
&& github.ref_name == github.event.repository.default_branch
2931
runs-on: ubuntu-latest
3032
timeout-minutes: 45

‎.squad-templates/skills/gh-aw-enlistment/SKILL.md‎

Lines changed: 171 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bootstrap pull request** — never an auto-merge.
2525
This skill **operationalizes** the supported bootstrap path. It does not summarize
2626
it: each step below is a gate with explicit success evidence and **STOP conditions**.
2727
The authoritative source is `docs/src/content/docs/guide/gh-aw.md` (mirrored at
28-
`https://bradygaster.github.io/squad/docs/guide/gh-aw/`). If that guide and this
28+
`https://github.github.com/squad/docs/guide/gh-aw/`). If that guide and this
2929
skill ever disagree, the guide wins — re-read it before proceeding.
3030

3131
GitHub Issues are a hard prerequisite: `/squad` commands arrive as issue
@@ -193,10 +193,34 @@ published release guidance, then set it once:
193193
echo "STOP: SQUAD_SHA must be the exact 40-character commit SHA, not a branch name or shortened hash." >&2
194194
exit 1
195195
}
196-
gh aw add "bradygaster/squad/workflows@${SQUAD_SHA}"
196+
# squad-package-identity-start
197+
squad_package="$(gh api --hostname github.com -H 'Accept: application/vnd.github.raw+json' \
198+
"repos/github/squad/contents/workflows/squad-workflows.manifest.json?ref=${SQUAD_SHA}" \
199+
--jq '.package')" || squad_package=""
200+
test "${squad_package}" = "github/squad/workflows" || {
201+
if [ -z "${squad_package}" ]; then
202+
echo "STOP: cannot read workflows/squad-workflows.manifest.json from github/squad at ${SQUAD_SHA}." >&2
203+
echo "Check gh auth status --hostname github.com and network access, and confirm SQUAD_SHA is a github/squad commit that has this manifest, then retry." >&2
204+
else
205+
echo "STOP: Squad ${SQUAD_SHA} does not declare the github/squad/workflows package (found '${squad_package}')." >&2
206+
echo "Use a revision whose manifest declares github/squad/workflows, or ask the Squad maintainers for one. Older revisions download the Squad CLI from the bradygaster/squad fork, which has no releases." >&2
207+
fi
208+
exit 1
209+
}
210+
# squad-package-identity-end
211+
gh aw add "github/squad/workflows@${SQUAD_SHA}"
197212
rm -f .github/skills/agentic-workflows/SKILL.md
198213
```
199214

215+
`github/squad/workflows` verifies only at Squad revisions whose
216+
`workflows/squad-workflows.manifest.json` declares
217+
`"package": "github/squad/workflows"`. The identity check above reads that
218+
manifest at `SQUAD_SHA` and stops on any other revision. Do not install an
219+
older revision under `bradygaster/squad/workflows` instead: its activation
220+
downloads the Squad CLI from the separately controlled `bradygaster/squad`
221+
fork, which has no releases. Use a revision whose manifest declares
222+
`github/squad/workflows`, or ask the Squad maintainers for one.
223+
200224
The nested `workflows/aw.yml` is the only supported distribution registration.
201225
It isolates package auto-discovery from unrelated repository skills and agents,
202226
and installs exactly eight workflows, seventeen runtime resources, and one
@@ -226,6 +250,65 @@ that exact file after every `gh aw add`. Keep
226250
the verifier requires its exact package bytes. Do not adopt or vendor the rest
227251
of gh-aw's generic scaffold.
228252

253+
Revisions whose `workflows/squad-workflows.manifest.json` declares
254+
`"package": "github/squad/workflows"` verify that identity and the legacy
255+
`bradygaster/squad/workflows` identity. Earlier revisions, including ones
256+
committed after the repository moved to `github/squad`, declare and verify only
257+
`bradygaster/squad/workflows`, and installations made from them carry it in
258+
their ownership record, workflow `source:` lines, and locks. Those revisions
259+
download the Squad CLI from the separately controlled `bradygaster/squad` fork,
260+
which has no releases, so move such an installation to a revision that declares
261+
`github/squad/workflows` with the block below. gh-aw keeps the superseded
262+
`.github/aw/packages/bradygaster-squad-workflows-3632054824e8.json` after the
263+
forced reinstall, so the block deletes exactly that file before verifying; the
264+
verifier fails closed while both ownership records exist. If the forced
265+
reinstall fails, the block stops before it removes anything. That first upgrade
266+
also makes `gh aw add` report one safe-update change: action
267+
`github/squad/.github/actions/squad-init` added and
268+
`bradygaster/squad/.github/actions/squad-init` removed. It is the same
269+
squad-init action under the repository's new owner; list it in the PR's
270+
security review note. **STOP** on any other new secret or action. Until the
271+
upgrade is committed, every strict compile repeats that change as four
272+
warnings, which step 5 allows only for this migration. Verifiers of revisions
273+
that declare `github/squad/workflows` still accept the legacy identity, so an
274+
existing installation keeps verifying while it moves, and they print a notice
275+
that says to move it.
276+
277+
```bash
278+
: "${SQUAD_SHA:?STOP: set SQUAD_SHA to an explicit, maintainer-approved 40-character Squad commit SHA before upgrading.}"
279+
[[ "${SQUAD_SHA}" =~ ^[0-9a-f]{40}$ ]] || {
280+
echo "STOP: SQUAD_SHA must be the exact 40-character commit SHA, not a branch name or shortened hash." >&2
281+
exit 1
282+
}
283+
squad_package="$(gh api --hostname github.com -H 'Accept: application/vnd.github.raw+json' \
284+
"repos/github/squad/contents/workflows/squad-workflows.manifest.json?ref=${SQUAD_SHA}" \
285+
--jq '.package')" || squad_package=""
286+
test "${squad_package}" = "github/squad/workflows" || {
287+
if [ -z "${squad_package}" ]; then
288+
echo "STOP: cannot read workflows/squad-workflows.manifest.json from github/squad at ${SQUAD_SHA}." >&2
289+
echo "Check gh auth status --hostname github.com and network access, and confirm SQUAD_SHA is a github/squad commit that has this manifest, then retry." >&2
290+
else
291+
echo "STOP: Squad ${SQUAD_SHA} does not declare the github/squad/workflows package (found '${squad_package}')." >&2
292+
echo "Use a revision whose manifest declares github/squad/workflows, or ask the Squad maintainers for one. Older revisions download the Squad CLI from the bradygaster/squad fork, which has no releases." >&2
293+
fi
294+
exit 1
295+
}
296+
gh aw add "github/squad/workflows@${SQUAD_SHA}" --force || {
297+
echo "STOP: gh aw add --force failed, so this block removed nothing. Fix the error above, then rerun the block." >&2
298+
exit 1
299+
}
300+
rm -f .github/skills/agentic-workflows/SKILL.md
301+
rm -f .github/aw/packages/bradygaster-squad-workflows-3632054824e8.json
302+
node .github/workflows/shared/squad-install-verifier.mjs --materialize-runtime
303+
gh aw compile --strict
304+
node .github/workflows/shared/squad-install-verifier.mjs \
305+
--verify-install \
306+
--source-revision "${SQUAD_SHA}" \
307+
--strict-compile
308+
```
309+
310+
Apply step 5's warning check, including its legacy-identity migration allowlist, to the compile output above, then stage and verify as in step 7.
311+
229312
Report/proposal-only is the default. Ordinary fixes require the explicit
230313
`"squadRetroAutoImplement": "allow"` setting in `.squad/config.json`;
231314
five action issues and three dispatches per wake-up remain separate caps.
@@ -247,7 +330,7 @@ On a clean repo, `gh aw add` reports these expected safe updates and **nothing e
247330

248331
<!-- allowlist-start -->
249332
- Restricted secrets: **`SQUAD_GITHUB_APP_PRIVATE_KEY`** and **`SQUAD_GITHUB_TOKEN`**
250-
- Action: **`bradygaster/squad/.github/actions/squad-init`**
333+
- Action: **`github/squad/.github/actions/squad-init`**
251334
<!-- allowlist-end -->
252335

253336
> **These are referenced names, not prerequisites.** `gh aw add` lists the secrets
@@ -307,11 +390,48 @@ least-privilege jobs, advisory verdict, and independent human approval.
307390
`pull_request_target` is not generally safe; this narrow exception neither
308391
weakens those controls nor authorizes PR-head execution.
309392

393+
**Legacy-identity migration only.** While step 3's upgrade block moves an
394+
installation whose locks committed at `HEAD` still use
395+
`bradygaster/squad/.github/actions/squad-init`, gh-aw v0.91.5 compares safe
396+
updates against those committed locks, and `--approve` cannot clear that
397+
comparison before the upgrade is committed. During that migration, also
398+
require exactly these four warnings, one occurrence of each exact diagnostic
399+
header:
400+
401+
<!-- compile-warning-migration-allowlist-start -->
402+
```text
403+
.github/workflows/squad.md: warning: safe update mode detected unapproved changes
404+
.github/workflows/squad-implement-worker.md: warning: safe update mode detected unapproved changes
405+
.github/workflows/squad-deps-worker.md: warning: safe update mode detected unapproved changes
406+
.github/workflows/squad-retro.md: warning: safe update mode detected unapproved changes
407+
```
408+
<!-- compile-warning-migration-allowlist-end -->
409+
410+
Each of these four warnings must report exactly this squad-init owner
411+
replacement, with no other secret, action, redirect, or change:
412+
413+
<!-- compile-warning-migration-changes-start -->
414+
```text
415+
New unapproved action(s):
416+
- github/squad/.github/actions/squad-init
417+
Previously-approved action(s) removed:
418+
- bradygaster/squad/.github/actions/squad-init
419+
```
420+
<!-- compile-warning-migration-changes-end -->
421+
422+
The remediation text under each warning and the closing `SECURITY REVIEW
423+
REQUIRED` prompts belong to these four warnings; they are not additional
424+
warnings. The summary is then `Compiled 8 workflows: 8 succeeded, 6 warnings`.
425+
Name the replacement in the PR's security review note. The four warnings no
426+
longer appear once the upgrade is committed.
427+
310428
**STOP** on any error, or on **any additional warning** beyond these two exact
311-
documented diagnostics. Also STOP if either warning is missing, duplicated,
312-
changed, or attributed to another path, if the summary is not
313-
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
314-
absent. Do not suppress warnings or use `--approve` to bypass this gate.
429+
documented diagnostics and, during that migration only, the four exact
430+
squad-init replacement warnings. Also STOP if an allowed warning is missing,
431+
duplicated, changed, or attributed to another path, if the summary is not
432+
`Compiled 8 workflows: 8 succeeded, 2 warnings` (`6 warnings` during that
433+
migration), or if any required control is absent. Do not suppress warnings or
434+
use `--approve` to bypass this gate.
315435

316436
### 6. Require the verifier to prove the complete consumer contract
317437

@@ -349,17 +469,40 @@ node .github/workflows/shared/squad-install-verifier.mjs \
349469
git diff --cached --stat
350470
unexpected_deletions="$(
351471
git diff --cached --diff-filter=D --name-only |
352-
grep -vxF '.github/skills/agentic-workflows/SKILL.md' || true
472+
grep -vxF -e '.github/skills/agentic-workflows/SKILL.md' |
473+
while IFS= read -r path; do
474+
# Also allowed: any Squad ownership record except the one gh-aw writes for github/squad/workflows.
475+
if [[ "${path}" =~ ^\.github/aw/packages/[^/]+\.json$ ]] &&
476+
[ "${path}" != '.github/aw/packages/github-squad-workflows-23a7638f599e.json' ] &&
477+
git show "HEAD:${path}" | node -e '
478+
const accepted = ["github/squad/workflows", "bradygaster/squad/workflows"];
479+
let text = "";
480+
process.stdin.on("data", chunk => { text += chunk; }).on("end", () => {
481+
let name;
482+
try { name = JSON.parse(text).package; } catch {}
483+
process.exit(typeof name === "string" && accepted.includes(name.toLowerCase()) ? 0 : 1);
484+
});'; then
485+
continue
486+
fi
487+
printf '%s\n' "${path}"
488+
done || true
353489
)"
354490
test -z "${unexpected_deletions}" || {
355491
printf 'STOP: unexpected staged deletions:\n%s\n' "${unexpected_deletions}" >&2
356492
exit 1
357493
}
358494
```
359495

360-
- The only permitted staged deletion is
496+
- The only permitted staged deletions are
361497
`.github/skills/agentic-workflows/SKILL.md`, when upgrading a repository that
362-
previously committed gh-aw's mutable router.
498+
previously committed gh-aw's mutable router, and a `.github/aw/packages/*.json`
499+
ownership record whose `package` is `github/squad/workflows` or
500+
`bradygaster/squad/workflows` in any letter case, other than
501+
`.github/aw/packages/github-squad-workflows-23a7638f599e.json`, the record gh-aw
502+
writes for `github/squad/workflows`. Those are the records the verifier tells
503+
you to delete, such as the superseded
504+
`.github/aw/packages/bradygaster-squad-workflows-3632054824e8.json` when moving
505+
an existing installation off the legacy `bradygaster/squad/workflows` identity.
363506
- **STOP** if the staged diff shows any other **unexpected deletions**, **unexpected secrets**,
364507
edits to **unrelated files**, or committed **log/diagnostic output**. Re-scope with
365508
explicit `git add -- <path>` — never `git add .`, `git add -A`, or `git commit -a`.
@@ -498,7 +641,20 @@ git switch -c chore/squad-gh-aw-bootstrap
498641
echo "STOP: SQUAD_SHA must be an explicit, maintainer-approved 40-character lowercase hex commit SHA." >&2
499642
exit 1
500643
}
501-
gh aw add "bradygaster/squad/workflows@${SQUAD_SHA}"
644+
squad_package="$(gh api --hostname github.com -H 'Accept: application/vnd.github.raw+json' \
645+
"repos/github/squad/contents/workflows/squad-workflows.manifest.json?ref=${SQUAD_SHA}" \
646+
--jq '.package')" || squad_package=""
647+
test "${squad_package}" = "github/squad/workflows" || {
648+
if [ -z "${squad_package}" ]; then
649+
echo "STOP: cannot read workflows/squad-workflows.manifest.json from github/squad at ${SQUAD_SHA}." >&2
650+
echo "Check gh auth status --hostname github.com and network access, and confirm SQUAD_SHA is a github/squad commit that has this manifest, then retry." >&2
651+
else
652+
echo "STOP: Squad ${SQUAD_SHA} does not declare the github/squad/workflows package (found '${squad_package}')." >&2
653+
echo "Use a revision whose manifest declares github/squad/workflows, or ask the Squad maintainers for one. Older revisions download the Squad CLI from the bradygaster/squad fork, which has no releases." >&2
654+
fi
655+
exit 1
656+
}
657+
gh aw add "github/squad/workflows@${SQUAD_SHA}"
502658
rm -f .github/skills/agentic-workflows/SKILL.md
503659

504660
# Safe-update report shows ONLY the two documented secrets + squad-init → approve once
@@ -566,13 +722,14 @@ gh pr merge --squash # auto-merge before human review. NEVER.
566722
`.github/skills/agentic-workflows/SKILL.md`; keep the exact Squad-owned
567723
`.github/skills/gh-aw-enlistment/SKILL.md`.
568724
- ❌ **Approving unknown safe updates.** Approve ONLY `SQUAD_GITHUB_APP_PRIVATE_KEY`,
569-
`SQUAD_GITHUB_TOKEN`, and `bradygaster/squad/.github/actions/squad-init`. Anything
725+
`SQUAD_GITHUB_TOKEN`, and `github/squad/.github/actions/squad-init`. Anything
570726
else is a STOP.
571727
- ❌ **Treating `--approve` as the final compile.** Always finish with a plain
572728
`gh aw compile --strict` (no `--approve`).
573729
- ❌ **Tolerating extra warnings.** Only the documented `squad-review.md`
574-
`pull_request_target` advisory and `squad.md` bot-trigger warning are allowed;
575-
every other warning or error halts the run.
730+
`pull_request_target` advisory and `squad.md` bot-trigger warning are allowed,
731+
plus step 5's four squad-init replacement warnings during the legacy-identity
732+
migration only; every other warning or error halts the run.
576733
- ❌ **Committing diagnostics.** Never commit `.github/aw/logs/` output; add the
577734
log `.gitignore` if missing.
578735
- ❌ **Clobbering existing workflows.** The install is additive; preserve unrelated

0 commit comments

Comments
 (0)