Skip to content

Commit 5aaad3e

Browse files
committed
Merge remote-tracking branch 'origin/dev' into bradygaster-orchestration-scope-control
2 parents c5e3fa5 + 93aec83 commit 5aaad3e

9 files changed

Lines changed: 229 additions & 47 deletions

File tree

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+
Correct the enlistment skill's strict compile gate for gh-aw v0.89.21 to accept only the exact native review advisory and bot-trigger warning. Preserve all reviewer controls, human approval, and hard stops for errors or any unexpected warning.

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,33 @@ This must run after any first-install approval and before committing. Success
222222
criteria:
223223

224224
- All eight workflows compile successfully.
225-
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
226-
configures both slash-command and `github-actions[bot]` triggers, and the bot
227-
trigger is required for controlled worker-continuation dispatches.
228-
- **STOP** on any error, or on **any additional warning** beyond that single
229-
documented one.
225+
- With gh-aw v0.89.21, require exactly two warnings, one occurrence of each
226+
exact diagnostic header below (including its workflow path):
227+
228+
<!-- compile-warning-allowlist-start -->
229+
```text
230+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
231+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
232+
```
233+
<!-- compile-warning-allowlist-end -->
234+
235+
The native review advisory includes the compiler's standard explanation and
236+
Security Lab link. The following guard-policy dry-run lines are informational,
237+
not another warning. The bot-trigger warning is expected because
238+
`github-actions[bot]` enables controlled worker-continuation dispatches.
239+
240+
Accept the native review advisory **only while all existing controls remain**:
241+
same-repository head restriction, base-controlled workflow source,
242+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
243+
least-privilege jobs, advisory verdict, and independent human approval.
244+
`pull_request_target` is not generally safe; this narrow exception neither
245+
weakens those controls nor authorizes PR-head execution.
246+
247+
**STOP** on any error, or on **any additional warning** beyond these two exact
248+
documented diagnostics. Also STOP if either warning is missing, duplicated,
249+
changed, or attributed to another path, if the summary is not
250+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
251+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
230252

231253
### 6. Require the verifier to prove the complete consumer contract
232254

‎docs/src/content/docs/guide/gh-aw.md‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,34 @@ gh aw compile --strict
341341
```
342342
343343
Run this exact command after any required first-install approval and before
344-
committing. It must report all eight workflows succeeded. `squad.md` currently
345-
emits one known warning because both slash-command and `github-actions[bot]`
346-
triggers are configured; the bot trigger is required for controlled worker
347-
continuation dispatches. Any error or any additional warning is a stop condition.
344+
committing. With gh-aw v0.89.21, require exactly two warnings, one occurrence
345+
of each exact diagnostic header below (including its workflow path):
346+
347+
<!-- compile-warning-allowlist-start -->
348+
```text
349+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
350+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
351+
```
352+
<!-- compile-warning-allowlist-end -->
353+
354+
The native review advisory includes the compiler's standard explanation and
355+
Security Lab link. The following guard-policy dry-run lines are informational,
356+
not another warning. The bot-trigger warning is expected because `squad.md`
357+
configures both slash-command and `github-actions[bot]` triggers for controlled
358+
worker-continuation dispatches.
359+
360+
Accept the native review advisory **only while all existing controls remain**:
361+
same-repository head restriction, base-controlled workflow source,
362+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
363+
least-privilege jobs, advisory verdict, and independent human approval.
364+
`pull_request_target` is not generally safe; this narrow exception neither
365+
weakens those controls nor authorizes PR-head execution.
366+
367+
**STOP** on any error, or on **any additional warning** beyond these two exact
368+
documented diagnostics. Also STOP if either warning is missing, duplicated,
369+
changed, or attributed to another path, if the summary is not
370+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
371+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
348372
349373
Verify the complete source/lock surface:
350374

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,33 @@ This must run after any first-install approval and before committing. Success
222222
criteria:
223223

224224
- All eight workflows compile successfully.
225-
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
226-
configures both slash-command and `github-actions[bot]` triggers, and the bot
227-
trigger is required for controlled worker-continuation dispatches.
228-
- **STOP** on any error, or on **any additional warning** beyond that single
229-
documented one.
225+
- With gh-aw v0.89.21, require exactly two warnings, one occurrence of each
226+
exact diagnostic header below (including its workflow path):
227+
228+
<!-- compile-warning-allowlist-start -->
229+
```text
230+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
231+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
232+
```
233+
<!-- compile-warning-allowlist-end -->
234+
235+
The native review advisory includes the compiler's standard explanation and
236+
Security Lab link. The following guard-policy dry-run lines are informational,
237+
not another warning. The bot-trigger warning is expected because
238+
`github-actions[bot]` enables controlled worker-continuation dispatches.
239+
240+
Accept the native review advisory **only while all existing controls remain**:
241+
same-repository head restriction, base-controlled workflow source,
242+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
243+
least-privilege jobs, advisory verdict, and independent human approval.
244+
`pull_request_target` is not generally safe; this narrow exception neither
245+
weakens those controls nor authorizes PR-head execution.
246+
247+
**STOP** on any error, or on **any additional warning** beyond these two exact
248+
documented diagnostics. Also STOP if either warning is missing, duplicated,
249+
changed, or attributed to another path, if the summary is not
250+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
251+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
230252

231253
### 6. Require the verifier to prove the complete consumer contract
232254

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,33 @@ This must run after any first-install approval and before committing. Success
222222
criteria:
223223

224224
- All eight workflows compile successfully.
225-
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
226-
configures both slash-command and `github-actions[bot]` triggers, and the bot
227-
trigger is required for controlled worker-continuation dispatches.
228-
- **STOP** on any error, or on **any additional warning** beyond that single
229-
documented one.
225+
- With gh-aw v0.89.21, require exactly two warnings, one occurrence of each
226+
exact diagnostic header below (including its workflow path):
227+
228+
<!-- compile-warning-allowlist-start -->
229+
```text
230+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
231+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
232+
```
233+
<!-- compile-warning-allowlist-end -->
234+
235+
The native review advisory includes the compiler's standard explanation and
236+
Security Lab link. The following guard-policy dry-run lines are informational,
237+
not another warning. The bot-trigger warning is expected because
238+
`github-actions[bot]` enables controlled worker-continuation dispatches.
239+
240+
Accept the native review advisory **only while all existing controls remain**:
241+
same-repository head restriction, base-controlled workflow source,
242+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
243+
least-privilege jobs, advisory verdict, and independent human approval.
244+
`pull_request_target` is not generally safe; this narrow exception neither
245+
weakens those controls nor authorizes PR-head execution.
246+
247+
**STOP** on any error, or on **any additional warning** beyond these two exact
248+
documented diagnostics. Also STOP if either warning is missing, duplicated,
249+
changed, or attributed to another path, if the summary is not
250+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
251+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
230252

231253
### 6. Require the verifier to prove the complete consumer contract
232254

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,33 @@ This must run after any first-install approval and before committing. Success
222222
criteria:
223223

224224
- All eight workflows compile successfully.
225-
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
226-
configures both slash-command and `github-actions[bot]` triggers, and the bot
227-
trigger is required for controlled worker-continuation dispatches.
228-
- **STOP** on any error, or on **any additional warning** beyond that single
229-
documented one.
225+
- With gh-aw v0.89.21, require exactly two warnings, one occurrence of each
226+
exact diagnostic header below (including its workflow path):
227+
228+
<!-- compile-warning-allowlist-start -->
229+
```text
230+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
231+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
232+
```
233+
<!-- compile-warning-allowlist-end -->
234+
235+
The native review advisory includes the compiler's standard explanation and
236+
Security Lab link. The following guard-policy dry-run lines are informational,
237+
not another warning. The bot-trigger warning is expected because
238+
`github-actions[bot]` enables controlled worker-continuation dispatches.
239+
240+
Accept the native review advisory **only while all existing controls remain**:
241+
same-repository head restriction, base-controlled workflow source,
242+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
243+
least-privilege jobs, advisory verdict, and independent human approval.
244+
`pull_request_target` is not generally safe; this narrow exception neither
245+
weakens those controls nor authorizes PR-head execution.
246+
247+
**STOP** on any error, or on **any additional warning** beyond these two exact
248+
documented diagnostics. Also STOP if either warning is missing, duplicated,
249+
changed, or attributed to another path, if the summary is not
250+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
251+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
230252

231253
### 6. Require the verifier to prove the complete consumer contract
232254

‎test/gh-aw-enlistment-skill.test.ts‎

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 2. Its frontmatter advertises the documented trigger phrases (discoverability).
1010
* 3. Its body still encodes every critical safety gate (allowlist, strict
1111
* compile, never-auto-merge, read-only token, explicit staging).
12-
* 4. The canonical source and both template mirrors are byte-for-byte identical
12+
* 4. The canonical source and all four mirrors are byte-for-byte identical
1313
* (the sync invariant every canonical skill upholds).
1414
*/
1515

@@ -42,6 +42,64 @@ function readLF(rel: string): string {
4242
return readRaw(rel).replace(/\r\n/g, '\n');
4343
}
4444

45+
const COMPILE_WARNINGS = [
46+
'.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.',
47+
".github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.",
48+
];
49+
50+
function assertCompileWarningContract(content: string): void {
51+
const regions = [...content.matchAll(
52+
/^<!-- compile-warning-allowlist-start -->\n```text\n([\s\S]*?)\n```\n<!-- compile-warning-allowlist-end -->$/gm,
53+
)];
54+
expect(regions).toHaveLength(1);
55+
expect(regions[0][1].split('\n')).toEqual(COMPILE_WARNINGS);
56+
const flat = content.replace(/\s+/g, ' ');
57+
expect(flat).toContain('require exactly two warnings, one occurrence of each exact diagnostic header');
58+
expect(flat).toContain('**STOP** on any error, or on **any additional warning** beyond these two exact documented diagnostics.');
59+
expect(flat).toContain('Also STOP if either warning is missing, duplicated, changed, or attributed to another path');
60+
expect(flat).toContain('Compiled 8 workflows: 8 succeeded, 2 warnings');
61+
expect(flat).toContain('or if any required control is absent.');
62+
expect(flat).toContain('Do not suppress warnings or use `--approve` to bypass this gate.');
63+
}
64+
65+
describe.each([CANONICAL, ...MIRRORS, GUIDE])('%s strict compile warning contract', path => {
66+
const content = readLF(path);
67+
68+
it('allows exactly the native review advisory and bot-trigger diagnostic with hard-stop semantics', () => {
69+
assertCompileWarningContract(content);
70+
});
71+
72+
it('conditions the native review exception on every existing control', () => {
73+
const flat = content.replace(/\s+/g, ' ');
74+
expect(flat).toContain('**only while all existing controls remain**');
75+
for (const control of [
76+
'same-repository head restriction', 'base-controlled workflow source',
77+
'`checkout: false` agent path', 'API-only inspection', 'exact run/head/attempt guard',
78+
'least-privilege jobs', 'advisory verdict', 'independent human approval',
79+
]) expect(flat).toContain(control);
80+
expect(flat).toContain('`pull_request_target` is not generally safe');
81+
});
82+
83+
it.each([
84+
['unknown third warning', `${COMPILE_WARNINGS.join('\n')}\n.github/workflows/squad.md: warning: unknown diagnostic`],
85+
['missing review warning', COMPILE_WARNINGS[1]],
86+
['missing bot warning', COMPILE_WARNINGS[0]],
87+
['duplicate warning', `${COMPILE_WARNINGS.join('\n')}\n${COMPILE_WARNINGS[0]}`],
88+
['different workflow path', COMPILE_WARNINGS.join('\n').replace('squad-review.md', 'untrusted.md')],
89+
['changed diagnostic', COMPILE_WARNINGS.join('\n').replace('very dangerous', 'safe')],
90+
])('rejects a contract mutation allowing %s', (_label, replacement) => {
91+
const mutated = content.replace(COMPILE_WARNINGS.join('\n'), replacement);
92+
expect(mutated).not.toBe(content);
93+
expect(() => assertCompileWarningContract(mutated)).toThrow();
94+
});
95+
96+
it('rejects removal of the error/additional-warning hard stop', () => {
97+
const mutated = content.replace('**STOP** on any error', 'Continue on any error');
98+
expect(mutated).not.toBe(content);
99+
expect(() => assertCompileWarningContract(mutated)).toThrow();
100+
});
101+
});
102+
45103
describe('gh-aw-enlistment skill', () => {
46104
it('canonical SKILL.md exists', () => {
47105
expect(existsSync(resolve(ROOT, CANONICAL)), `${CANONICAL} should exist`).toBe(true);
@@ -169,22 +227,6 @@ describe('gh-aw-enlistment skill', () => {
169227
expect(content).toMatch(/^gh aw compile --strict(\s+#[^\n]*)?$/m);
170228
});
171229

172-
it('permits only the documented bot-trigger warning', () => {
173-
expect(content).toMatch(/bot-trigger warning|bot trigger/i);
174-
});
175-
176-
// The permission above is only safe because it is paired with a hard halt
177-
// on anything else. Asserting the allowance alone would keep passing if
178-
// the STOP were deleted -- i.e. if the narrow exception silently became a
179-
// blanket "warnings are fine". Assert the gate itself, not just the
180-
// carve-out. Newlines are collapsed first because the sentence wraps.
181-
it('halts on any error or any warning beyond the documented one', () => {
182-
const flat = content.replace(/\s+/g, ' ');
183-
expect(flat).toMatch(
184-
/\*\*STOP\*\* on any error, or on \*\*any additional warning\*\* beyond that single documented one\./,
185-
);
186-
});
187-
188230
it('keeps the default workflow token read-only', () => {
189231
expect(content).toContain('default_workflow_permissions=read');
190232
});

‎workflows/skills/gh-aw-enlistment/SKILL.md‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,33 @@ This must run after any first-install approval and before committing. Success
222222
criteria:
223223

224224
- All eight workflows compile successfully.
225-
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
226-
configures both slash-command and `github-actions[bot]` triggers, and the bot
227-
trigger is required for controlled worker-continuation dispatches.
228-
- **STOP** on any error, or on **any additional warning** beyond that single
229-
documented one.
225+
- With gh-aw v0.89.21, require exactly two warnings, one occurrence of each
226+
exact diagnostic header below (including its workflow path):
227+
228+
<!-- compile-warning-allowlist-start -->
229+
```text
230+
.github/workflows/squad-review.md: warning: pull_request_target is a very dangerous trigger.
231+
.github/workflows/squad.md: warning: Both slash_command and bots triggers are configured. If a bot listed in bots: posts a comment that starts with the slash command text (e.g., /command-name), it will trigger the workflow and occupy the concurrency slot, potentially blocking simultaneous manual invocations. To ensure the workflow only runs on explicit user commands, remove the 'bots:' field.
232+
```
233+
<!-- compile-warning-allowlist-end -->
234+
235+
The native review advisory includes the compiler's standard explanation and
236+
Security Lab link. The following guard-policy dry-run lines are informational,
237+
not another warning. The bot-trigger warning is expected because
238+
`github-actions[bot]` enables controlled worker-continuation dispatches.
239+
240+
Accept the native review advisory **only while all existing controls remain**:
241+
same-repository head restriction, base-controlled workflow source,
242+
`checkout: false` agent path, API-only inspection, exact run/head/attempt guard,
243+
least-privilege jobs, advisory verdict, and independent human approval.
244+
`pull_request_target` is not generally safe; this narrow exception neither
245+
weakens those controls nor authorizes PR-head execution.
246+
247+
**STOP** on any error, or on **any additional warning** beyond these two exact
248+
documented diagnostics. Also STOP if either warning is missing, duplicated,
249+
changed, or attributed to another path, if the summary is not
250+
`Compiled 8 workflows: 8 succeeded, 2 warnings`, or if any required control is
251+
absent. Do not suppress warnings or use `--approve` to bypass this gate.
230252

231253
### 6. Require the verifier to prove the complete consumer contract
232254

0 commit comments

Comments
 (0)